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 _mdelay 12 .globl _udelay 13 ;-------------------------------------------------------- 14 ; special function registers 15 ;-------------------------------------------------------- 16 .area RSEG (ABS,DATA) 000000 17 .org 0x0000 18 ;-------------------------------------------------------- 19 ; special function bits 20 ;-------------------------------------------------------- 21 .area RSEG (ABS,DATA) 000000 22 .org 0x0000 23 ;-------------------------------------------------------- 24 ; overlayable register banks 25 ;-------------------------------------------------------- 26 .area REG_BANK_0 (REL,OVR,DATA) 000000 27 .ds 8 28 ;-------------------------------------------------------- 29 ; internal ram data 30 ;-------------------------------------------------------- 31 .area DSEG (DATA) 32 ;-------------------------------------------------------- 33 ; overlayable items in internal ram 34 ;-------------------------------------------------------- 35 ;-------------------------------------------------------- 36 ; indirectly addressable internal ram data 37 ;-------------------------------------------------------- 38 .area ISEG (DATA) 39 ;-------------------------------------------------------- 40 ; absolute internal ram data 41 ;-------------------------------------------------------- 42 .area IABS (ABS,DATA) 43 .area IABS (ABS,DATA) 44 ;-------------------------------------------------------- 45 ; bit data 46 ;-------------------------------------------------------- 47 .area BSEG (BIT) 48 ;-------------------------------------------------------- 49 ; paged external ram data 50 ;-------------------------------------------------------- 51 .area PSEG (PAG,XDATA) 52 ;-------------------------------------------------------- 53 ; external ram data 54 ;-------------------------------------------------------- 55 .area XSEG (XDATA) 56 ;-------------------------------------------------------- 57 ; absolute external ram data 58 ;-------------------------------------------------------- 59 .area XABS (ABS,XDATA) 60 ;-------------------------------------------------------- 61 ; external initialized ram data 62 ;-------------------------------------------------------- 63 .area HOME (CODE) 64 .area GSINIT0 (CODE) 65 .area GSINIT1 (CODE) 66 .area GSINIT2 (CODE) 67 .area GSINIT3 (CODE) 68 .area GSINIT4 (CODE) 69 .area GSINIT5 (CODE) 70 .area GSINIT (CODE) 71 .area GSFINAL (CODE) 72 .area CSEG (CODE) 73 ;-------------------------------------------------------- 74 ; global & static initialisations 75 ;-------------------------------------------------------- 76 .area HOME (CODE) 77 .area GSINIT (CODE) 78 .area GSFINAL (CODE) 79 .area GSINIT (CODE) 80 ;-------------------------------------------------------- 81 ; Home 82 ;-------------------------------------------------------- 83 .area HOME (CODE) 84 .area HOME (CODE) 85 ;-------------------------------------------------------- 86 ; code 87 ;-------------------------------------------------------- 88 .area CSEG (CODE) 89 ;------------------------------------------------------------ 90 ;Allocation info for local variables in function 'udelay1' 91 ;------------------------------------------------------------ 92 ; delay.c:27: udelay1 (void) __naked 93 ; ----------------------------------------- 94 ; function udelay1 95 ; ----------------------------------------- 000000 96 _udelay1: 97 ; naked function: no prologue. 98 ; delay.c:31: __endasm; 99 ; lcall that got us here took 4 bus cycles 000000 22 [24] 100 ret ; 4 bus cycles 101 ; delay.c:32: } 102 ; naked function: no epilogue. 103 ;------------------------------------------------------------ 104 ;Allocation info for local variables in function 'udelay' 105 ;------------------------------------------------------------ 106 ;usecs Allocated to registers 107 ;------------------------------------------------------------ 108 ; delay.c:38: udelay (unsigned char usecs) 109 ; ----------------------------------------- 110 ; function udelay 111 ; ----------------------------------------- 000001 112 _udelay: 000007 113 ar7 = 0x07 000006 114 ar6 = 0x06 000005 115 ar5 = 0x05 000004 116 ar4 = 0x04 000003 117 ar3 = 0x03 000002 118 ar2 = 0x02 000001 119 ar1 = 0x01 000000 120 ar0 = 0x00 000001 AF 82 [24] 121 mov r7,dpl 122 ; delay.c:40: do { 000003 123 00101$: 124 ; delay.c:41: udelay1 (); 000003 12r00r00 [24] 125 lcall _udelay1 126 ; delay.c:42: } while (--usecs != 0); 000006 DF FB [24] 127 djnz r7,00101$ 128 ; delay.c:43: } 000008 22 [24] 129 ret 130 ;------------------------------------------------------------ 131 ;Allocation info for local variables in function 'mdelay1' 132 ;------------------------------------------------------------ 133 ; delay.c:54: mdelay1 (void) __naked 134 ; ----------------------------------------- 135 ; function mdelay1 136 ; ----------------------------------------- 000009 137 _mdelay1: 138 ; naked function: no prologue. 139 ; delay.c:65: __endasm; 000009 90 FB 50 [24] 140 mov dptr,#(-1200 & 0xffff) 00000C 141 002$: 00000C A3 [24] 142 inc dptr ; 3 bus cycles 00000D E5 82 [12] 143 mov a, dpl ; 2 bus cycles 00000F 45 83 [12] 144 orl a, dph ; 2 bus cycles 000011 70 F9 [24] 145 jnz 002$ ; 3 bus cycles 000013 22 [24] 146 ret 147 ; delay.c:66: } 148 ; naked function: no epilogue. 149 ;------------------------------------------------------------ 150 ;Allocation info for local variables in function 'mdelay' 151 ;------------------------------------------------------------ 152 ;msecs Allocated to registers 153 ;------------------------------------------------------------ 154 ; delay.c:69: mdelay (unsigned int msecs) 155 ; ----------------------------------------- 156 ; function mdelay 157 ; ----------------------------------------- 000014 158 _mdelay: 000014 AE 82 [24] 159 mov r6,dpl 000016 AF 83 [24] 160 mov r7,dph 161 ; delay.c:71: do { 000018 162 00101$: 163 ; delay.c:72: mdelay1 (); 000018 12r00r09 [24] 164 lcall _mdelay1 165 ; delay.c:73: } while (--msecs != 0); 00001B 1E [12] 166 dec r6 00001C BE FF 01 [24] 167 cjne r6,#0xff,00111$ 00001F 1F [12] 168 dec r7 000020 169 00111$: 000020 EE [12] 170 mov a,r6 000021 4F [12] 171 orl a,r7 000022 70 F4 [24] 172 jnz 00101$ 173 ; delay.c:74: } 000024 22 [24] 174 ret 175 .area CSEG (CODE) 176 .area CONST (CODE) 177 .area CABS (ABS,CODE)