comparison src/convert.asm @ 300:5ad479f2a868

Merged Screen layout mod #1 into Screen layout work #3
author Janos Kovacs <kovjanos@gmail.com>
date Sun, 31 May 2015 21:24:16 +0200
parents 653a3ab08062
children a5fc007634c5
comparison
equal deleted inserted replaced
299:6c4800af27ac 300:5ad479f2a868
26 #define all_zeros_flag cvt_flags2,1 26 #define all_zeros_flag cvt_flags2,1
27 #define DP_done cvt_flags2,2 27 #define DP_done cvt_flags2,2
28 #define DP_done2 cvt_flags2,3 28 #define DP_done2 cvt_flags2,3
29 #define show_last3 cvt_flags2,4 29 #define show_last3 cvt_flags2,4
30 #define leading_zeros cvt_flags2,5 30 #define leading_zeros cvt_flags2,5
31 #define show_last4 cvt_flags2,6
31 32
32 basic CODE 33 basic CODE
33 34
34 ;============================================================================= 35 ;=============================================================================
35 global output99_call 36 global output99_call
90 movlw b'01100100' ; 100 91 movlw b'01100100' ; 100
91 movwf temp2 92 movwf temp2
92 clrf temp3 93 clrf temp3
93 rcall DEC2ASCII 94 rcall DEC2ASCII
94 bra LCD_val99_2 95 bra LCD_val99_2
96
97 global output16_4_call
98 output16_4_call: ; limit to 9999
99 bsf show_last4
100 ; 9999 = 27 0F = [39][15]
101 movlw .40
102 cpfslt hi ; hi < 40 ?
103 bra output16_4_call_2 ; No, hi >= 40, do limit
104 ; Yes, hi <= 39
105 movlw .39
106 cpfseq hi ; hi = 39 ?
107 bra output16_4_call_3 ; No, hi < 39, no limit needed
108 ; Yes, hi = 39
109 movlw .15
110 cpfslt lo ; lo < 15
111 movwf lo ; No, lo >= 15, set lo = 15.
112 ; Yes, lo <= 14 or lo set to =15
113 bra output16_4_call_3 ; done.
114 output16_4_call_2: ; Set to 9999
115 movlw LOW .9999
116 movwf lo
117 movlw HIGH .9999
118 movwf hi
119 output16_4_call_3:
120 bra output16_call
95 121
96 global output16_3_call 122 global output16_3_call
97 global output16_call 123 global output16_call
98 global output16 124 global output16
99 output16_3_call: ; limit to 999 125 output16_3_call: ; limit to 999
138 164
139 movlw b'00010000' ; 10000s 165 movlw b'00010000' ; 10000s
140 movwf temp2 166 movwf temp2
141 movlw b'00100111' 167 movlw b'00100111'
142 movwf temp3 168 movwf temp3
143 btfss show_last3 ; display only last three figures? 169 btfsc show_last3 ; display only last three figures?
170 bra output16_sk5
171 btfsc show_last4 ; display only last four figures?
172 bra output16_sk5
144 rcall DEC2ASCII ; No, show all. Here: 5th order digit 173 rcall DEC2ASCII ; No, show all. Here: 5th order digit
145 174
175 output16_sk5:
176 bcf show_last4
146 movlw b'11101000' ; 1000s 177 movlw b'11101000' ; 1000s
147 movwf temp2 178 movwf temp2
148 movlw b'00000011' 179 movlw b'00000011'
149 movwf temp3 180 movwf temp3
150 btfsc DP_done2 ; Is there a decimal point at all? 181 btfsc DP_done2 ; Is there a decimal point at all?