home *** CD-ROM | disk | FTP | other *** search
- ;==================================================+
- ; |
- ; TITLE: GENERIC.ASM |
- ; GENERIC.DOC --> .ASM Version (52 COLUMNS)
- ; |
- ; AUTHOR: Richard Altman DATE: 10/15/91 |
- ; |
- ; See XXXMSG: toward the end of this file. |
- ; ~~~~~~ |
- ;==================================================+
- ;
- BEL EQU 07H
- TAB EQU 09H
- CR EQU 0DH
- LF EQU 0AH
- CLS EQU 1AH
- CLX EQU 17H
- ESC EQU 1BH
- APOS EQU 27H ; Apostrophe
- ;
- ; BDOS equates
- ;
- BDOS EQU 0005H
- WRTCHR EQU 2 ; Write character to console
- ORG 0100H
- ;
- ;=================================================
- ;
-
- START: LXI H,0
- DAD SP ; HL=old stack
- SHLD STACK ; Save it
- LXI SP,STACK ; Get new stack
- XRA A
- STA CLRFLG ; Clear file found flag
- MVI C,12 ; Get/save CP/M version #
- CALL BDOS
- MOV A,L
- STA VERFLG
- CPI 20H ; Set carry if CP/M 1.4
- JC VERBAD ; Exit on earlier than 2.0
- LXI D,XXXMSG ; Display XXXMSG
- CALL PRINT
- EXIT: LHLD STACK ; Get old stack pointer
- SPHL ; Move back to old stack
- RET ; And return to CCP
- ;
- PRINT: LDAX D
- ORA A
- RZ ; If zero, finished
- CALL PRINTA ; Display on CRT
- INX D
- JMP PRINT
- ;
- PRINTA: PUSH B
- PUSH D
- PUSH H
- PUSH PSW
- CALL PRINTB
- POP PSW
- POP H
- POP D
- POP B
- RET
- ;
- PRINTB: MOV E,A ; Get character into
- MVI C,WRTCHR ; BDOS entry reg.
- JMP BDOS ; Call CONOUT via BDOS
- ;
- VERBAD: LXI D,VERMSG ; Abort,
- CALL PRINT ; bad CP/M version
- JMP EXIT
- ;
- ;=================================================
- ;
- ; NOTE: As long as you enclose your message
- ; in single quotes, you can print virtually
- ; anything you want on the screen.
- ;
- ; Use DB at the beginning of each message
- ; line in this file.
- ;
- ; Use CR,LF at the end of each line to be
- ; displayed on screen.
- ;
- ; Always END the message with a ZERO (0).
- ;
-
- XXXMSG: DB CLS,CR,LF,TAB,'This is a GENERIC '
- DB 'MESSAGE.',CR,LF,LF,LF
- DB 'Use ASM ________.AAZ and '
- DB 'LOAD ________ to produce',CR,LF
- DB LF,' a new Assembly Version '
- DB 'of a .DOC file.',CR,LF,LF,LF
- DB 'This is Line #1 of a general '
- DB 'message .......',CR,LF
- DB 'This is Line #2 of a general '
- DB 'message .......',CR,LF
- DB 'This is Line #3 of a general '
- DB 'message .......',CR,LF
- DB 'This is Line #4 of a general '
- DB 'message .......',CR,LF
- DB 'This is Line #5 of a general '
- DB 'message .......',CR,LF
- DB LF,TAB,'etc. etc. etc.',CR,LF
- DB LF,LF,BEL,0
- VERMSG: DB '>>>>> Needs CP/M 2.0 or newer '
- DB 'to RUN',CR,LF,0
- ;
- CLRFLG: DB 0 ; File found flag
- VERFLG: DB 0 ; CP/M version number
- ; ; (0= not CP/M 2.0 or newer)
- ;
- DS 100 ; Stack area
- STACK: DS 2 ; Save old stack pointer here
- ;
- ORDER EQU $ ; Order table starts here
- ;
- END
-