I'd like temp control. I started studying the AL9 Fan control code but it's over my head at this point. I am pasting it here for reference. If one of you can help decipher this that would be great. I believe the B2_RE9=0 and BE2_RE9=1 lines are where the output is controlled. I don't understand how that relates to pin 41 or how that would translate to A1C. The orb and an2b opcodes are a mystery as well. Am I even close?
Code: Select all
Sub_648c:
648c: 9b,f6,74,00 cmpb R0,[Rf6+74]
6490: d7,01 jne 6493 if ([941c] = 0) {
6492: f0 ret return; }
6493: 37,a1,02 jnb B7,Ra1,6498 if (B7_Ra1 = 1) {
6496: 20,c1 sjmp 6559 goto 6559; }
6498: 71,df,e9 an2b Re9,df B5_Re9 = 0;
649b: 9b,f6,77,b0 cmpb Rb0,[Rf6+77]
649f: d6,24 jge 64c5 if (Rb0 < [941f]) {
64a1: 9b,f6,76,b0 cmpb Rb0,[Rf6+76]
64a5: de,21 jlt 64c8 if (Rb0 < [941e]) goto 64c8;
64a7: b3,74,21,42 ldb R42,[R74+21] R42 = [29f];
64ab: 9b,f6,78,42 cmpb R42,[Rf6+78]
64af: d3,17 jnc 64c8 if (R42 < [9420]) goto 64c8;
64b1: a3,74,de,42 ldw R42,[R74+de] R42 = [25c];
64b5: 8b,f6,7a,42 cmpw R42,[Rf6+7a]
64b9: d3,0d jnc 64c8 if (R42 < [9422]) goto 64c8;
64bb: b3,74,3f,42 ldb R42,[R74+3f] R42 = [2bd];
64bf: 9b,f6,79,42 cmpb R42,[Rf6+79]
64c3: d9,03 jgtu 64c8 if (R42 > [9421]) goto 64c8; }
64c5: 91,20,e9 orb Re9,20 B5_Re9 = 1; } } } }
64c8: 35,e9,0d jnb B5,Re9,64d8 if (B5_Re9 = 1) {
64cb: b3,f6,71,40 ldb R40,[Rf6+71] R40 = [9419];
64cf: 9b,72,ce,40 cmpb R40,[R72+ce]
64d3: d9,03 jgtu 64d8 if (R40 <= [14e]) {
64d5: 91,08,e9 orb Re9,8 B3_Re9 = 1; } }
64d8: b3,f6,76,42 ldb R42,[Rf6+76] R42 = [941e];
64dc: 7b,f6,6d,42 sb2b R42,[Rf6+6d] R42 -= [9415];
64e0: 98,b0,42 cmpb R42,Rb0
64e3: da,03 jle 64e8 if (R42 > Rb0) {
64e5: 71,f7,e9 an2b Re9,f7 B3_Re9 = 0; }
64e8: 9b,f6,6c,b0 cmpb Rb0,[Rf6+6c]
64ec: da,03 jle 64f1 if (Rb0 > [9414]) {
64ee: 91,04,e9 orb Re9,4 B2_Re9 = 1; }
64f1: b3,f6,6c,42 ldb R42,[Rf6+6c] R42 = [9414];
64f5: 7b,f6,6e,42 sb2b R42,[Rf6+6e] R42 -= [9416];
64f9: 98,b0,42 cmpb R42,Rb0
64fc: da,03 jle 6501 if (R42 > Rb0) {
64fe: 71,fb,e9 an2b Re9,fb B2_Re9 = 0; }
6501: 33,e9,09 jnb B3,Re9,650d if (B3_Re9 = 1) {
6504: b3,f6,75,40 ldb R40,[Rf6+75] R40 = [941d];
6508: 99,01,40 cmpb R40,1
650b: df,44 je 6551 if (R40 = 1) goto 6551; }
650d: b3,f6,6f,42 ldb R42,[Rf6+6f] R42 = [9417];
6511: 7b,f6,70,42 sb2b R42,[Rf6+70] R42 -= [9418];
6515: 9b,74,3f,42 cmpb R42,[R74+3f]
6519: d1,05 jleu 6520 if (R42 > [2bd]) {
651b: 33,ea,02 jnb B3,Rea,6520 if (B3_Rea = 1) {
651e: 20,06 sjmp 6526 goto 6526; } }
6520: 3a,e9,03 jb B2,Re9,6526 if (B2_Re9 = 0) {
6523: 37,c5,04 jnb B7,Rc5,652a if (B7_Rc5 = 0) goto 652a; }
6526: 91,40,47 orb R47,40 B6_R47 = 1;
6529: f0 ret return; }
652a: 3b,ea,0c jb B3,Rea,6539 if (B3_Rea = 0) {
652d: a3,f6,72,40 ldw R40,[Rf6+72] R40 = [941a];
6531: 8b,74,98,40 cmpw R40,[R74+98]
6535: d9,02 jgtu 6539 if (R40 <= [216]) {
6537: 20,14 sjmp 654d goto 654d; } }
6539: b3,f6,55,40 ldb R40,[Rf6+55] R40 = [93fd];
653d: 9b,74,97,40 cmpb R40,[R74+97]
6541: d9,0a jgtu 654d if (R40 <= [215]) {
6543: b3,f6,6f,40 ldb R40,[Rf6+6f] R40 = [9417];
6547: 9b,74,3f,40 cmpb R40,[R74+3f]
654b: db,02 jc 654f if (R40 >= [2bd]) goto 654f; }
654d: 20,10 sjmp 655f goto 655f; }
654f: 20,07 sjmp 6558 return; }
6551: 71,df,47 an2b R47,df B5_R47 = 0;
6554: 91,40,47 orb R47,40 B6_R47 = 1;
6557: f0 ret return;