Count in octal: Difference between revisions

Content added Content deleted
(Added uBasic/4tH version)
Line 209: Line 209:
sphl ; restore it
sphl ; restore it
ret ; back to the ccp w/o warm booting
ret ; back to the ccp w/o warm booting
;------------------------------------------------------
; Console output routine
; print character in A register to console
;------------------------------------------------------
putchr: push h
push d
push b
mov e,a ; character to E for CP/M
mvi c,2 ; console output function
call bdos ; call on BDOS to perform
pop b
pop d
pop h
ret
;------------------------------------------------------
; output CRLF to console
;------------------------------------------------------
crlf: mvi a,cr
call putchr
mvi a,lf
call putchr
ret
;------------------------------------------------------
;------------------------------------------------------
; Octal output routine
; Octal output routine
Line 267: Line 245:
rar ; bit 0 of MSB has shifted in
rar ; bit 0 of MSB has shifted in
mov l,a
mov l,a
ret
;------------------------------------------------------
; output CRLF to console
;------------------------------------------------------
crlf: mvi a,cr
call putchr
mvi a,lf
call putchr
ret
;------------------------------------------------------
; Console output routine
; print character in A register to console
;------------------------------------------------------
putchr: push h
push d
push b
mov e,a ; character to E for CP/M
mvi c,2 ; console output function
call bdos ; call on BDOS to perform
pop b
pop d
pop h
ret
ret
;-------------------------------------------------------
;-------------------------------------------------------
Line 290: Line 290:
1777777
1777777
</pre>
</pre>



=={{header|AArch64 Assembly}}==
=={{header|AArch64 Assembly}}==