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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/24/04 00:12
Read: times


 
#73074 - RE: Code generation using Keil A51 assembler
Responding to: ???'s previous message
Ok, I simplified things as much as I could. I put together a single file with just a few lines of code, shown below. I assemble it under Microvision IDE. I am able to step through this code using microvision debugger and the code looks exactly as my source code. However, when I disassemble the code using D52 with the command "d52 -d test", it looks quite different.
Maybe using d52 or "my use of it" is the problem.
Can you recommend a different way of disassembling the binary file that may yield the correct result?

My goal here is to compare the binary files created by my old assembler and Keil A51 assembler to make sure there are no differences in logic. I thought using d52 to disassemble the files and then doing a diff using CodeWright would do the trick. Any suggestions to do this a better way?

Again, thanks for your feedback.

Marek

NAME SAMPLE
PROG SEGMENT CODE
CSEG AT 00H
ljmp INITAL
CSEG AT 03H
clr EX0
reti
RSEG PROG
INITAL:
mov IE,#000h ;Turn off interrupts
mov SP,#007h ;Initialize SP
infinite_loop:
sjmp infinite_loop
RET

END



Here is what D52 produces:
;
; D52 V3.3.1 8052 Disassembly of test3.bin
; 06/23/04 15:45
;
org 0
;
X0000: jnz X0046
nop
;
org 4
;
dec r6
ajmp X0235
;
acall X0120
ret
;
orl a,@r0
anl a,r0
addc a,#30h
acall X0154
add a,r6
ajmp X0253
;
X0013: orl a,r5
ret
;
jb 2ah.3,X005d
anl a,#28h
anl 4dh,#41h
orl a,r4
orl a,r4
add a,r1
jb 28h.5,X0073
nop
;
org 25h
;
inc @r0
inc @r0
djnz r2,X0069
inc r2
orl a,@r0
anl a,r0
addc a,#30h
acall X0154
add a,r6
orl a,r7
orl 4ah,a
ajmp X0000
;
cjne @r0,#5,X0013
jc X0046
orl a,@r0
anl a,r0
addc a,#30h
acall X0154
add a,r6
ajmp X0253
;
orl a,r5
nop
X0046: xch a,r4
jnz X008d
nop
;
org 4bh
;
jbc 28h.2,X009a
addc a,31h
jb 28h.0,X00c7
xrl a,73h
mov a,#33h
add a,r6
xrl a,r4
xrl a,r6
jnz X007c
nop
X005d: nop
movc a,@a+dptr
inc s1dat
jc X006c
mov a,#65h
jmp @a+dptr
;
mov a,#33h
add a,r6
X0069: xrl 69h,a
xrl a,r6
X006c: rr a
nop
xrl a,r4
inc s1dat
jc X007c
X0073: mov a,#65h
jmp @a+dptr
;
mov a,#33h
add a,r6
xrl a,r4
xrl a,r6
jnz X0081
nop
xrl a,r4
inc s1dat
X0081: jc X008d
orl a,@r0
anl a,r0
addc a,#30h
acall X0154
add a,r6
xrl a,r7
xrl 6ah,a
X008d: cjne r6,#2,X009a
nop
inc @r0
anl 41h,#4dh
jnc X00e3
orl a,t3
nop
X009a: add a,r5
inc @r0
inc @r1
nop
;
org 0a1h
;
ljmp X0006
;
mov a,r3
inc @r0
inc @r1
nop
;
org 0a9h
;
rr a
nop
clr ex0
reti
;
anl a,#6
inc r5
nop
;
org 0b3h
;
inc @r0
nop
mov ie,#0
mov sp,#7
X00bb: sjmp X00bb
;
ret
;
add a,r5
inc a
inc r4
nop
inc @r0
anl 41h,#4dh
jnc X0114
orl a,rb0r0
nop
ajmp X0000
;
add a,@r1
;
; Register/Memory Equates
;
rb0r0 equ 0
;
; Miscellaneous equates
;
; These are addresses referenced in the code but
; which are in the middle of a multibyte instruction
; or are addresses outside the initialized space
;
X0006 equ 6
X007c equ 7ch
X00c7 equ 0c7h
X00e3 equ 0e3h
X0114 equ 114h
X0120 equ 120h
X0154 equ 154h
X0235 equ 235h
X0253 equ 253h
;
end
;


List of 15 messages in thread
TopicAuthorDate
Code generation using Keil A51 assembler            01/01/70 00:00      
   RE: Code generation using Keil A51 assembler            01/01/70 00:00      
      RE: Code generation using Keil A51 assembler            01/01/70 00:00      
         RE: Code generation using Keil A51 assembler            01/01/70 00:00      
            RE: Code generation using Keil A51 assembler            01/01/70 00:00      
               RE: Code generation using Keil A51 assembler            01/01/70 00:00      
                  RE: Code generation using Keil A51 assembler            01/01/70 00:00      
                     Debug Info?            01/01/70 00:00      
                        RE: Debug Info?            01/01/70 00:00      
               RE: Code generation using Keil A51 assembler            01/01/70 00:00      
                  RE: Code generation using Keil A51 assembler            01/01/70 00:00      
   RE: Code generation using Keil A51 assembler            01/01/70 00:00      
   can i connect aPOT with the ports dirct            01/01/70 00:00      
      RE: can i connect aPOT with the ports dirct            01/01/70 00:00      
   RE: Code generation using Keil A51 assembler            01/01/70 00:00      

Back to Subject List