1 ;-------------------------------------------------------- 2 ; File Created by SDCC : free open source ANSI-C Compiler 3 ; Version 4.2.0 #13081 (Linux) 4 ;-------------------------------------------------------- 5 .module delay 6 .optsdcc -mmcs51 --model-small 7 8 ;-------------------------------------------------------- 9 ; Public variables in this module 10 ;-------------------------------------------------------- 11 .globl _EADC 12 .globl _ET1 13 .globl _ET0 14 .globl _ES 15 .globl _EA 16 .globl _REN 17 .globl _RI 18 .globl _TI 19 .globl _TR1 20 .globl _TF1 21 .globl _IT0 22 .globl _IE0 23 .globl _TR0 24 .globl _TF0 25 .globl _CMPCR2 26 .globl _CMPCR1 27 .globl _TA 28 .globl _IRCBAND_REG 29 .globl _IAP_TPS 30 .globl _IAP_CONTR 31 .globl _IAP_TRIG 32 .globl _IAP_CMD 33 .globl _IAP_ADDRL 34 .globl _IAP_ADDRH 35 .globl _IAP_DATA 36 .globl _WDT_CONTR 37 .globl _PCA_PWM3 38 .globl _PCA_PWM2 39 .globl _PCA_PWM1 40 .globl _PCA_PWM0 41 .globl _CCAP3L 42 .globl _CCAP2L 43 .globl _CCAP1L 44 .globl _CCAP0L 45 .globl _CCAPM3 46 .globl _CCAPM2 47 .globl _CCAPM1 48 .globl _CCAPM0 49 .globl _CMOD 50 .globl _CCON 51 .globl _ADCTIM_X 52 .globl _ADCCFG 53 .globl _ADC_RESL 54 .globl _ADC_RES 55 .globl _ADC_CONTR 56 .globl _SPDAT 57 .globl _SPCTL 58 .globl _SPSTAT 59 .globl _IP2H 60 .globl _IP2 61 .globl _IP 62 .globl _IE2 63 .globl _IE 64 .globl _BRT 65 .globl _P_SW1 66 .globl _SADEN 67 .globl _SADDR 68 .globl _S2BUF 69 .globl _S2CON 70 .globl _SBUF 71 .globl _SCON 72 .globl _TM4PS_X 73 .globl _TM3PS_X 74 .globl _TM2PS_X 75 .globl _T4T3M 76 .globl _T4L 77 .globl _T4H 78 .globl _T3L 79 .globl _T3H 80 .globl _T2L 81 .globl _T2H 82 .globl _INTCLKO 83 .globl _AUXR 84 .globl _TH1 85 .globl _TH0 86 .globl _TL1 87 .globl _TL0 88 .globl _TMOD 89 .globl _TCON 90 .globl _P_SW2 91 .globl _P5M0 92 .globl _P5M1 93 .globl _P4M0 94 .globl _P4M1 95 .globl _P3M0 96 .globl _P3M1 97 .globl _P2M0 98 .globl _P2M1 99 .globl _P1M0 100 .globl _P1M1 101 .globl _P0M0 102 .globl _P0M1 103 .globl _PSW 104 .globl _B 105 .globl _ACC 106 .globl _PCON 107 .globl _DPH 108 .globl _DPL 109 .globl _SP 110 .globl _P5 111 .globl _P4 112 .globl _P3 113 .globl _P2 114 .globl _P1 115 .globl _P0 116 .globl _delay_us 117 .globl _delay_ms 118 ;-------------------------------------------------------- 119 ; special function registers 120 ;-------------------------------------------------------- 121 .area RSEG (ABS,DATA) 000000 122 .org 0x0000 000080 123 _P0 = 0x0080 000090 124 _P1 = 0x0090 0000A0 125 _P2 = 0x00a0 0000B0 126 _P3 = 0x00b0 0000C0 127 _P4 = 0x00c0 0000C8 128 _P5 = 0x00c8 000081 129 _SP = 0x0081 000082 130 _DPL = 0x0082 000083 131 _DPH = 0x0083 000087 132 _PCON = 0x0087 0000E0 133 _ACC = 0x00e0 0000F0 134 _B = 0x00f0 0000D0 135 _PSW = 0x00d0 000093 136 _P0M1 = 0x0093 000094 137 _P0M0 = 0x0094 000091 138 _P1M1 = 0x0091 000092 139 _P1M0 = 0x0092 000095 140 _P2M1 = 0x0095 000096 141 _P2M0 = 0x0096 0000B1 142 _P3M1 = 0x00b1 0000B2 143 _P3M0 = 0x00b2 0000B3 144 _P4M1 = 0x00b3 0000B4 145 _P4M0 = 0x00b4 0000C9 146 _P5M1 = 0x00c9 0000CA 147 _P5M0 = 0x00ca 0000BA 148 _P_SW2 = 0x00ba 000088 149 _TCON = 0x0088 000089 150 _TMOD = 0x0089 00008A 151 _TL0 = 0x008a 00008B 152 _TL1 = 0x008b 00008C 153 _TH0 = 0x008c 00008D 154 _TH1 = 0x008d 00008E 155 _AUXR = 0x008e 00008F 156 _INTCLKO = 0x008f 0000D6 157 _T2H = 0x00d6 0000D7 158 _T2L = 0x00d7 0000D4 159 _T3H = 0x00d4 0000D5 160 _T3L = 0x00d5 0000D2 161 _T4H = 0x00d2 0000D3 162 _T4L = 0x00d3 0000D1 163 _T4T3M = 0x00d1 00FEA1 164 _TM2PS_X = 0xfea1 00FEA2 165 _TM3PS_X = 0xfea2 00FEA3 166 _TM4PS_X = 0xfea3 000098 167 _SCON = 0x0098 000099 168 _SBUF = 0x0099 00009A 169 _S2CON = 0x009a 00009B 170 _S2BUF = 0x009b 0000A9 171 _SADDR = 0x00a9 0000B9 172 _SADEN = 0x00b9 0000A2 173 _P_SW1 = 0x00a2 00009C 174 _BRT = 0x009c 0000A8 175 _IE = 0x00a8 0000AF 176 _IE2 = 0x00af 0000B8 177 _IP = 0x00b8 0000B6 178 _IP2 = 0x00b6 0000B7 179 _IP2H = 0x00b7 0000CD 180 _SPSTAT = 0x00cd 0000CE 181 _SPCTL = 0x00ce 0000CF 182 _SPDAT = 0x00cf 0000BC 183 _ADC_CONTR = 0x00bc 0000BD 184 _ADC_RES = 0x00bd 0000BE 185 _ADC_RESL = 0x00be 0000DE 186 _ADCCFG = 0x00de 00FEA8 187 _ADCTIM_X = 0xfea8 0000D8 188 _CCON = 0x00d8 0000D9 189 _CMOD = 0x00d9 0000DA 190 _CCAPM0 = 0x00da 0000DB 191 _CCAPM1 = 0x00db 0000DC 192 _CCAPM2 = 0x00dc 0000DD 193 _CCAPM3 = 0x00dd 0000EA 194 _CCAP0L = 0x00ea 0000EB 195 _CCAP1L = 0x00eb 0000EC 196 _CCAP2L = 0x00ec 0000ED 197 _CCAP3L = 0x00ed 0000F2 198 _PCA_PWM0 = 0x00f2 0000F3 199 _PCA_PWM1 = 0x00f3 0000F4 200 _PCA_PWM2 = 0x00f4 0000F5 201 _PCA_PWM3 = 0x00f5 0000C1 202 _WDT_CONTR = 0x00c1 0000C2 203 _IAP_DATA = 0x00c2 0000C3 204 _IAP_ADDRH = 0x00c3 0000C4 205 _IAP_ADDRL = 0x00c4 0000C5 206 _IAP_CMD = 0x00c5 0000C6 207 _IAP_TRIG = 0x00c6 0000C7 208 _IAP_CONTR = 0x00c7 0000F7 209 _IAP_TPS = 0x00f7 00009D 210 _IRCBAND_REG = 0x009d 0000AE 211 _TA = 0x00ae 0000E6 212 _CMPCR1 = 0x00e6 0000E7 213 _CMPCR2 = 0x00e7 214 ;-------------------------------------------------------- 215 ; special function bits 216 ;-------------------------------------------------------- 217 .area RSEG (ABS,DATA) 000000 218 .org 0x0000 00008D 219 _TF0 = 0x008d 00008C 220 _TR0 = 0x008c 000089 221 _IE0 = 0x0089 000088 222 _IT0 = 0x0088 00008F 223 _TF1 = 0x008f 00008E 224 _TR1 = 0x008e 000099 225 _TI = 0x0099 000098 226 _RI = 0x0098 00009C 227 _REN = 0x009c 0000AF 228 _EA = 0x00af 0000AC 229 _ES = 0x00ac 0000A9 230 _ET0 = 0x00a9 0000AB 231 _ET1 = 0x00ab 0000AD 232 _EADC = 0x00ad 233 ;-------------------------------------------------------- 234 ; overlayable register banks 235 ;-------------------------------------------------------- 236 .area REG_BANK_0 (REL,OVR,DATA) 000000 237 .ds 8 238 ;-------------------------------------------------------- 239 ; internal ram data 240 ;-------------------------------------------------------- 241 .area DSEG (DATA) 242 ;-------------------------------------------------------- 243 ; overlayable items in internal ram 244 ;-------------------------------------------------------- 245 .area OSEG (OVR,DATA) 246 .area OSEG (OVR,DATA) 247 ;-------------------------------------------------------- 248 ; indirectly addressable internal ram data 249 ;-------------------------------------------------------- 250 .area ISEG (DATA) 251 ;-------------------------------------------------------- 252 ; absolute internal ram data 253 ;-------------------------------------------------------- 254 .area IABS (ABS,DATA) 255 .area IABS (ABS,DATA) 256 ;-------------------------------------------------------- 257 ; bit data 258 ;-------------------------------------------------------- 259 .area BSEG (BIT) 260 ;-------------------------------------------------------- 261 ; paged external ram data 262 ;-------------------------------------------------------- 263 .area PSEG (PAG,XDATA) 264 ;-------------------------------------------------------- 265 ; external ram data 266 ;-------------------------------------------------------- 267 .area XSEG (XDATA) 268 ;-------------------------------------------------------- 269 ; absolute external ram data 270 ;-------------------------------------------------------- 271 .area XABS (ABS,XDATA) 272 ;-------------------------------------------------------- 273 ; external initialized ram data 274 ;-------------------------------------------------------- 275 .area XISEG (XDATA) 276 .area HOME (CODE) 277 .area GSINIT0 (CODE) 278 .area GSINIT1 (CODE) 279 .area GSINIT2 (CODE) 280 .area GSINIT3 (CODE) 281 .area GSINIT4 (CODE) 282 .area GSINIT5 (CODE) 283 .area GSINIT (CODE) 284 .area GSFINAL (CODE) 285 .area CSEG (CODE) 286 ;-------------------------------------------------------- 287 ; global & static initialisations 288 ;-------------------------------------------------------- 289 .area HOME (CODE) 290 .area GSINIT (CODE) 291 .area GSFINAL (CODE) 292 .area GSINIT (CODE) 293 ;-------------------------------------------------------- 294 ; Home 295 ;-------------------------------------------------------- 296 .area HOME (CODE) 297 .area HOME (CODE) 298 ;-------------------------------------------------------- 299 ; code 300 ;-------------------------------------------------------- 301 .area CSEG (CODE) 302 ;------------------------------------------------------------ 303 ;Allocation info for local variables in function '_delay_loop' 304 ;------------------------------------------------------------ 305 ;n Allocated to registers 306 ;------------------------------------------------------------ 307 ; src/delay.c:9: static void _delay_loop(uint16_t n) 308 ; ----------------------------------------- 309 ; function _delay_loop 310 ; ----------------------------------------- 000000 311 __delay_loop: 000007 312 ar7 = 0x07 000006 313 ar6 = 0x06 000005 314 ar5 = 0x05 000004 315 ar4 = 0x04 000003 316 ar3 = 0x03 000002 317 ar2 = 0x02 000001 318 ar1 = 0x01 000000 319 ar0 = 0x00 000000 AE 82 [24] 320 mov r6,dpl 000002 AF 83 [24] 321 mov r7,dph 322 ; src/delay.c:11: while (n--) { 000004 323 00101$: 000004 8E 04 [24] 324 mov ar4,r6 000006 8F 05 [24] 325 mov ar5,r7 000008 1E [12] 326 dec r6 000009 BE FF 01 [24] 327 cjne r6,#0xff,00115$ 00000C 1F [12] 328 dec r7 00000D 329 00115$: 00000D EC [12] 330 mov a,r4 00000E 4D [12] 331 orl a,r5 00000F 60 07 [24] 332 jz 00104$ 333 ; src/delay.c:12: NOP(); NOP(); NOP(); NOP(); NOP(); 000011 00 [12] 334 nop 000012 00 [12] 335 nop 000013 00 [12] 336 nop 000014 00 [12] 337 nop 000015 00 [12] 338 nop 000016 80 EC [24] 339 sjmp 00101$ 000018 340 00104$: 341 ; src/delay.c:14: } 000018 22 [24] 342 ret 343 ;------------------------------------------------------------ 344 ;Allocation info for local variables in function 'delay_us' 345 ;------------------------------------------------------------ 346 ;us Allocated to registers 347 ;------------------------------------------------------------ 348 ; src/delay.c:16: void delay_us(uint16_t us) 349 ; ----------------------------------------- 350 ; function delay_us 351 ; ----------------------------------------- 000019 352 _delay_us: 000019 AE 82 [24] 353 mov r6,dpl 00001B AF 83 [24] 354 mov r7,dph 355 ; src/delay.c:19: while (us--) { 00001D 356 00101$: 00001D 8E 04 [24] 357 mov ar4,r6 00001F 8F 05 [24] 358 mov ar5,r7 000021 1E [12] 359 dec r6 000022 BE FF 01 [24] 360 cjne r6,#0xff,00115$ 000025 1F [12] 361 dec r7 000026 362 00115$: 000026 EC [12] 363 mov a,r4 000027 4D [12] 364 orl a,r5 000028 60 1A [24] 365 jz 00104$ 366 ; src/delay.c:20: NOP(); NOP(); NOP(); NOP(); NOP(); NOP(); 00002A 00 [12] 367 nop 00002B 00 [12] 368 nop 00002C 00 [12] 369 nop 00002D 00 [12] 370 nop 00002E 00 [12] 371 nop 00002F 00 [12] 372 nop 373 ; src/delay.c:21: NOP(); NOP(); NOP(); NOP(); NOP(); NOP(); 000030 00 [12] 374 nop 000031 00 [12] 375 nop 000032 00 [12] 376 nop 000033 00 [12] 377 nop 000034 00 [12] 378 nop 000035 00 [12] 379 nop 380 ; src/delay.c:22: NOP(); NOP(); NOP(); NOP(); NOP(); NOP(); 000036 00 [12] 381 nop 000037 00 [12] 382 nop 000038 00 [12] 383 nop 000039 00 [12] 384 nop 00003A 00 [12] 385 nop 00003B 00 [12] 386 nop 387 ; src/delay.c:23: NOP(); NOP(); NOP(); NOP(); NOP(); NOP(); 00003C 00 [12] 388 nop 00003D 00 [12] 389 nop 00003E 00 [12] 390 nop 00003F 00 [12] 391 nop 000040 00 [12] 392 nop 000041 00 [12] 393 nop 000042 80 D9 [24] 394 sjmp 00101$ 000044 395 00104$: 396 ; src/delay.c:25: } 000044 22 [24] 397 ret 398 ;------------------------------------------------------------ 399 ;Allocation info for local variables in function 'delay_ms' 400 ;------------------------------------------------------------ 401 ;ms Allocated to registers 402 ;------------------------------------------------------------ 403 ; src/delay.c:27: void delay_ms(uint16_t ms) 404 ; ----------------------------------------- 405 ; function delay_ms 406 ; ----------------------------------------- 000045 407 _delay_ms: 000045 AE 82 [24] 408 mov r6,dpl 000047 AF 83 [24] 409 mov r7,dph 410 ; src/delay.c:29: while (ms--) { 000049 411 00101$: 000049 8E 04 [24] 412 mov ar4,r6 00004B 8F 05 [24] 413 mov ar5,r7 00004D 1E [12] 414 dec r6 00004E BE FF 01 [24] 415 cjne r6,#0xff,00115$ 000051 1F [12] 416 dec r7 000052 417 00115$: 000052 EC [12] 418 mov a,r4 000053 4D [12] 419 orl a,r5 000054 60 10 [24] 420 jz 00104$ 421 ; src/delay.c:30: delay_us(1000); 000056 90 03 E8 [24] 422 mov dptr,#0x03e8 000059 C0 07 [24] 423 push ar7 00005B C0 06 [24] 424 push ar6 00005D 12r00r19 [24] 425 lcall _delay_us 000060 D0 06 [24] 426 pop ar6 000062 D0 07 [24] 427 pop ar7 000064 80 E3 [24] 428 sjmp 00101$ 000066 429 00104$: 430 ; src/delay.c:32: } 000066 22 [24] 431 ret 432 .area CSEG (CODE) 433 .area CONST (CODE) 000000 434 _DEFAULT_ADDR: 000000 E7 435 .db #0xe7 ; 231 000001 E7 436 .db #0xe7 ; 231 000002 E7 437 .db #0xe7 ; 231 000003 E7 438 .db #0xe7 ; 231 000004 C2 439 .db #0xc2 ; 194 440 .area XINIT (CODE) 441 .area CABS (ABS,CODE)