home *** CD-ROM | disk | FTP | other *** search
- ;==================================================+
- ; |
- ; TITLE: GENERIC2.ASM -- |
- ; GENERIC2.DOC --> .ASM Version (52 COLUMNS)
- ; with "KEYBOARD SELECT" |
- ; ~~~~~~~~ ~~~~~~ |
- ; AUTHOR: Richard Altman DATE: 10/15/91 |
- ; |
- ; See KEYBRD: KEYBD1: KEYBD2: near middle of file.|
- ; ~~~~~~ ~~~~~~ ~~~~~~ |
- ; See XXXMSG: MSSG1: MSSG2: 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
- 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 ; Move back to old stack
- RET ; And return to CCP
- ;
- KEYBRD: MVI C,CONIN
- CALL BDOS ; Get one char
- CPI '1'
- JZ KEYBD1 ; Jump to KEYBD1
- CPI '2' ; if "1"
- JZ KEYBD2 ; Jump to KEYBD2
- LXI D,KEYMSG ; if "2"
- CALL PRINT
- RET ; else RETURN
- ; ; & 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 ; 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 char into BDOS
- MVI C,WRTCHR ; 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 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,'>>>>> Press <1> or <2> '
- DB 'to continue.',CR,LF,LF
- DB '>>>>> Press <ANY KEY> to stop.'
- DB CR,LF,LF,BEL,0
- DSHMSG: DB CLS,CR,LF,LF,LF,'================'
- DB '================================'
- DB '====',CR,LF,LF,LF,0
- ENDMSG: DB ' A key other than "1" or '
- DB '"2" was pressed.',CR,LF,LF,LF
- DB ' Therefore, this is simply the '
- DB 'ENDING of the',CR,LF,LF
- DB ' (previous) GENERIC '
- DB 'MESSAGE.',CR,LF,LF,LF,BEL,0
- MSSG1: DB ' "1" was '
- DB 'pressed;',CR,LF,LF
- DB ' the GENERIC MESSAGE (PART A) '
- DB 'was printed.',CR,LF,LF,LF,BEL,0
- MSSG2: DB ' "2" was '
- DB 'pressed;',CR,LF,LF
- DB ' the GENERIC MESSAGE (PART B) '
- DB 'was printed.',CR,LF,LF,LF,BEL,0
- KEYMSG: DB 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
- ;
- DS 100 ; Stack area
- STACK: DS 2 ; Save old stack pointer here
- ;
- ORDER EQU $ ; Order table starts here
- ;
- END