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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/23/04 22:14
Read: times


 
#73053 - Code generation using Keil A51 assembler
I am running the Keil A51 assembler under windows 2000 to assemble 8051 code for the Atmel AT89C55WD mcu.

I am migrating code from an old assembler to the Keil A51 Assembler we have recently purchased. I have converted our assembly source files by modifying directives and keywords to get our existing code to compile - all conversions were done without modifying the code itself. After assembling all code into a binary file I compared the code with the binary file the old assembler generated by disassembling both using the D52 disassembler. The code generated is quite different. For example, I have interrupt vectors that handle processor reset, timer overflow, etc.. The code in the binary file assembled with the Keil assembler does not look anything like my code. I have removed the Startup.A51 file from the microVision project workspace in case that might be the issue but it still doesn't make any difference. I definitely do not want to use the STARTUP.A51 code. The existing code we have takes care of all necessary initialization. Why am I not seeing my startup code? What is the Keil assembler doing to make such a difference? Do I need to change some options in microvision? Here are the first few lines of my first source file, the disassembled listing of the Keil binary file and the disassembled listing of the old assembler. Any feedback is appreciated.

Thanks for your feedback in advance!

Marek

;First few lines of code from my source file
EXTRN CODE (INITAL)

PROG SEGMENT CODE

CSEG AT 00H
ljmp INITAL

CSEG AT 03H
clr EX0
setb P2.5 ; comment this out for ceibo
mov VOLTS,BATIME
reti

;timer0
CSEG AT 0BH
jb IFC,L002A
sjmp L005F


CSEG AT 013H
reti

;timer1
CSEG AT 01BH
jb IFC,L0048
ljmp L00B5


CSEG AT 023H
L0023:
ljmp L01F6

RSEG PROG
L0026:
setb P2.3
sjmp L0032
;more code to follow....



Here is what the Keil assembler generates:
;
; D52 V3.3.1 8052 Disassembly of fx2pro17.bin
; 06/23/04 10:41
;
org 0
;
X0000: jnz X0079 ; 0000 70 77 pw
nop ; 0002 00 .
;
org 4
;
X0004: ajmp X0241 ; 0004 41 41 AA
;
addc a,31h ; 0006 35 31 51
jb 24h.2,X0051 ; 0008 20 22 46 "F
anl a,r0 ; 000b 58 X
addc a,#30h ; 000c 34 30 40
acall X0154 ; 000e 31 54 1T
add a,r6 ; 0010 2e .
ajmp X0253 ; 0011 41 53 AS
;
orl a,r5 ; 0013 4d M
X0014: ret ; 0014 22 "
;
jb 2ah.3,X005d ; 0015 20 53 45 SE
anl a,#28h ; 0018 54 28 T(
anl 4dh,#41h ; 001a 53 4d 41 SMA
orl a,r4 ; 001d 4c L
orl a,r4 ; 001e 4c L
add a,r4 ; 001f 2c ,
orl a,r7 ; 0020 4f O
orl a,r4 ; 0021 4c L
orl a,#42h ; 0022 44 42 DB
orl a,r7 ; 0024 4f O
ajmp X0252 ; 0025 41 52 AR
;
orl a,#3dh ; 0027 44 3d D=
acall X012c ; 0029 31 2c 1,
orl 45h,#49h ; 002b 43 45 49 CEI
orl 4fh,a ; 002e 42 4f BO
addc a,r5 ; 0030 3d =
jnb 25h.4,X007b ; 0031 30 2c 47 0,G
orl a,r7 ; 0034 4f O
orl a,r4 ; 0035 4c L
orl a,#3dh ; 0036 44 3d D=
jnb 25h.4,X0081 ; 0038 30 2c 46 0,F
anl a,r0 ; 003b 58 X
reti ; 003c 32 2
;
jnc X0091 ; 003d 50 52 PR
orl a,r7 ; 003f 4f O
addc a,r5 ; 0040 3d =
acall X0129 ; 0041 31 29 1)
jb 28h.5,X0096 ; 0043 20 45 50 EP
nop ; 0046 00 .
;
org 48h
;
swap a ; 0048 c4 D
push s1sta ; 0049 c0 d9 @Y



;Here is what my old assembler generates:

;
; D52 V3.3.1 8052 Disassembly of fx2pro16.bin
; 06/23/04 10:13
;
org 0
;
X0000: ljmp X07fd ; 0000 02 07 fd ..}
;
clr ex0 ; 0003 c2 a8 B(
setb p2.5 ; 0005 d2 a5 R%
X0007: mov 62h,35h ; 0007 85 35 62 .5b
reti ; 000a 32 2
;
jb 22h.0,X002a ; 000b 20 10 1c ..
sjmp X005f ; 000e 80 4f .O
;
org 13h
;
reti ; 0013 32 2
;
org 1bh
;
jb 22h.0,X0048 ; 001b 20 10 2a .*
ljmp X00b5 ; 001e 02 00 b5 ..5
;
org 23h
;
X0023: ljmp X01ec ; 0023 02 01 ec ..l
;
X0026: setb p2.3 ; 0026 d2 a3 R#
sjmp X0032 ; 0028 80 08 ..
;
X002a: jnb 21h.4,X0026 ; 002a 30 0c f9 0.y
cpl p2.3 ; 002d b2 a3 2#
jb 21h.3,X0023 ; 002f 20 0b f1 .q


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