This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

incorrect hex generation from keil (no values for jump addresses)

hi i am using keil uVision3. i have written a simple code in assemply language which contains jump instructions like sjmp,jnz jb . when i generate the hex file from this asm file all the other values in the hex file are correct except for the jump addresses corresponding to these instructions

my asm file is as follows

reset: ljmp start nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop
start: mov A,#00h
-- mov P0,#0ffh
-- mov P1,#0ffh
-- jb p1.0,jump1
jump1: jnz jump2
-- mov a,P0
-- mov R0,a
-- mov a,#00h
-- inc a
-- ret
jump2: mov a,P0
-- mov R1,a
-- sjmp jump3
-- ret
jump3: mov A,R1
-- add A,R0
-- mov P0,A
-- clr P1.2
-- setb P1.2
-- clr P1.2
-- ret
-- end

(i have used "--" for formatting this msg its not part of actual .asm file )
and the hex file i get is like this

:1000000002001D00000000000000000000000000D1
:1000100000000000000000000000000000740075F7
:1000200080FF7590FF2090007007E580F874000451
:1000300022E580F9800122E928F580C292D292C29D
:0200400092220A
:00000001FF

here u can see that hex corresponding to jb is 20 (3rd line) after that address of port p1.0 which is 90 but the address that it should jump comes out to be 00 which is incorrect.
the address should be 28(hex)

{you can calculate the address by writting one byte per line or generate a dua file from the hex file}

please tell me if i am missing out on something.......and tell me how to generate a correct hex file

Parents
  • one could easily see that the so called seniors are very rude.
    There is, today an expectation that every statement is wrapped in pink cotton.

    e.g. I posted "WHY do you refuse to work with chapter 2 of "the bible" instead of making incorrect statementsin the forum" instead of posting "I will gladly read the manual for you, find the relavant paragraph and quote it here, please come back when you need me to read the manual for you again"

    if thst is what is supposed to be posted to not be "rude" expect rudeness (as you define it).

    Erik

Reply
  • one could easily see that the so called seniors are very rude.
    There is, today an expectation that every statement is wrapped in pink cotton.

    e.g. I posted "WHY do you refuse to work with chapter 2 of "the bible" instead of making incorrect statementsin the forum" instead of posting "I will gladly read the manual for you, find the relavant paragraph and quote it here, please come back when you need me to read the manual for you again"

    if thst is what is supposed to be posted to not be "rude" expect rudeness (as you define it).

    Erik

Children
No data