1 ;-------------------------------------------------------- 2 ; File Created by SDCC : FreeWare ANSI-C Compiler 3 ; Version 2.5.0 #1020 (Sep 22 2005) 4 ; This file generated Thu Oct 27 21:43:45 2005 5 ;-------------------------------------------------------- 6 .module test 7 .optsdcc -mmcs51 --model-small 8 9 ;-------------------------------------------------------- 10 ; Public variables in this module 11 ;-------------------------------------------------------- 12 .globl _main 13 .globl _TD_Init 14 .globl _EIPX6 15 .globl _EIPX5 16 .globl _EIPX4 17 .globl _PI2C 18 .globl _PUSB 19 .globl _EIEX6 20 .globl _EIEX5 21 .globl _EIEX4 22 .globl _EI2C 23 .globl _EUSB 24 .globl _SMOD1 25 .globl _ERESI 26 .globl _RESI 27 .globl _INT6 28 .globl _CY 29 .globl _AC 30 .globl _F0 31 .globl _RS1 32 .globl _RS0 33 .globl _OV 34 .globl _FL 35 .globl _P 36 .globl _TF2 37 .globl _EXF2 38 .globl _RCLK 39 .globl _TCLK 40 .globl _EXEN2 41 .globl _TR2 42 .globl _C_T2 43 .globl _CP_RL2 44 .globl _SM01 45 .globl _SM11 46 .globl _SM21 47 .globl _REN1 48 .globl _TB81 49 .globl _RB81 50 .globl _TI1 51 .globl _RI1 52 .globl _PS1 53 .globl _PT2 54 .globl _PS0 55 .globl _PT1 56 .globl _PX1 57 .globl _PT0 58 .globl _PX0 59 .globl _EA 60 .globl _ES1 61 .globl _ET2 62 .globl _ES0 63 .globl _ET1 64 .globl _EX1 65 .globl _ET0 66 .globl _EX0 67 .globl _SM0 68 .globl _SM1 69 .globl _SM2 70 .globl _REN 71 .globl _TB8 72 .globl _RB8 73 .globl _TI 74 .globl _RI 75 .globl _TF1 76 .globl _TR1 77 .globl _TF0 78 .globl _TR0 79 .globl _IE1 80 .globl _IT1 81 .globl _IE0 82 .globl _IT0 83 .globl _SEL 84 .globl _EIP 85 .globl _B 86 .globl _EIE 87 .globl _ACC 88 .globl _EICON 89 .globl _PSW 90 .globl _TH2 91 .globl _TL2 92 .globl _RCAP2H 93 .globl _RCAP2L 94 .globl _T2CON 95 .globl _SBUF1 96 .globl _SCON1 97 .globl _IP 98 .globl _IE 99 .globl _SBUF0 100 .globl _SCON0 101 .globl _MPAGE 102 .globl _EXIF 103 .globl _SPC_FNC 104 .globl _CKCON 105 .globl _TH1 106 .globl _TH0 107 .globl _TL1 108 .globl _TL0 109 .globl _TMOD 110 .globl _TCON 111 .globl _PCON 112 .globl _DPS 113 .globl _DPH1 114 .globl _DPL1 115 .globl _DPH 116 .globl _DPL 117 .globl _SP 118 ;-------------------------------------------------------- 119 ; special function registers 120 ;-------------------------------------------------------- 121 .area RSEG (DATA) 0081 122 _SP = 0x0081 0082 123 _DPL = 0x0082 0083 124 _DPH = 0x0083 0084 125 _DPL1 = 0x0084 0085 126 _DPH1 = 0x0085 0086 127 _DPS = 0x0086 0087 128 _PCON = 0x0087 0088 129 _TCON = 0x0088 0089 130 _TMOD = 0x0089 008A 131 _TL0 = 0x008a 008B 132 _TL1 = 0x008b 008C 133 _TH0 = 0x008c 008D 134 _TH1 = 0x008d 008E 135 _CKCON = 0x008e 008F 136 _SPC_FNC = 0x008f 0091 137 _EXIF = 0x0091 0092 138 _MPAGE = 0x0092 0098 139 _SCON0 = 0x0098 0099 140 _SBUF0 = 0x0099 00A8 141 _IE = 0x00a8 00B8 142 _IP = 0x00b8 00C0 143 _SCON1 = 0x00c0 00C1 144 _SBUF1 = 0x00c1 00C8 145 _T2CON = 0x00c8 00CA 146 _RCAP2L = 0x00ca 00CB 147 _RCAP2H = 0x00cb 00CC 148 _TL2 = 0x00cc 00CD 149 _TH2 = 0x00cd 00D0 150 _PSW = 0x00d0 00D8 151 _EICON = 0x00d8 00E0 152 _ACC = 0x00e0 00E8 153 _EIE = 0x00e8 00F0 154 _B = 0x00f0 00F8 155 _EIP = 0x00f8 156 ;-------------------------------------------------------- 157 ; special function bits 158 ;-------------------------------------------------------- 159 .area RSEG (DATA) 0086 160 _SEL = 0x0086 0088 161 _IT0 = 0x0088 0089 162 _IE0 = 0x0089 008A 163 _IT1 = 0x008a 008B 164 _IE1 = 0x008b 008C 165 _TR0 = 0x008c 008D 166 _TF0 = 0x008d 008E 167 _TR1 = 0x008e 008F 168 _TF1 = 0x008f 0098 169 _RI = 0x0098 0099 170 _TI = 0x0099 009A 171 _RB8 = 0x009a 009B 172 _TB8 = 0x009b 009C 173 _REN = 0x009c 009D 174 _SM2 = 0x009d 009E 175 _SM1 = 0x009e 009F 176 _SM0 = 0x009f 00A8 177 _EX0 = 0x00a8 00A9 178 _ET0 = 0x00a9 00AA 179 _EX1 = 0x00aa 00AB 180 _ET1 = 0x00ab 00AC 181 _ES0 = 0x00ac 00AD 182 _ET2 = 0x00ad 00AE 183 _ES1 = 0x00ae 00AF 184 _EA = 0x00af 00B8 185 _PX0 = 0x00b8 00B9 186 _PT0 = 0x00b9 00BA 187 _PX1 = 0x00ba 00BB 188 _PT1 = 0x00bb 00BC 189 _PS0 = 0x00bc 00BD 190 _PT2 = 0x00bd 00BE 191 _PS1 = 0x00be 00C0 192 _RI1 = 0x00c0 00C1 193 _TI1 = 0x00c1 00C2 194 _RB81 = 0x00c2 00C3 195 _TB81 = 0x00c3 00C4 196 _REN1 = 0x00c4 00C5 197 _SM21 = 0x00c5 00C6 198 _SM11 = 0x00c6 00C7 199 _SM01 = 0x00c7 00C8 200 _CP_RL2 = 0x00c8 00C9 201 _C_T2 = 0x00c9 00CA 202 _TR2 = 0x00ca 00CB 203 _EXEN2 = 0x00cb 00CC 204 _TCLK = 0x00cc 00CD 205 _RCLK = 0x00cd 00CE 206 _EXF2 = 0x00ce 00CF 207 _TF2 = 0x00cf 00D0 208 _P = 0x00d0 00D1 209 _FL = 0x00d1 00D2 210 _OV = 0x00d2 00D3 211 _RS0 = 0x00d3 00D4 212 _RS1 = 0x00d4 00D5 213 _F0 = 0x00d5 00D6 214 _AC = 0x00d6 00D7 215 _CY = 0x00d7 00DB 216 _INT6 = 0x00db 00DC 217 _RESI = 0x00dc 00DD 218 _ERESI = 0x00dd 00DF 219 _SMOD1 = 0x00df 00E8 220 _EUSB = 0x00e8 00E9 221 _EI2C = 0x00e9 00EA 222 _EIEX4 = 0x00ea 00EB 223 _EIEX5 = 0x00eb 00EC 224 _EIEX6 = 0x00ec 00F8 225 _PUSB = 0x00f8 00F9 226 _PI2C = 0x00f9 00FA 227 _EIPX4 = 0x00fa 00FB 228 _EIPX5 = 0x00fb 00FC 229 _EIPX6 = 0x00fc 230 ;-------------------------------------------------------- 231 ; overlayable register banks 232 ;-------------------------------------------------------- 233 .area REG_BANK_0 (REL,OVR,DATA) 0000 234 .ds 8 235 ;-------------------------------------------------------- 236 ; internal ram data 237 ;-------------------------------------------------------- 238 .area DSEG (DATA) 239 ;-------------------------------------------------------- 240 ; overlayable items in internal ram 241 ;-------------------------------------------------------- 242 .area OSEG (OVR,DATA) 243 ;-------------------------------------------------------- 244 ; Stack segment in internal ram 245 ;-------------------------------------------------------- 246 .area SSEG (DATA) 000C 247 __start__stack: 000C 248 .ds 1 249 250 ;-------------------------------------------------------- 251 ; indirectly addressable internal ram data 252 ;-------------------------------------------------------- 253 .area ISEG (DATA) 254 ;-------------------------------------------------------- 255 ; bit data 256 ;-------------------------------------------------------- 257 .area BSEG (BIT) 258 ;-------------------------------------------------------- 259 ; paged external ram data 260 ;-------------------------------------------------------- 261 .area PSEG (PAG,XDATA) 262 ;-------------------------------------------------------- 263 ; external ram data 264 ;-------------------------------------------------------- 265 .area XSEG (XDATA) 266 ;-------------------------------------------------------- 267 ; external initialized ram data 268 ;-------------------------------------------------------- 269 .area XISEG (XDATA) 270 .area CSEG (CODE) 271 .area GSINIT0 (CODE) 272 .area GSINIT1 (CODE) 273 .area GSINIT2 (CODE) 274 .area GSINIT3 (CODE) 275 .area GSINIT4 (CODE) 276 .area GSINIT5 (CODE) 277 ;-------------------------------------------------------- 278 ; interrupt vector 279 ;-------------------------------------------------------- 280 .area CSEG (CODE) 0000 281 __interrupt_vect: 0000 02 01 1F 282 ljmp __sdcc_gsinit_startup 0003 32 283 reti 0004 284 .ds 7 000B 02 00 70 285 ljmp _timer0 286 ;-------------------------------------------------------- 287 ; global & static initialisations 288 ;-------------------------------------------------------- 289 .area CSEG (CODE) 290 .area GSINIT (CODE) 291 .area GSFINAL (CODE) 292 .area GSINIT (CODE) 293 .globl __sdcc_gsinit_startup 294 .globl __sdcc_program_startup 295 .globl __start__stack 296 .globl __mcs51_genXINIT 297 .globl __mcs51_genXRAMCLEAR 298 .globl __mcs51_genRAMCLEAR 299 .area GSFINAL (CODE) 017D 02 00 0E 300 ljmp __sdcc_program_startup 301 ;-------------------------------------------------------- 302 ; Home 303 ;-------------------------------------------------------- 304 .area HOME (CODE) 305 .area CSEG (CODE) 306 ;-------------------------------------------------------- 307 ; code 308 ;-------------------------------------------------------- 309 .area CSEG (CODE) 000E 310 __sdcc_program_startup: 000E 12 00 1F 311 lcall _main 312 ; return from main will lock up 0011 80 FE 313 sjmp . 314 ;------------------------------------------------------------ 315 ;Allocation info for local variables in function 'TD_Init' 316 ;------------------------------------------------------------ 317 ;------------------------------------------------------------ 318 ;test.c:28: void TD_Init(void) // Called once at startup 319 ; ----------------------------------------- 320 ; function TD_Init 321 ; ----------------------------------------- 0013 322 _TD_Init: 0002 323 ar2 = 0x02 0003 324 ar3 = 0x03 0004 325 ar4 = 0x04 0005 326 ar5 = 0x05 0006 327 ar6 = 0x06 0007 328 ar7 = 0x07 0000 329 ar0 = 0x00 0001 330 ar1 = 0x01 331 ;test.c:30: OEA = 0xFF; 332 ; genAssign 0013 90 7F 9C 333 mov dptr,#_OEA 0016 74 FF 334 mov a,#0xFF 0018 F0 335 movx @dptr,a 336 ;test.c:33: led_init(); 337 ; genCall 0019 12 00 CA 338 lcall _led_init 339 ;test.c:39: timer0_init(); 340 ; genCall 341 ; Peephole 253.b replaced lcall/ret with ljmp 001C 02 00 51 342 ljmp _timer0_init 343 ;------------------------------------------------------------ 344 ;Allocation info for local variables in function 'main' 345 ;------------------------------------------------------------ 346 ;i Allocated to registers r2 r3 347 ;------------------------------------------------------------ 348 ;test.c:44: void main(void) 349 ; ----------------------------------------- 350 ; function main 351 ; ----------------------------------------- 001F 352 _main: 353 ;test.c:49: TD_Init(); 354 ; genCall 001F 12 00 13 355 lcall _TD_Init 356 ;test.c:51: EA = 1; // Enable 8051 interrupts 357 ; genAssign 0022 D2 AF 358 setb _EA 359 ;test.c:54: for(i = 0; i < 20000; i++); 0024 360 00109$: 361 ; genAssign 0024 7A 20 362 mov r2,#0x20 0026 7B 4E 363 mov r3,#0x4E 0028 364 00106$: 365 ; genDjnz 366 ; genMinus 367 ; genMinusDec 0028 1A 368 dec r2 0029 BA FF 01 369 cjne r2,#0xff,00112$ 002C 1B 370 dec r3 002D 371 00112$: 372 ; genIfx 002D EA 373 mov a,r2 002E 4B 374 orl a,r3 375 ; genIfxJump 376 ; Peephole 109 removed ljmp by inverse jump logic 002F 70 F7 377 jnz 00106$ 0031 378 00113$: 379 ;test.c:55: led1_toggle(); 380 ; genCall 0031 12 01 0D 381 lcall _led1_toggle 382 ; Peephole 112.b changed ljmp to sjmp 0034 80 EE 383 sjmp 00109$ 0036 384 00107$: 0036 22 385 ret 386 .area CSEG (CODE) 387 .area XINIT (CODE)