mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-27 02:14:19 +00:00
Upload
Digital Research
This commit is contained in:
37
CONTRIBUTIONS/cpm-handbook/cpmsrc/FIG5-4.ASM
Normal file
37
CONTRIBUTIONS/cpm-handbook/cpmsrc/FIG5-4.ASM
Normal file
@@ -0,0 +1,37 @@
|
||||
; 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user