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:47 2005 5 ;-------------------------------------------------------- 6 .module led 7 .optsdcc -mmcs51 --model-small 8 9 ;-------------------------------------------------------- 10 ; Public variables in this module 11 ;-------------------------------------------------------- 12 .globl _led1_toggle 13 .globl _led1_off 14 .globl _led1_on 15 .globl _led0_toggle 16 .globl _led0_off 17 .globl _led0_on 18 .globl _led_init 19 .globl _EIPX6 20 .globl _EIPX5 21 .globl _EIPX4 22 .globl _PI2C 23 .globl _PUSB 24 .globl _EIEX6 25 .globl _EIEX5 26 .globl _EIEX4 27 .globl _EI2C 28 .globl _EUSB 29 .globl _SMOD1 30 .globl _ERESI 31 .globl _RESI 32 .globl _INT6 33 .globl _CY 34 .globl _AC 35 .globl _F0 36 .globl _RS1 37 .globl _RS0 38 .globl _OV 39 .globl _FL 40 .globl _P 41 .globl _TF2 42 .globl _EXF2 43 .globl _RCLK 44 .globl _TCLK 45 .globl _EXEN2 46 .globl _TR2 47 .globl _C_T2 48 .globl _CP_RL2 49 .globl _SM01 50 .globl _SM11 51 .globl _SM21 52 .globl _REN1 53 .globl _TB81 54 .globl _RB81 55 .globl _TI1 56 .globl _RI1 57 .globl _PS1 58 .globl _PT2 59 .globl _PS0 60 .globl _PT1 61 .globl _PX1 62 .globl _PT0 63 .globl _PX0 64 .globl _EA 65 .globl _ES1 66 .globl _ET2 67 .globl _ES0 68 .globl _ET1 69 .globl _EX1 70 .globl _ET0 71 .globl _EX0 72 .globl _SM0 73 .globl _SM1 74 .globl _SM2 75 .globl _REN 76 .globl _TB8 77 .globl _RB8 78 .globl _TI 79 .globl _RI 80 .globl _TF1 81 .globl _TR1 82 .globl _TF0 83 .globl _TR0 84 .globl _IE1 85 .globl _IT1 86 .globl _IE0 87 .globl _IT0 88 .globl _SEL 89 .globl _EIP 90 .globl _B 91 .globl _EIE 92 .globl _ACC 93 .globl _EICON 94 .globl _PSW 95 .globl _TH2 96 .globl _TL2 97 .globl _RCAP2H 98 .globl _RCAP2L 99 .globl _T2CON 100 .globl _SBUF1 101 .globl _SCON1 102 .globl _IP 103 .globl _IE 104 .globl _SBUF0 105 .globl _SCON0 106 .globl _MPAGE 107 .globl _EXIF 108 .globl _SPC_FNC 109 .globl _CKCON 110 .globl _TH1 111 .globl _TH0 112 .globl _TL1 113 .globl _TL0 114 .globl _TMOD 115 .globl _TCON 116 .globl _PCON 117 .globl _DPS 118 .globl _DPH1 119 .globl _DPL1 120 .globl _DPH 121 .globl _DPL 122 .globl _SP 123 ;-------------------------------------------------------- 124 ; special function registers 125 ;-------------------------------------------------------- 126 .area RSEG (DATA) 0081 127 _SP = 0x0081 0082 128 _DPL = 0x0082 0083 129 _DPH = 0x0083 0084 130 _DPL1 = 0x0084 0085 131 _DPH1 = 0x0085 0086 132 _DPS = 0x0086 0087 133 _PCON = 0x0087 0088 134 _TCON = 0x0088 0089 135 _TMOD = 0x0089 008A 136 _TL0 = 0x008a 008B 137 _TL1 = 0x008b 008C 138 _TH0 = 0x008c 008D 139 _TH1 = 0x008d 008E 140 _CKCON = 0x008e 008F 141 _SPC_FNC = 0x008f 0091 142 _EXIF = 0x0091 0092 143 _MPAGE = 0x0092 0098 144 _SCON0 = 0x0098 0099 145 _SBUF0 = 0x0099 00A8 146 _IE = 0x00a8 00B8 147 _IP = 0x00b8 00C0 148 _SCON1 = 0x00c0 00C1 149 _SBUF1 = 0x00c1 00C8 150 _T2CON = 0x00c8 00CA 151 _RCAP2L = 0x00ca 00CB 152 _RCAP2H = 0x00cb 00CC 153 _TL2 = 0x00cc 00CD 154 _TH2 = 0x00cd 00D0 155 _PSW = 0x00d0 00D8 156 _EICON = 0x00d8 00E0 157 _ACC = 0x00e0 00E8 158 _EIE = 0x00e8 00F0 159 _B = 0x00f0 00F8 160 _EIP = 0x00f8 161 ;-------------------------------------------------------- 162 ; special function bits 163 ;-------------------------------------------------------- 164 .area RSEG (DATA) 0086 165 _SEL = 0x0086 0088 166 _IT0 = 0x0088 0089 167 _IE0 = 0x0089 008A 168 _IT1 = 0x008a 008B 169 _IE1 = 0x008b 008C 170 _TR0 = 0x008c 008D 171 _TF0 = 0x008d 008E 172 _TR1 = 0x008e 008F 173 _TF1 = 0x008f 0098 174 _RI = 0x0098 0099 175 _TI = 0x0099 009A 176 _RB8 = 0x009a 009B 177 _TB8 = 0x009b 009C 178 _REN = 0x009c 009D 179 _SM2 = 0x009d 009E 180 _SM1 = 0x009e 009F 181 _SM0 = 0x009f 00A8 182 _EX0 = 0x00a8 00A9 183 _ET0 = 0x00a9 00AA 184 _EX1 = 0x00aa 00AB 185 _ET1 = 0x00ab 00AC 186 _ES0 = 0x00ac 00AD 187 _ET2 = 0x00ad 00AE 188 _ES1 = 0x00ae 00AF 189 _EA = 0x00af 00B8 190 _PX0 = 0x00b8 00B9 191 _PT0 = 0x00b9 00BA 192 _PX1 = 0x00ba 00BB 193 _PT1 = 0x00bb 00BC 194 _PS0 = 0x00bc 00BD 195 _PT2 = 0x00bd 00BE 196 _PS1 = 0x00be 00C0 197 _RI1 = 0x00c0 00C1 198 _TI1 = 0x00c1 00C2 199 _RB81 = 0x00c2 00C3 200 _TB81 = 0x00c3 00C4 201 _REN1 = 0x00c4 00C5 202 _SM21 = 0x00c5 00C6 203 _SM11 = 0x00c6 00C7 204 _SM01 = 0x00c7 00C8 205 _CP_RL2 = 0x00c8 00C9 206 _C_T2 = 0x00c9 00CA 207 _TR2 = 0x00ca 00CB 208 _EXEN2 = 0x00cb 00CC 209 _TCLK = 0x00cc 00CD 210 _RCLK = 0x00cd 00CE 211 _EXF2 = 0x00ce 00CF 212 _TF2 = 0x00cf 00D0 213 _P = 0x00d0 00D1 214 _FL = 0x00d1 00D2 215 _OV = 0x00d2 00D3 216 _RS0 = 0x00d3 00D4 217 _RS1 = 0x00d4 00D5 218 _F0 = 0x00d5 00D6 219 _AC = 0x00d6 00D7 220 _CY = 0x00d7 00DB 221 _INT6 = 0x00db 00DC 222 _RESI = 0x00dc 00DD 223 _ERESI = 0x00dd 00DF 224 _SMOD1 = 0x00df 00E8 225 _EUSB = 0x00e8 00E9 226 _EI2C = 0x00e9 00EA 227 _EIEX4 = 0x00ea 00EB 228 _EIEX5 = 0x00eb 00EC 229 _EIEX6 = 0x00ec 00F8 230 _PUSB = 0x00f8 00F9 231 _PI2C = 0x00f9 00FA 232 _EIPX4 = 0x00fa 00FB 233 _EIPX5 = 0x00fb 00FC 234 _EIPX6 = 0x00fc 235 ;-------------------------------------------------------- 236 ; overlayable register banks 237 ;-------------------------------------------------------- 238 .area REG_BANK_0 (REL,OVR,DATA) 0000 239 .ds 8 240 ;-------------------------------------------------------- 241 ; internal ram data 242 ;-------------------------------------------------------- 243 .area DSEG (DATA) 244 ;-------------------------------------------------------- 245 ; overlayable items in internal ram 246 ;-------------------------------------------------------- 247 .area OSEG (OVR,DATA) 248 ;-------------------------------------------------------- 249 ; indirectly addressable internal ram data 250 ;-------------------------------------------------------- 251 .area ISEG (DATA) 252 ;-------------------------------------------------------- 253 ; bit data 254 ;-------------------------------------------------------- 255 .area BSEG (BIT) 256 ;-------------------------------------------------------- 257 ; paged external ram data 258 ;-------------------------------------------------------- 259 .area PSEG (PAG,XDATA) 260 ;-------------------------------------------------------- 261 ; external ram data 262 ;-------------------------------------------------------- 263 .area XSEG (XDATA) 264 ;-------------------------------------------------------- 265 ; external initialized ram data 266 ;-------------------------------------------------------- 267 .area XISEG (XDATA) 268 .area CSEG (CODE) 269 .area GSINIT0 (CODE) 270 .area GSINIT1 (CODE) 271 .area GSINIT2 (CODE) 272 .area GSINIT3 (CODE) 273 .area GSINIT4 (CODE) 274 .area GSINIT5 (CODE) 275 ;-------------------------------------------------------- 276 ; global & static initialisations 277 ;-------------------------------------------------------- 278 .area CSEG (CODE) 279 .area GSINIT (CODE) 280 .area GSFINAL (CODE) 281 .area GSINIT (CODE) 282 ;-------------------------------------------------------- 283 ; Home 284 ;-------------------------------------------------------- 285 .area HOME (CODE) 286 .area CSEG (CODE) 287 ;-------------------------------------------------------- 288 ; code 289 ;-------------------------------------------------------- 290 .area CSEG (CODE) 291 ;------------------------------------------------------------ 292 ;Allocation info for local variables in function 'led_init' 293 ;------------------------------------------------------------ 294 ;------------------------------------------------------------ 295 ;led.c:10: void led_init(void) 296 ; ----------------------------------------- 297 ; function led_init 298 ; ----------------------------------------- 00CA 299 _led_init: 0002 300 ar2 = 0x02 0003 301 ar3 = 0x03 0004 302 ar4 = 0x04 0005 303 ar5 = 0x05 0006 304 ar6 = 0x06 0007 305 ar7 = 0x07 0000 306 ar0 = 0x00 0001 307 ar1 = 0x01 308 ;led.c:12: PORTACFG &= 0xCF; 309 ; genAssign 310 ; genAnd 311 ; Peephole 248.b optimized and to xdata 00CA 90 7F 93 312 mov dptr,#_PORTACFG 00CD E0 313 movx a,@dptr 00CE FA 314 mov r2,a 00CF 54 CF 315 anl a,#0xCF 00D1 F0 316 movx @dptr,a 317 ;led.c:13: OEA |= 0x30; 318 ; genAssign 319 ; genOr 320 ; Peephole 248.a optimized or to xdata 00D2 90 7F 9C 321 mov dptr,#_OEA 00D5 E0 322 movx a,@dptr 00D6 FA 323 mov r2,a 00D7 44 30 324 orl a,#0x30 00D9 F0 325 movx @dptr,a 00DA 326 00101$: 00DA 22 327 ret 328 ;------------------------------------------------------------ 329 ;Allocation info for local variables in function 'led0_on' 330 ;------------------------------------------------------------ 331 ;------------------------------------------------------------ 332 ;led.c:16: void led0_on(void) 333 ; ----------------------------------------- 334 ; function led0_on 335 ; ----------------------------------------- 00DB 336 _led0_on: 337 ;led.c:18: OUTA |= 0x10; 338 ; genAssign 339 ; genOr 340 ; Peephole 248.a optimized or to xdata 00DB 90 7F 96 341 mov dptr,#_OUTA 00DE E0 342 movx a,@dptr 00DF FA 343 mov r2,a 00E0 44 10 344 orl a,#0x10 00E2 F0 345 movx @dptr,a 00E3 346 00101$: 00E3 22 347 ret 348 ;------------------------------------------------------------ 349 ;Allocation info for local variables in function 'led0_off' 350 ;------------------------------------------------------------ 351 ;------------------------------------------------------------ 352 ;led.c:21: void led0_off(void) 353 ; ----------------------------------------- 354 ; function led0_off 355 ; ----------------------------------------- 00E4 356 _led0_off: 357 ;led.c:23: OUTA &= ~0x10; 358 ; genAssign 359 ; genAnd 360 ; Peephole 248.b optimized and to xdata 00E4 90 7F 96 361 mov dptr,#_OUTA 00E7 E0 362 movx a,@dptr 00E8 FA 363 mov r2,a 00E9 54 EF 364 anl a,#0xEF 00EB F0 365 movx @dptr,a 00EC 366 00101$: 00EC 22 367 ret 368 ;------------------------------------------------------------ 369 ;Allocation info for local variables in function 'led0_toggle' 370 ;------------------------------------------------------------ 371 ;------------------------------------------------------------ 372 ;led.c:26: void led0_toggle(void) 373 ; ----------------------------------------- 374 ; function led0_toggle 375 ; ----------------------------------------- 00ED 376 _led0_toggle: 377 ;led.c:28: (OUTA & 0x10) ? led0_off() : led0_on(); 378 ; genAssign 00ED 90 7F 96 379 mov dptr,#_OUTA 00F0 E0 380 movx a,@dptr 381 ; genAnd 382 ; Peephole 105 removed redundant mov 00F1 FA 383 mov r2,a 384 ; genIfxJump 385 ; Peephole 111 removed ljmp by inverse jump logic 00F2 30 E4 03 386 jnb acc.4,00103$ 00F5 387 00106$: 388 ; genCall 389 ; Peephole 112.b changed ljmp to sjmp 390 ; Peephole 251.b replaced sjmp to ret with ret 391 ; Peephole 253.a replaced lcall/ret with ljmp 00F5 02 00 E4 392 ljmp _led0_off 00F8 393 00103$: 394 ; genCall 395 ; Peephole 253.b replaced lcall/ret with ljmp 00F8 02 00 DB 396 ljmp _led0_on 397 ;------------------------------------------------------------ 398 ;Allocation info for local variables in function 'led1_on' 399 ;------------------------------------------------------------ 400 ;------------------------------------------------------------ 401 ;led.c:31: void led1_on(void) 402 ; ----------------------------------------- 403 ; function led1_on 404 ; ----------------------------------------- 00FB 405 _led1_on: 406 ;led.c:33: OUTA |= 0x20; 407 ; genAssign 408 ; genOr 409 ; Peephole 248.a optimized or to xdata 00FB 90 7F 96 410 mov dptr,#_OUTA 00FE E0 411 movx a,@dptr 00FF FA 412 mov r2,a 0100 44 20 413 orl a,#0x20 0102 F0 414 movx @dptr,a 0103 415 00101$: 0103 22 416 ret 417 ;------------------------------------------------------------ 418 ;Allocation info for local variables in function 'led1_off' 419 ;------------------------------------------------------------ 420 ;------------------------------------------------------------ 421 ;led.c:36: void led1_off(void) 422 ; ----------------------------------------- 423 ; function led1_off 424 ; ----------------------------------------- 0104 425 _led1_off: 426 ;led.c:38: OUTA &= ~0x20; 427 ; genAssign 428 ; genAnd 429 ; Peephole 248.b optimized and to xdata 0104 90 7F 96 430 mov dptr,#_OUTA 0107 E0 431 movx a,@dptr 0108 FA 432 mov r2,a 0109 54 DF 433 anl a,#0xDF 010B F0 434 movx @dptr,a 010C 435 00101$: 010C 22 436 ret 437 ;------------------------------------------------------------ 438 ;Allocation info for local variables in function 'led1_toggle' 439 ;------------------------------------------------------------ 440 ;------------------------------------------------------------ 441 ;led.c:41: void led1_toggle(void) 442 ; ----------------------------------------- 443 ; function led1_toggle 444 ; ----------------------------------------- 010D 445 _led1_toggle: 446 ;led.c:43: (OUTA & 0x20) ? led1_off() : led1_on(); 447 ; genAssign 010D 90 7F 96 448 mov dptr,#_OUTA 0110 E0 449 movx a,@dptr 450 ; genAnd 451 ; Peephole 105 removed redundant mov 0111 FA 452 mov r2,a 453 ; genIfxJump 454 ; Peephole 111 removed ljmp by inverse jump logic 0112 30 E5 03 455 jnb acc.5,00103$ 0115 456 00106$: 457 ; genCall 458 ; Peephole 112.b changed ljmp to sjmp 459 ; Peephole 251.b replaced sjmp to ret with ret 460 ; Peephole 253.a replaced lcall/ret with ljmp 0115 02 01 04 461 ljmp _led1_off 0118 462 00103$: 463 ; genCall 464 ; Peephole 253.b replaced lcall/ret with ljmp 0118 02 00 FB 465 ljmp _led1_on 466 .area CSEG (CODE) 467 .area XINIT (CODE)