home *** CD-ROM | disk | FTP | other *** search
- ;==================================================+
- ; |
- ; TITLE: GENERIC1.ASM -- |
- ; GENERIC1.DOC --> .ASM Version (52 COLUMNS)
- ; with "KEYBOARD SELECT" |
- ; ~~~~~~~~ ~~~~~~ |
- ; AUTHOR: Richard Altman DATE: 10/15/91 |
- ; |
- ; See KEYBRD: and KEYBD1: toward middle of file. |
- ; ~~~~~~ ~~~~~~ |
- ; See XXXMSG: and YYYMSG: toward end of 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 char from keyboard
- WRTCHR EQU 2 ; Write char 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
- 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
- CPI 'x' ; if X or x
- JZ KEYBD1
- LXI D,KEYMSG
- CALL PRINT ; else RETURN
- RET ; and print YYYMSG.
- 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 char to output
- CALL PRINTB ;Send it to console
- POP PSW ;Restore output char
- POP H
- POP D
- POP B
- RET
- ;
- PRINTB: MOV E,A ; Get character into
- MVI C,WRTCHR ; BDOS entry register
- 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',CR,LF,LF
- DB 'produce a new Assembly Version of '
- DB '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 TAB,'etc. etc. etc.',CR,LF,LF,LF
- DB ' >>>>> Press <ANY KEY> to '
- DB 'continue.',CR,LF,LF
- DB ' >>>>> Press < X > to '
- DB 'stop. ',BEL,0
- DSHMSG: DB CR,LF,LF,'========================'
- DB '=========================='
- DB CR,LF,LF,0
- YYYMSG: DB '"ANY KEY" was pressed. '
- DB 'Therefore, this is simply',CR,LF,LF
- DB 'a continuation of the (above) '
- DB 'GENERIC MESSAGE.',CR,LF,LF,BEL,0
- ZZZMSG: DB TAB,'"X" was pressed.'
- DB CR,LF,LF,'The (above) GENERIC '
- DB 'MESSAGE is now ENDED.',CR,LF,LF
- DB BEL,0
- KEYMSG: DB CTRLK,CTRLK,CTRLK,CTRLK,CLX,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
-