home *** CD-ROM | disk | FTP | other *** search
- ;=========================================================================+
- ; |
- ; TITLE: GENERIC2.ASM -- GENERIC2.DOC --> .ASM Version |
- ; with "KEYBOARD SELECT" |
- ; ~~~~~~~~ ~~~~~~ |
- ; AUTHOR: Richard Altman DATE: 10/15/91 v1.0 |
- ; |
- ; See KEYBRD: KEYBD1: and KEYBD2: toward the middle of this file. |
- ; ~~~~~~ ~~~~~~ ~~~~~~ |
- ; See XXXMSG: MSSG1: and MSSG2: 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
- SHLD STACK
- LXI SP,STACK
- XRA A
- STA CLRFLG
- MVI C,12
- CALL BDOS
- MOV A,L
- STA VERFLG
- CPI 20H
- JC VERBAD
- LXI D,XXXMSG ; Display XXXMSG
- CALL PRINT
- CALL KEYBRD
- LXI D,DSHMSG
- CALL PRINT
- LXI D,ENDMSG
- CALL PRINT
- EXIT: LHLD STACK ; Get old stack pointer
- SPHL
- RET ; And return to CCP
- ;
- KEYBRD: MVI C,CONIN
- CALL BDOS ; Get one character
- CPI '1'
- JZ KEYBD1 ; Jump to KEYBD1 if "1"
- CPI '2'
- JZ KEYBD2 ; Jump to KEYBD2 if "2"
- LXI D,KEYMSG
- CALL PRINT
- RET ; else RETURN and print ENDMSG
- ;
- KEYBD1: LXI D,DSHMSG
- CALL PRINT
- LXI D,MSSG1
- CALL PRINT
- JMP EXIT
- ;
- KEYBD2: LXI D,DSHMSG
- CALL PRINT
- LXI D,MSSG2
- CALL PRINT
- JMP EXIT
- ;
- PRINT: LDAX D
- ORA A
- RZ
- CALL PRINTA
- 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
- MVI C,WRTCHR
- JMP 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
- DB LF,TAB,'>>>>> Press <1> or <2> to continue.',CR,LF
- DB LF,TAB,'>>>>> Press <ANY KEY> to stop.',CR,LF,LF,BEL,0
- DSHMSG: DB CLS,CR,LF,LF,LF,'========================================='
- DB '==============================',CR,LF,LF,LF,0
- ENDMSG: DB TAB,'A key other than "1" or "2" was pressed.',CR,LF,LF,LF
- DB TAB,'Therefore, this is simply the ENDING of the',CR,LF,LF
- DB TAB,' (previous) GENERIC MESSAGE.',CR,LF,LF,LF,BEL,0
- MSSG1: DB TAB,'"1" was pressed; ',CR,LF,LF,TAB,'the GENERIC '
- DB 'MESSAGE (PART A) was printed.',CR,LF,LF,LF,BEL,0
- MSSG2: DB TAB,'"2" was pressed; ',CR,LF,LF,TAB,'the GENERIC '
- DB 'MESSAGE (PART B) was printed.',CR,LF,LF,LF,BEL,0
- KEYMSG: DB 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
-