Files
Digital-Research-Source-Code/CONTRIBUTIONS/cpm-handbook/cpmsrc/FIG5-4.ASM
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

37 lines
896 B
NASM
Raw 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-4
;
; Useful subroutines using the Write Console Byte
; BDOS Function.
;
; MSGOUTI (Message Out In-line)
; Output null-byte terminated message that follows the
; CALL to MSGOUTI.
;
; Calling sequence
;
; CALL MSGOUTI
; DB 'Message',0
; ... next instruction
;
; Exit Parameters
; HL -> instruction following message
;
B$CONOUT EQU 2 ;Write console byte
BDOS EQU 5 ;BDOS Entry Point
;
MSGOUTI:
POP H ;HL -> Message
MOV A,M ;Get next data byte
INX H ;Update message pointer
ORA A ;Check if null byte
JNZ MSGOUTIC ;No, continue
PCHL ;Yes, return to next instruction
;after in-line message
MSGOUTIC:
PUSH H ;Save message pointer
MOV E,A ;Ready for BDOS
MVI C,B$CONOUT ;Function code
CALL BDOS
JMP MSGOUTI ;Go back for next char.