Changeset 92
- Timestamp:
- Apr 8, 2017, 12:26:28 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/auxio.asm
r57 r92 154 154 ; Print char to com-port (teletype style) 155 155 AuxIO_Teletype Proc Near Uses ax dx 156 157 158 ;~ pusha159 ;~ xor dx,dx160 ;~ mov ah,03h161 ;~ mov al,00h162 ;~ int 14h163 ;~ mov ah,al164 ;~ shr al,4165 ;~ and al,0fh166 ;~ add al,'0'167 ;~ cmp al,'9'168 ;~ jbe @F169 ;~ add al,7170 ;~ @@: push ax171 ;~ xor dx,dx172 ;~ mov ah,01h173 ;~ int 14h174 ;~ pop ax175 ;~ mov al,ah176 ;~ and al,0fh177 ;~ add al,'0'178 ;~ cmp al,'9'179 ;~ jbe @F180 ;~ add al,7181 ;~ @@: xor dx,dx182 ;~ mov ah,01h183 ;~ int 14h184 ;~ popa185 186 ;~ pusha187 ;~ @@:188 ;~ xor dx,dx189 ;~ mov ah,03h190 ;~ mov al,00h191 ;~ int 14h192 ;~ and al,20h193 ;~ cmp al,20h194 ;~ jnz @B195 ;~ popa196 197 198 156 mov dx,[BIOS_AuxParms] ; get port and parameters 199 157 xor dh,dh ; we don't need the parameters … … 217 175 218 176 177 ; Print byte as decimal to com-port (teletype style) 178 AuxIO_TeletypeDecByte Proc Near Uses ax dx 179 call CONV_BinToPBCD ; Convert to PBCD 180 mov dx, ax ; Save PBCD value 181 shr ah, 4 ; Move digit count to low nibble 182 cmp ah, 3 ; Less than 3 digits ? 183 jb @F ; Yep, skip digit with index 2 184 mov al, dh ; Get byte with digit 185 and al, 0fh ; Mask it out 186 add al, '0' ; To ASCII 187 call AuxIO_Teletype 188 @@: 189 shr dh, 4 ; Move digit count to low nibble 190 cmp dh, 2 ; Less that 2 digits ? 191 jb @F ; Yep, skip digit with index 1 192 mov al, dl ; Get byte with digit 193 shr al, 4 ; Move to lower nibble 194 add al, '0' ; To ASCII 195 call AuxIO_Teletype 196 @@: 197 mov al, dl ; Get byte with digit 198 and al, 0fh ; Mask it out 199 add al, '0' ; To ASCII 200 call AuxIO_Teletype 201 ret 202 AuxIO_TeletypeDecByte EndP 203 204 219 205 ; Print Bin-byte to com-port (teletype style) 220 206 ; This outputs 8 characters ('0' or '1' for each bit)
Note:
See TracChangeset
for help on using the changeset viewer.