; ; VCF South East 3.0 - Introduction TO Z-80 Programming ; ; EXAMPLE 2 - Write a string to CP/M console ; ; This source code file can be assembled directly under Windows with ; George Phillips' "ZMAC" Z-80 assembler, using the command: ; ; zmac vcfex2.z80 ; ; This file can also be assembled under CP/M 2.2 with the SLR Z80 assembler ; using the following command: ; ; Z80ASM VCFEX2/F ; ; Malcolm Macleod - 1 May 2015 ; MTLIST ORG 0100H ; CP/M 2.2 TPA area starts here BEGIN LD HL,MSG1 ; Point HL at the start of our message DISPMSG LD A,(HL) ; Get the byte pointed to by HL OR A ; Update the Z flag (will be set if A=0) RET Z ; Return to CP/M if end of message reached LD E,A ; Otherwise, copy the byte into E LD C,2 ; Prepare to use BDOS Service 2 PUSH HL ; Save HL before the BDOS trashes it CALL 5H ; Go to BDOS to execute Service 2 POP HL ; Recover HL from the stack INC HL ; Point HL at next byte of our messgae JR DISPMSG ; Loop back to process the next byte MSG1 DB "Welcome to VCF SE 3.0",0 END BEGIN