hi there community
i would like to create a 8051 hex from a previous hex file
i dissembled the hex then i wanted to add some personal code to the begining
but the original hex have some LJMP and ACALL instructions wich jump to specified adress
but if i add my personal code then original code addresses must be changed to new values.
is there an application that can convert for example
ACALL 0120H
to
ACALL label1 (then add this label1 to the address 0120H)
this way code will jump to specified label instead of wrong address .
my personal code :
MOV A,#0
MOV DPTR,#4000H
MOVX A,@DPTR
MOV R0,A
DJNZ R0,AGAIN
MOV 0C7H,#0AAH
MOV 0C7H,#055H
ORL 087H,#02h
AGAIN: MOV A,#0
MOV A,R0
MOVX @DPTR,A
and this is the beginning of original hex
LJMP 002CH
RETI
NOP
NOP
NOP
NOP
NOP
NOP
NOP
LJMP 0650H
RETI
NOP
NOP
NOP
NOP
RETI
NOP
NOP
NOP
NOP
NOP
NOP
NOP
RETI
NOP
NOP
NOP
NOP
NOP
NOP
NOP
RETI
NOP
NOP
NOP
NOP
NOP
NOP
NOP
RETI
LCALL 0819H
CLR 4CH
MOV DPTR,#1800H
MOV A,#0AAH
MOVX @DPTR,A
INC DPTR
MOV A,#0A5H
MOVX @DPTR,A
MOV DPTR,#1809H
MOV A,#0F0H
MOVX @DPTR,A
MOV DPTR,#1808H
i would like to create a 8051 hex from a previous hex file
i dissembled the hex then i wanted to add some personal code to the begining
but the original hex have some LJMP and ACALL instructions wich jump to specified adress
but if i add my personal code then original code addresses must be changed to new values.
is there an application that can convert for example
ACALL 0120H
to
ACALL label1 (then add this label1 to the address 0120H)
this way code will jump to specified label instead of wrong address .
my personal code :
MOV A,#0
MOV DPTR,#4000H
MOVX A,@DPTR
MOV R0,A
DJNZ R0,AGAIN
MOV 0C7H,#0AAH
MOV 0C7H,#055H
ORL 087H,#02h
AGAIN: MOV A,#0
MOV A,R0
MOVX @DPTR,A
and this is the beginning of original hex
LJMP 002CH
RETI
NOP
NOP
NOP
NOP
NOP
NOP
NOP
LJMP 0650H
RETI
NOP
NOP
NOP
NOP
RETI
NOP
NOP
NOP
NOP
NOP
NOP
NOP
RETI
NOP
NOP
NOP
NOP
NOP
NOP
NOP
RETI
NOP
NOP
NOP
NOP
NOP
NOP
NOP
RETI
LCALL 0819H
CLR 4CH
MOV DPTR,#1800H
MOV A,#0AAH
MOVX @DPTR,A
INC DPTR
MOV A,#0A5H
MOVX @DPTR,A
MOV DPTR,#1809H
MOV A,#0F0H
MOVX @DPTR,A
MOV DPTR,#1808H
Last edited: