Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me fix errors in Assembly code written in RIDE software

Status
Not open for further replies.

ednan

Advanced Member level 4
Joined
Feb 13, 2007
Messages
118
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
2,059
this assemble code is build using RIDE software...but m using Keil software and it gives error..plz tell me wat i do....

#include reg_51.inc

MAG1 EQU P1.0
MAG2 EQU P1.2
LOOP1 EQU P1.4
LOOP2 EQU P1.7

FIRE1 EQU P3.6
FIRE2 EQU P3.7

TOUCH EQU P1.6

MAG1L EQU P0.0
MAG2L EQU P0.1
LOOP1L EQU P0.2
LOOP2L EQU P0.3
FIRE1L EQU P0.4
FIRE2L EQU P0.5
TOUCHL EQU P0.6

BUZZER EQU P0.7

RB0 EQU 000H ; Select Register Bank 0
RB1 EQU 008H ; Select Register Bank 1 ...poke to PSW to use

DSEG ; This is internal data memory
ORG 20H ; Bit adressable memory

COUNT: DS 1

STACK: DS 1 ; Stack begins here
CSEG ; Code begins here

;---------==========----------==========---------=========---------
; PROCESSOR INTERRUPT AND RESET VECTORS
;---------==========----------==========---------=========---------

ORG 0000H ; Reset
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
; MAIN PROGRAM
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
MAIN:
MOV PSW,#RB0 ; Select register bank 0
MOV SP,STACK
MOV P0,#0FFH
CLR TOUCHL

TOP: MOV COUNT,#00H
MOV P1,#0FFH
MOV P3,#0FFH
JB MAG1,LED1 ;Chk Magnetic Sensor 1
SETB MAG1L
LD1: JB MAG2,LED2 ;Chk Magnetic Sensor 2
SETB MAG2L
LD2: JB LOOP1,LED3 ;Chk Loop Sensor 1
SETB LOOP1L
LD3: JB LOOP2,LED4 ;Chk Loop Sensor 2
SETB LOOP2L
LD4: JNB FIRE1,LED5 ;Chk Fire sensor 1
SETB FIRE1L
LD5: JNB FIRE2,LED6 ;Chk Fire sensor 2
SETB FIRE2L
LD6: JB TOUCH,LED7 ;Chk Touch sensor
SETB TOUCHL
LD7: MOV A,COUNT
CJNE A,#0FFH,TOPS
SETB BUZZER
AJMP TOP
TOPS: CLR BUZZER
AJMP TOP


LED1: CLR MAG1L
MOV COUNT,#0FFH
AJMP LD1

LED2: CLR MAG2L
MOV COUNT,#0FFH
AJMP LD2

LED3: CLR LOOP1L
MOV COUNT,#0FFH
AJMP LD3

LED4: CLR LOOP2L
MOV COUNT,#0FFH
AJMP LD4

LED5: CLR FIRE1L
MOV COUNT,#0FFH
AJMP LD5

LED6: CLR FIRE2L
MOV COUNT,#0FFH
AJMP LD6

LED7: CLR TOUCHL
MOV COUNT,#0FFH
AJMP LD7
;**********************************************************
END
 

Re: Need Help...

can you please describe what error is coming.
or
please upload snapshots of that output error..
 

Re: Need Help...

2 errors are coming...
1)error A309:bad or missing File name
2)ErrorA318:can't open file ' '
 

Need Help...

i dont see error message ! can u pls give wht type of error u got ?
 

Re: Need Help...

shiv_emf said:
i dont see error message ! can u pls give wht type of error u got ?

the error was due to IDE.
in RIDE the way of including header file is littlebit different from others.
so may be this code will run perfectly in other one..
but it will give an error in RIDE-IDE.
 

Re: Need Help...

Thanx..Ya it will ma this problem using

$include(REG51.inc)

but now 63 errors comes...and the error is ..."Attempt to define an already define symbol"

and this REG_51 includes this data...
;----------------------------------------------
; Register Declarations for the 8051 Processor
; Copyright (c) Raisonance SA, 1987-1996
;----------------------------------------------

; BYTE Register
P0 DATA 80H
P1 DATA 90H
P2 DATA 0A0H
P3 DATA 0B0H
PSW DATA 0D0H
ACC DATA 0E0H
B DATA 0F0H
SP DATA 81H
DPL DATA 82H
DPH DATA 83H
PCON DATA 87H
TCON DATA 88H
TMOD DATA 89H
TL0 DATA 8AH
TL1 DATA 8BH
TH0 DATA 8CH
TH1 DATA 8DH
IE DATA 0A8H
IP DATA 0B8H
SCON DATA 98H
SBUF DATA 99H


; BIT Register
; PSW
CY BIT 0D7H
AC BIT 0D6H
F0 BIT 0D5H
RS1 BIT 0D4H
RS0 BIT 0D3H
OV BIT 0D2H
P BIT 0D0H
; TCON
TF1 BIT 8FH
TR1 BIT 8EH
TF0 BIT 8DH
TR0 BIT 8CH
IE1 BIT 8BH
IT1 BIT 8AH
IE0 BIT 89H
IT0 BIT 88H
; IE
EA BIT 0AFH
ES BIT 0ACH
ET1 BIT 0ABH
EX1 BIT 0AAH
ET0 BIT 0A9H
EX0 BIT 0A8H
; IP
PS BIT 0BCH
PT1 BIT 0BBH
PX1 BIT 0BAH
PT0 BIT 0B9H
PX0 BIT 0B8H
; P3
RD BIT 0B7H
WR BIT 0B6H
T1 BIT 0B5H
T0 BIT 0B4H
INT1 BIT 0B3H
INT0 BIT 0B2H
TXD BIT 0B1H
RXD BIT 0B0H
; SCON
SM0 BIT 9FH
SM1 BIT 9EH
SM2 BIT 9DH
REN BIT 9CH
TB8 BIT 9BH
RB8 BIT 9AH
TI BIT 99H
RI BIT 98H
 

Re: Need Help...

ednan said:
Thanx..Ya it will ma this problem using

$include(REG51.inc)

but now 63 errors comes...and the error is ..."Attempt to define an already define symbol"

and this REG_51 includes this data...
;----------------------------------------------
; Register Declarations for the 8051 Processor
; Copyright (c) Raisonance SA, 1987-1996
;----------------------------------------------

; BYTE Register
P0 DATA 80H
P1 DATA 90H
P2 DATA 0A0H
P3 DATA 0B0H
...
....
....
....

RI BIT 98H

yes it is obvious
because these all port and registers are already defined in the registry file
which you are including in the beginning of the code as header file.

$include(REG51.inc)
so no need to define again.

if you want to see, where they are then follow this steps.
go to project window in RIDE and try to open all the files included in this project.
you can see even that path of header file too.

hope so it will help you.
and if still you have any doubt fell free to post.
 

Re: Need Help...

Ya it works...Thanx Alot...Now tell me how can i generate a HEX using Ride software...So i can burn it on Micro controller
 

Re: Need Help...

ednan said:
Ya it works...Thanx Alot...Now tell me how can i generate a HEX using Ride software...So i can burn it on Micro controller

for that you have to follow these steps..

1.make new project and selet your tool.
2. go to project window and add source node (a51 file in which you have written code.) by right click on it.
3. then click on the third from right menu button shown in middle (written some binary numbers)
4. then click on second button from right in same menu.

that it.
if you are still confused.
follow the attachment.

then go to the folder where you have this file.
you will find here the hex file having same name of your source file.

hope so it will clear your doubts...:D :D
 

Re: Need Help...

hi guys
I am using RIDE51 but it is restricted to 2kByte of codes. can you tell me any way to make it free? I mean freely because I cant buy it. any help would be appreciated.

THANKS
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top