home *** CD-ROM | disk | FTP | other *** search
- ;=========================================================================+
- ; |
- ; TITLE: GENERIC1.ASM -- GENERIC1.DOC --> .ASM Version |
- ; with "KEYBOARD SELECT" |
- ; ~~~~~~~~ ~~~~~~ |
- ; AUTHOR: Richard Altman DATE: 10/15/91 v1.0 |
- ; |
- ; See KEYBRD: and KEYBD1: toward the middle of this file. |
- ; ~~~~~~ ~~~~~~ |
- ; See XXXMSG: and YYYMSG: toward the end of this file. |
- ; ~~~~~~ ~~~~~~ |
- ;=========================================================================+
- ;
- BEL EQU 07H
- CTRLK EQU 0BH
- 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
- CONIN EQU 1 ; Get character from keyboard
- 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
- CALL KEYBRD
- LXI D,DSHMSG
- CALL PRINT
- LXI D,YYYMSG
- CALL PRINT
- EXIT: LHLD STACK ; Get old stack pointer
- SPHL ; Move back to old stack
- RET ; And return to CCP
- ;
- KEYBRD: MVI C,CONIN
- CALL BDOS ; Get one character
- CPI 'X'
- JZ KEYBD1 ; Jump to KEYBD1 if X,x
- CPI 'x'
- JZ KEYBD1 ;
- LXI D,KEYMSG ; else return
- CALL PRINT ; and print YYYMSG.
- RET
- KEYBD1: LXI D,KEYMSG
- CALL PRINT
- LXI D,DSHMSG
- CALL PRINT
- LXI D,ZZZMSG
- CALL PRINT
- JMP EXIT
- ;
- 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,TAB,'etc. etc. etc.',CR,LF
- DB LF,LF,TAB,' >>>>> Press <ANY KEY> to continue.',CR,LF,LF
- DB TAB,' >>>>> Press < X > to stop.',CR,LF,BEL,0
- DSHMSG: DB CR,LF,LF,'=================================================='
- DB '=====================',CR,LF,LF,0
- YYYMSG: DB TAB,'"ANY KEY" was pressed;'
- DB ' therefore, this is simply a ',CR,LF,LF,TAB,'continuation '
- DB 'of the (above) GENERIC MESSAGE.',CR,LF,LF,BEL,0
- ZZZMSG: DB TAB,'" X " was pressed; '
- DB 'the GENERIC MESSAGE is now ENDED.',CR,LF,LF,LF,BEL,0
- KEYMSG: DB CTRLK,CTRLK,CTRLK,CTRLK,CTRLK,CLX,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
-
-