Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/14/06 21:45
Read: times


 
#118330 - Erroneous direct jumps with RSEG
Hi,

after a lot of years programing this uC, I now want to use multi module programing and relative segments. My tools are the "classic" Intel AMS51 (V2.3), RL51 (V3.2), OH (V1.0) and LIB51. I found no detailed documentation about programing with relative segments. Just some like "define with SEGMENT, use with RSEG". But I have a big (beginner's???) problem. Backward direct jumps do not jump correctly, the linker (?) manages relative adresses as absolute adresses. I will explain with following code (has no sense, but illustrates):

CODESEG SEGMENT CODE

RSEG CODESEG

MAIN:
SETB ES
SETB EA
SJMP TEST
; these lines will never run, just for filling
CLR ES
CLR EA
TEST:
SJMP MAIN

END

Ok, now command lines:
ASM51 MAIN.ASM ----------> OK
RL51 MAIN.OBJ TO NEW.OBJ CODE(CODESEG(30H)) ----> OK
OH NEW.OBJ ------------> OK

Now disassembled:
0030 SETB ES
0032 SETB EA
0034 SJMP 003AH
0036 CLR ES
0038 CLR EA
003A SJMP 0000H ----------> ERROR!!!

As you see, the last SJMP is erroneous, it jumps to 0000H (absolute) but should be 0030H (absolute, 0000H relative)

Using DEBUG info, the NEW.M51 reports correct symbol for MAIN:
C:0030H SYMBOL MAIN

What's the matter? OH? I guess, it could be a version issue, because I got RL51 separate from ASM51 and OH. Is there a newer version of OH?

Thanks.

PS: Perhaps this issue is so basic you will laugh about, but please, I'm not a rookie with the 8051, only with relative segments. I search the web and this site, but didn't find anything.

List of 3 messages in thread
TopicAuthorDate
Erroneous direct jumps with RSEG            01/01/70 00:00      
   No help?            01/01/70 00:00      
   whwre is 'main:'            01/01/70 00:00      

Back to Subject List