Code: Select all
15bee: 03,ec,03 struct 3, iADC_Ch3.1
15bf1: 00,c6,01 struct 0, iADC_Ch0
15bf4: 01,ca,01 struct 1, iADC_Ch1
15bf7: 02,a8,01 struct 2, iADC_Ch2
15bfa: 05,d4,01 struct 5, iADC_Ch5
15bfd: 06,ce,01 struct 6, iADC_Ch6
15c00: 03,ee,03 struct 3, iADC_Ch3.2
15c03: 07,a6,01 struct 7, iADC_Ch7
15c06: 08,a0,01 struct 8, iADC_Ch8
15c09: 09,a2,01 struct 9, iADC_Ch9
15c0c: 0c,d2,01 struct c, iADC_ChC
15c0f: 03,f0,03 struct 3, iADC_Ch3.3
15c12: 0a,6c,04 struct a, iADC_ChA
15c15: 0d,8c,04 struct d, iADC_ChD
15c18: 0e,8e,04 struct e, iADC_ChE
15c1b: 0f,a4,01 struct f, iADC_ChF
15c1e: 03,f2,03 struct 3, iADC_Ch3.4
15c21: ff ## terminator
Code: Select all
#################################################################
# Save A to D values. Definitons in Structure at 15BEE
#################################################################
# Vect from L1646A
Sbg_82E46_AD_Read:
82e46: a1,ee,5b,34 ldw R34,5bee R34 = 5bee; # A/D Lookup Structure at 15BEE
# JNE from L82E5C Channel requested does not match channel returned
# SJump from L82E70 Do next Channel listed in Structure 15BEE
82e4a: fb ei interrupts ON;
82e4b: 56,34,00,04 ad3b R4,R0,[R34] AD_Cmd = [R34]; # get and set, AD channel required
82e4f: de,21 jlt 82e72 if (AD_Cmd >= 0) { # SIGNED comparison
# Cont for Channels x0 through xF (x7F is positive max)
# JNB Loop from L82E51 until AD_Converted=1
82e51: 33,0a,fd jnb B3,Ra,82e51 if (AD_Converted = 0) goto 82e51; # wait for AD conversion
82e54: fa di interrupts OFF;
82e55: 51,0f,04,38 an3b R38,R4,f R38 = AD_Low & f; # get channel returned
82e59: 9a,34,38 cmpb R38,[R34] # check correct channel
82e5c: d7,ec jne 82e4a if (R38 != [R34]) goto 82e4a; # No, try read again
# Cont Channel requested matched Channel returned
82e5e: 51,f0,04,38 an3b R38,R4,f0 R38 = AD_Low & f0; # AD Low value
82e62: b0,05,39 ldb R39,R5 R39 = AD_Hi^; # AD High value
82e65: 07,34 incw R34 R34++; # incr ptr to iADC address
82e67: b2,35,36 ldb R36,[R34++] R36 = [R34++]; # get iADC address, lo then hi
82e6a: b2,35,37 ldb R37,[R34++] R37 = [R34++];
82e6d: c2,36,38 stw R38,[R36] [R36] = R38; # save AD value to iADC address
82e70: 27,d8 sjmp 82e4a goto 82e4a; } # Do next AD
# JLT from L82E4F negative (x80 to xFF) is less than 0
82e72: 07,34 incw R34 R34++; # [15C22] Struct terminator +1
82e74: ad,02,46 ldzbw R46,2 wR46 = 2; # Why not 1???
82e77: 08,01,46 shrw R46,1 R46 >>= 1; #[ R46 /= 2] # R46=1
# JNE from L82EB2
# SJump from L82EBF
82e7a: 56,34,00,38 ad3b R38,R0,[R34] R38 = [R34]; # x02
82e7e: de,41 jlt 82ec1 if (R38 >= 0) { # Terminator
82e80: c4,39,38 stb R38,R39 R39 = R38; # x02
82e83: 93,47,ce,5b,38 orb R38,[R46+5bce] R38 |= [R46+15bce]; # [15BCF] x42 |= x2 x40
82e88: 28,38 scall 82ec2 Sub82EC2_yLSSO_A=yR38 (); # Write LSSI#A
82e8a: b1,03,42 ldb R42,3 R42 = 3;
# DJNZ Loop from L82E8D
82e8d: e0,42,fd djnz R42,82e8d R42--;
if (R42 != 0) goto 82e8d; # Wait
# JE from L82E9D
82e90: b0,15,36 ldb R36,R15 R36 = LSSI#A; # Read LSSI#A
82e93: 73,47,d0,5b,36 an2b R36,[R46+5bd0] R36 &= [R46+15bd0]; # [15BD1] LSSI#A&=xE0 B4..B0 cleared
82e98: 9b,47,d2,5b,36 cmpb R36,[R46+5bd2] # [15BD3] x40
82e9d: df,f1 je 82e90 if (R36 = [R46+15bd2]) goto 82e90; # B6_LSSI#A Set 1
82e9f: fa di interrupts OFF;
82ea0: b0,19,3b ldb R3b,R19 R3b = LSSI#C;
82ea3: b0,17,3a ldb R3a,R17 R3a = LSSI#B;
82ea6: b0,15,36 ldb R36,R15 R36 = LSSI#A;
82ea9: fb ei interrupts ON;
82eaa: 93,47,d4,5b,39 orb R39,[R46+5bd4] R39 |= [R46+15bd4]; # [15BD5] xC1 |= 1 xC0
82eaf: 98,39,36 cmpb R36,R39
82eb2: d7,c6 jne 82e7a if (R36 != R39) goto 82e7a; # LSSI#A != xC1
82eb4: 07,34 incw R34 R34++; # [15C23]
82eb6: b2,35,36 ldb R36,[R34++] R36 = [R34++]; # Lo Value
82eb9: b2,35,37 ldb R37,[R34++] R37 = [R34++]; # Hi Value
82ebc: c2,36,3a stw R3a,[R36] [R36] = R3a; # Save AD Value to iAICE address
82ebf: 27,b9 sjmp 82e7a goto 82e7a; }
# JLT from L82E7E
82ec1: f0 ret return;