Files
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

34 lines
768 B
NASM
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

; Figure 5-3
;
; Useful subroutines using the Write Console Byte
; BDOS Function.
;
; MSGOUT
; Output null-byte terminated message
;
; Calling sequence
;
; MESSAGE: DB 'Message',0
; :
; LXI H,MESSAGE
; CALL MSGOUT
;
; Exit Parameters
; HL -> Null byte terminator
;
B$CONOUT EQU 2 ;Write console byte
BDOS EQU 5 ;BDOS Entry Point
;
MSGOUT:
MOV A,M ;Get next byte for output
ORA A
RZ ;Return when null-byte
INX H ;Update message pointer
PUSH H ;Save updated pointer
MOV E,A ;Ready for BDOS
MVI C,B$CONOUT ;Function code
CALL BDOS
POP H ;Recover message pointer
JMP MSGOUT ;Go back for next character