home *** CD-ROM | disk | FTP | other *** search
- ;=========================================================================+
- ; |
- ; TITLE: GENERIC.ASM -- GENERIC.DOC --> .ASM Version |
- ; |
- ; AUTHOR: Richard Altman DATE: 10/15/91 v1.0 |
- ; |
- ; 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 and save the 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 ; Clear Screen and 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 ; Save the character to output
- CALL PRINTB ; Send it to console
- POP PSW ; Restore the output character
- POP H
- POP D
- POP B
- RET
- ;
- PRINTB: MOV E,A ; Get character into BDOS entry register
- MVI C,WRTCHR
- JMP BDOS ; Call CONOUT via the BDOS
- ;
- VERBAD: LXI D,VERMSG ; Abort, bad CP/M version
- CALL PRINT
- 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,TAB,'This is a GENERIC MESSAGE.',CR,LF,LF,LF
- DB TAB,'Use ASM ________.AAZ and LOAD ________ to produce'
- DB CR,LF,LF,TAB,'a new Assembly Version of a .DOC file.',CR,LF
- DB LF,LF,TAB,'This is Line #1 of a general message .......',CR,LF
- DB TAB,'This is Line #2 of a general message .......',CR,LF
- DB TAB,'This is Line #3 of a general message .......',CR,LF
- DB TAB,'This is Line #4 of a general message .......',CR,LF
- DB TAB,'This is Line #5 of a general message .......',CR,LF,LF
- DB TAB,TAB,'etc. etc. etc.',CR,LF,LF,LF,BEL,0
- VERMSG: DB '>>>>> Needs CP/M 2.0 or newer 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