1 ;-------------------------------------------------------- 2 ; File Created by SDCC : free open source ANSI-C Compiler 3 ; Version 3.0.0 #6037 (Oct 31 2010) (Linux) 4 ; This file was generated Sun Feb 26 03:56:10 2012 5 ;-------------------------------------------------------- 6 .module millivolts 7 .optsdcc -mmcs51 --model-medium 8 9 ;-------------------------------------------------------- 10 ; Public variables in this module 11 ;-------------------------------------------------------- 12 .globl _adcReadVddMillivolts 13 .globl _adcSetMillivoltCalibration 14 .globl _adcConvertToMillivolts 15 ;-------------------------------------------------------- 16 ; special function registers 17 ;-------------------------------------------------------- 18 .area RSEG (ABS,DATA) 0000 19 .org 0x0000 20 ;-------------------------------------------------------- 21 ; special function bits 22 ;-------------------------------------------------------- 23 .area RSEG (ABS,DATA) 0000 24 .org 0x0000 25 ;-------------------------------------------------------- 26 ; overlayable register banks 27 ;-------------------------------------------------------- 28 .area REG_BANK_0 (REL,OVR,DATA) 0000 29 .ds 8 30 ;-------------------------------------------------------- 31 ; internal ram data 32 ;-------------------------------------------------------- 33 .area DSEG (DATA) 34 ;-------------------------------------------------------- 35 ; overlayable items in internal ram 36 ;-------------------------------------------------------- 37 .area OSEG (OVR,DATA) 38 ;-------------------------------------------------------- 39 ; indirectly addressable internal ram data 40 ;-------------------------------------------------------- 41 .area ISEG (DATA) 42 ;-------------------------------------------------------- 43 ; absolute internal ram data 44 ;-------------------------------------------------------- 45 .area IABS (ABS,DATA) 46 .area IABS (ABS,DATA) 47 ;-------------------------------------------------------- 48 ; bit data 49 ;-------------------------------------------------------- 50 .area BSEG (BIT) 51 ;-------------------------------------------------------- 52 ; paged external ram data 53 ;-------------------------------------------------------- 54 .area PSEG (PAG,XDATA) 0000 55 Fmillivolts$millivoltCalibration$0$0==. 0000 56 _millivoltCalibration: 0000 57 .ds 2 58 ;-------------------------------------------------------- 59 ; external ram data 60 ;-------------------------------------------------------- 61 .area XSEG (XDATA) 62 ;-------------------------------------------------------- 63 ; absolute external ram data 64 ;-------------------------------------------------------- 65 .area XABS (ABS,XDATA) 66 ;-------------------------------------------------------- 67 ; external initialized ram data 68 ;-------------------------------------------------------- 69 .area XISEG (XDATA) 70 .area HOME (CODE) 71 .area GSINIT0 (CODE) 72 .area GSINIT1 (CODE) 73 .area GSINIT2 (CODE) 74 .area GSINIT3 (CODE) 75 .area GSINIT4 (CODE) 76 .area GSINIT5 (CODE) 77 .area GSINIT (CODE) 78 .area GSFINAL (CODE) 79 .area CSEG (CODE) 80 ;-------------------------------------------------------- 81 ; global & static initialisations 82 ;-------------------------------------------------------- 83 .area HOME (CODE) 84 .area GSINIT (CODE) 85 .area GSFINAL (CODE) 86 .area GSINIT (CODE) 0000 87 G$adcConvertToMillivolts$0$0 ==. 0000 88 C$millivolts.c$4$1$1 ==. 89 ; libraries/src/adc/millivolts.c:4: static uint16 millivoltCalibration = 3300; 0000 78r00 90 mov r0,#_millivoltCalibration 0002 74 E4 91 mov a,#0xE4 0004 F2 92 movx @r0,a 0005 08 93 inc r0 0006 74 0C 94 mov a,#0x0C 0008 F2 95 movx @r0,a 96 ;-------------------------------------------------------- 97 ; Home 98 ;-------------------------------------------------------- 99 .area HOME (CODE) 100 .area HOME (CODE) 101 ;-------------------------------------------------------- 102 ; code 103 ;-------------------------------------------------------- 104 .area CSEG (CODE) 105 ;------------------------------------------------------------ 106 ;Allocation info for local variables in function 'adcReadVddMillivolts' 107 ;------------------------------------------------------------ 108 ;------------------------------------------------------------ 0000 109 G$adcReadVddMillivolts$0$0 ==. 0000 110 C$millivolts.c$6$0$0 ==. 111 ; libraries/src/adc/millivolts.c:6: uint16 adcReadVddMillivolts() 112 ; ----------------------------------------- 113 ; function adcReadVddMillivolts 114 ; ----------------------------------------- 0000 115 _adcReadVddMillivolts: 0002 116 ar2 = 0x02 0003 117 ar3 = 0x03 0004 118 ar4 = 0x04 0005 119 ar5 = 0x05 0006 120 ar6 = 0x06 0007 121 ar7 = 0x07 0000 122 ar0 = 0x00 0001 123 ar1 = 0x01 0000 124 C$millivolts.c$9$1$1 ==. 125 ; libraries/src/adc/millivolts.c:9: return ((uint32)adcRead(15|ADC_REFERENCE_INTERNAL)*3750 + 1023) / 2047; 0000 75 82 8F 126 mov dpl,#0x8F 0003 12s00r00 127 lcall _adcRead 0006 AA 82 128 mov r2,dpl 0008 AB 83 129 mov r3,dph 000A 78r00 130 mov r0,#__mullong_PARM_2 000C EA 131 mov a,r2 000D F2 132 movx @r0,a 000E 08 133 inc r0 000F EB 134 mov a,r3 0010 F2 135 movx @r0,a 0011 08 136 inc r0 0012 E4 137 clr a 0013 F2 138 movx @r0,a 0014 08 139 inc r0 0015 F2 140 movx @r0,a 0016 90 0E A6 141 mov dptr,#0x0EA6 0019 E4 142 clr a 001A F5 F0 143 mov b,a 001C 12s00r00 144 lcall __mullong 001F AA 82 145 mov r2,dpl 0021 AB 83 146 mov r3,dph 0023 AC F0 147 mov r4,b 0025 FD 148 mov r5,a 0026 74 FF 149 mov a,#0xFF 0028 2A 150 add a,r2 0029 FA 151 mov r2,a 002A 74 03 152 mov a,#0x03 002C 3B 153 addc a,r3 002D FB 154 mov r3,a 002E E4 155 clr a 002F 3C 156 addc a,r4 0030 FC 157 mov r4,a 0031 E4 158 clr a 0032 3D 159 addc a,r5 0033 FD 160 mov r5,a 0034 78r00 161 mov r0,#__divulong_PARM_2 0036 74 FF 162 mov a,#0xFF 0038 F2 163 movx @r0,a 0039 08 164 inc r0 003A 74 07 165 mov a,#0x07 003C F2 166 movx @r0,a 003D 08 167 inc r0 003E E4 168 clr a 003F F2 169 movx @r0,a 0040 08 170 inc r0 0041 F2 171 movx @r0,a 0042 8A 82 172 mov dpl,r2 0044 8B 83 173 mov dph,r3 0046 8C F0 174 mov b,r4 0048 ED 175 mov a,r5 0049 176 C$millivolts.c$10$1$1 ==. 0049 177 XG$adcReadVddMillivolts$0$0 ==. 0049 02s00r00 178 ljmp __divulong 179 ;------------------------------------------------------------ 180 ;Allocation info for local variables in function 'adcSetMillivoltCalibration' 181 ;------------------------------------------------------------ 182 ;------------------------------------------------------------ 004C 183 G$adcSetMillivoltCalibration$0$0 ==. 004C 184 C$millivolts.c$12$1$1 ==. 185 ; libraries/src/adc/millivolts.c:12: void adcSetMillivoltCalibration(uint16 vddMillivolts) 186 ; ----------------------------------------- 187 ; function adcSetMillivoltCalibration 188 ; ----------------------------------------- 004C 189 _adcSetMillivoltCalibration: 004C AA 82 190 mov r2,dpl 004E AB 83 191 mov r3,dph 0050 192 C$millivolts.c$14$1$1 ==. 193 ; libraries/src/adc/millivolts.c:14: millivoltCalibration = vddMillivolts; 0050 78r00 194 mov r0,#_millivoltCalibration 0052 EA 195 mov a,r2 0053 F2 196 movx @r0,a 0054 08 197 inc r0 0055 EB 198 mov a,r3 0056 F2 199 movx @r0,a 0057 200 C$millivolts.c$15$1$1 ==. 0057 201 XG$adcSetMillivoltCalibration$0$0 ==. 0057 22 202 ret 203 ;------------------------------------------------------------ 204 ;Allocation info for local variables in function 'adcConvertToMillivolts' 205 ;------------------------------------------------------------ 206 ;------------------------------------------------------------ 0058 207 G$adcConvertToMillivolts$0$0 ==. 0058 208 C$millivolts.c$17$1$1 ==. 209 ; libraries/src/adc/millivolts.c:17: int16 adcConvertToMillivolts(int16 adcResult) 210 ; ----------------------------------------- 211 ; function adcConvertToMillivolts 212 ; ----------------------------------------- 0058 213 _adcConvertToMillivolts: 0058 AA 82 214 mov r2,dpl 005A 215 C$millivolts.c$19$1$1 ==. 216 ; libraries/src/adc/millivolts.c:19: return ((int32)adcResult * millivoltCalibration + 1023) / 2047; 005A E5 83 217 mov a,dph 005C FB 218 mov r3,a 005D 33 219 rlc a 005E 95 E0 220 subb a,acc 0060 FC 221 mov r4,a 0061 FD 222 mov r5,a 0062 78r00 223 mov r0,#_millivoltCalibration 0064 79r00 224 mov r1,#__mullong_PARM_2 0066 E2 225 movx a,@r0 0067 F3 226 movx @r1,a 0068 08 227 inc r0 0069 E2 228 movx a,@r0 006A 09 229 inc r1 006B F3 230 movx @r1,a 006C 09 231 inc r1 006D E4 232 clr a 006E F3 233 movx @r1,a 006F 09 234 inc r1 0070 F3 235 movx @r1,a 0071 8A 82 236 mov dpl,r2 0073 8B 83 237 mov dph,r3 0075 8C F0 238 mov b,r4 0077 ED 239 mov a,r5 0078 12s00r00 240 lcall __mullong 007B AA 82 241 mov r2,dpl 007D AB 83 242 mov r3,dph 007F AC F0 243 mov r4,b 0081 FD 244 mov r5,a 0082 74 FF 245 mov a,#0xFF 0084 2A 246 add a,r2 0085 FA 247 mov r2,a 0086 74 03 248 mov a,#0x03 0088 3B 249 addc a,r3 0089 FB 250 mov r3,a 008A E4 251 clr a 008B 3C 252 addc a,r4 008C FC 253 mov r4,a 008D E4 254 clr a 008E 3D 255 addc a,r5 008F FD 256 mov r5,a 0090 78r00 257 mov r0,#__divslong_PARM_2 0092 74 FF 258 mov a,#0xFF 0094 F2 259 movx @r0,a 0095 08 260 inc r0 0096 74 07 261 mov a,#0x07 0098 F2 262 movx @r0,a 0099 08 263 inc r0 009A E4 264 clr a 009B F2 265 movx @r0,a 009C 08 266 inc r0 009D F2 267 movx @r0,a 009E 8A 82 268 mov dpl,r2 00A0 8B 83 269 mov dph,r3 00A2 8C F0 270 mov b,r4 00A4 ED 271 mov a,r5 00A5 272 C$millivolts.c$20$1$1 ==. 00A5 273 XG$adcConvertToMillivolts$0$0 ==. 00A5 02s00r00 274 ljmp __divslong 275 .area CSEG (CODE) 276 .area CONST (CODE) 277 .area XINIT (CODE) 278 .area CABS (ABS,CODE)