Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/math.asm @ 426:07f5b0baaa57
Adding temperature & ceiling curves
* Pink Temperature curve, using fixed scale minTp .. minTp+10.0?C.
* Vertical line fill for ceiling.
* Dark red coloring when overflowing ceiling, dark green if ok.
author | JeanDo |
---|---|
date | Sun, 31 Jul 2011 13:27:23 +0200 |
parents | cec312042b94 |
children | 7779bfa89171 |
comparison
equal
deleted
inserted
replaced
425:a76c5a3e9e96 | 426:07f5b0baaa57 |
---|---|
43 decfsz divB | 43 decfsz divB |
44 bra div16 | 44 bra div16 |
45 return | 45 return |
46 | 46 |
47 sub16: | 47 sub16: |
48 ; sub_c = sub_a - sub_b | 48 ; sub_c = sub_a - sub_b (with signed values) |
49 bcf neg_flag | 49 bcf neg_flag |
50 movf sub_b+0, W ; Get Value to be subtracted | 50 movf sub_b+0, W ; Get Value to be subtracted |
51 subwf sub_a+0, W ; Do the High Byte | 51 subwf sub_a+0, W ; Do the High Byte |
52 movwf sub_c+0 | 52 movwf sub_c+0 |
53 movf sub_b+1, W ; Get the Value to be Subbed | 53 movf sub_b+1, W ; Get the Value to be Subbed |
54 subwfb sub_a+1, W | 54 subwfb sub_a+1, W |
55 movwf sub_c+1 | 55 movwf sub_c+1 |
56 | 56 |
57 btfss STATUS,N ; Negativ result ? | 57 btfss STATUS,N ; Negativ result ? |
58 return ; NO: result positive done. | |
59 | |
60 bsf neg_flag ; MARK result negative | |
61 | |
62 comf sub_c+1 ; 16bit sign change. | |
63 negf sub_c+0 | |
64 btfsc STATUS,C ; Carry to propagate ? | |
65 incf sub_c+1,F ; YES: do it. | |
66 | |
67 return | |
68 | |
69 subU16: | |
70 ; sub_c = sub_a - sub_b (with UNSIGNED values) | |
71 bcf neg_flag | |
72 movf sub_b+0, W ; Get Value to be subtracted | |
73 subwf sub_a+0, W ; Do the High Byte | |
74 movwf sub_c+0 | |
75 movf sub_b+1, W ; Get the Value to be Subbed | |
76 subwfb sub_a+1, W | |
77 movwf sub_c+1 | |
78 | |
79 btfsc STATUS,C ; Borrow to propagate ? (B == /CARRY) | |
58 return ; NO: result positive done. | 80 return ; NO: result positive done. |
59 | 81 |
60 bsf neg_flag ; MARK result negative | 82 bsf neg_flag ; MARK result negative |
61 | 83 |
62 comf sub_c+1 ; 16bit sign change. | 84 comf sub_c+1 ; 16bit sign change. |