;Program: RamTools(file 2) ;Version: 1.0 ;Author : Sam Weiss(Alias Mad@Kaypro) ;Date : May 1 1987. ;See the DOCS for modiifying & Joining the 2 files together into ;1 file ;This BIOS address is for CP/M. BIOS address for Zcpr3=E200 BIOS EQU 0F400H ;BIOS ENTRY POINT ORG 0FF10H ; main body of screen saving code.............................. ; VIDOUT EQU BIOS+0CH ;a call to this will print a char on the screen PRINT EQU BIOS+0FH ;'' '' '' '' '' '' '' '' '' '' printer ENTRY: DEFB 0CDH ; call op code KBDIN: DEFS 2 ; the address of the code from conin goes here ;This is our "Jump Table" for the different commands CP 00H ; if ^@, we will do the famous SC!!! JR Z,SC CP 1EH ;if ^^ we will turn cursor into a solid block JR Z,BLOCK CP 1FH ;if ^_ we will do a cold boot JR Z,CBOOT CP 1DH ;if ^] we will clear the screen JP Z,CLS CP 1CH ;if ^\ we will echo stuff to the printer JR Z,PTE RET ; else will return normally ;Can you guess what this does... That's right this is our famous Screen Saver ;(it clears the screen, waits for user to type a character, and returns control ;back to original program) SC: LD IY,CMSG ;printing beginning message CALL PRTST CALL ENTRY ;wait for a key LD IY,EMSG ;printing ending message CALL PRTST ;we will let block take care of the exit ;This turns the cursor into a block. BLOCK: CALL UNBL ;This just sets the cursor into a block JR ENTRY ;This does the Cold Boot. CBOOT: LD IY,SMSG ;ask user if he wants to cold boot CALL PRTST LD IY,RMSG CALL PRTST CALL ENTRY CP 059H ;TEST FOR "Y" JP Z,RST CP 079H ;test for "y" JP Z,RST EXIT: LD IY,BMSG ;cancel boot... erase msg. CALL PRTST JP ENTRY RST: IN A,(14H) ;here we start our cold boot. SET 7,A OUT (14H),A JP 0 ;This will ECho stuff to the printer. PTE: LD IY,SMSG ;This will echo chars to printer CALL PRTST LD IY,PMSG CALL PRTST LOOPP: CALL ENTRY ;This makes it continuous CP 1AH ;Exit if user pressed a ^Z JR Z,EXIT CP 13 ;do a CR,LF if a return is encountered JR Z,PLF ;and clear the status line for new input LD C,A PUSH AF CALL PRINT POP AF LD C,A CALL VIDOUT JR LOOPP PLF: LD C,0AH ;This sends the CRLF to the printer, CALL PRINT ;and clears the status line. LD C,0DH CALL VIDOUT LD C,18H CALL VIDOUT JR LOOPP CLS: LD IY,CLSMSG ;this just clears the screen CALL PRTST JP ENTRY ; This little bit of code turns the cursor into a solid block. UNBL: LD A,10 ;Loading the video register # for cursor OUT (28),A ;OUTing it to port 28. LD A,0 ;Loading the cursor # for a no blink cursor. OUT (29),A ;OUTing it to port 29. RET ;That's it.. returning now. ; This is our Message Printing Routine. ; Messages MUST end with a NULL character (0) or "^@" PRTST: ;This prints the messages below. LOOP: LD A,(IY) ;get char LD C,A ;put A into C for VIDOUT CP 00 ;is char 0? RET Z ;if yes, return CALL VIDOUT ;output char through bios vidout routine INC IY ;point to next char JP LOOP ;anymore characters? ;This is the message area ;last byte MUST be 0!! CMSG: DEFB 27,'C7',26,27,'C4',0 ;clear screen&off cursor EMSG: DEFB 26,0 ;clear screen&on cursor SMSG: DEFB 1BH,'B6',1BH,'B7',1BH,'=',56D,32D,18H,0 ;puts cursor a bottom RMSG: DEFB 'Reset? ',7,0 ;ask user if he wants a cold boot BMSG: DEFB 1BH,'=',56D,32D,18H,1BH,'C6',0 ;Return to previous cursor pos. CLSMSG: DEFB 27,'C7',26,0 ;Clear screen PMSG: DEFB 'Print> ',0 ;Prompt for the print echo END