* * * * * ******* ******** ****** ******** * ** ** ** ** * * ** * * ** ** ** ** ** * ******* ** ** ** * ** ** ** ** * ** ** ** * ** * ** ******** ****** ** * * * A video display design editor for use with * the SOL computer and a Helios disk. * Version 1.4 (Mod 0) * * Written by: * * Stephen Maguire * P.O. Box 3742 DT * Anchorage, AK 99510 * * Copyright (C) 1981 * All rights reserved * * * * ORG 100H XEQ $+3 Bypass the jump statement * * Screen equates * SCREEN EQU 0CC00H Upper-left hand side of screen TOP EQU 0CBH Just above screen BOT EQU 0D0H Just below the screen * * Cursor key equates (high bit not striped) * CHUP EQU 97H Move cursor up key CHRGT EQU 93H Move cursor right CHLFT EQU 81H Left CHDWN EQU 9AH Down CHMODE EQU 80H Exit the editor key CHLOAD EQU 8CH Abort edit key CHHME EQU 8EH Reverse polarity key (inverse <--> normal) CHCLR EQU 8BH Clear the current picture * CHLF EQU 0AH Linefeed for printing CHCR EQU 0DH Carriage return * * Copy in all of the system equates * COPY NPTDEFS * JMP INIT If it is re-entered, ingore all disk operations * LHLD SYSGLO Set the Level-1 error trap address LXI D,GLERM for returning to this program upon errors DAD D MVI M,-1 INX H MVI M,-1 * LXI SP,STACK Set up our stack * XRA A Set the output file status to "unprotected" STA PRTCT * *----------------------------------------* * Process the input file name. * *----------------------------------------* * CMD0 LXI D,FNAM1 Point to the file name receiving area MVI A,PSN Get the file name CALL PSCAN STA LSTCHR Save the last character read * CMD1 LXI H,ILGIFN Illegal file name message JC ABTERR If illegal name, then error LXI H,EXPIFN Expected a file name error message JZ ABTERR If no name, then error * LXI D,FNAM1 Get the attribute byte of this file CALL GETAT STA FLAT1 Save it for later JC CMD2 * *----------------------------------------* * If there is an error in the file name * * check it out here. * *----------------------------------------* * LXI H,ILGIFN If it is an illegal file name, tell which one CPI ERINM JZ ABTERR * CPI ERNEX Is the file non-existent? JNZ ERROR Give a serious abort if that's not the case * LXI H,FDNE Print the file does not exist message CALL PRINT * CALL INPUT Does he want the file created? CALL OUTPUT Put out the answer ANI 5FH Wait for a reply, then make it upper case CPI 'Y' JNZ RABRT If he doesn't, then abort * LXI D,FNAM1 Create the file LXI H,FNAM1 MVI A,PSC+40H CALL PSCAN * JMP CMD1 Go back up to check for any errors * *----------------------------------------* * The file is legal, check protection * *----------------------------------------* * CMD2 ANI PREA Is the input file read protected? LXI H,IFLPRT Abort if so JNZ ABTERR * CALL DELM Go see if command ended with a legal delimiter CPI ',' Was the delimiter a comma? JNZ CMD3 If not, no more command line * *----------------------------------------* * Process the output file name. * *----------------------------------------* * LXI D,FNAM2 Create the output file if is doesn't exist MVI A,PSC Do it now CALL PSCAN STA LSTCHR Save the last character scanned * LXI H,ILGOFN If it's an illegal name, say so JC ABTERR * LXI H,EXPOFN Abort if the command is like "PICT filename,;" JZ ABTERR Give the "output file expected" error * LXI D,FNAM2 Get the attribute byte for this file CALL GETAT * LXI H,ILGOFN If the output file name is illegal, abort JNC ABTERR * ANI 7FH Strip off the undefined portion STA FLAT2 Save it for later * *----------------------------------------* * Determine which file is the out file. * *----------------------------------------* * LDA LSTCHR Get the last character scanned CALL DELM+6 The comma is not legal this time CMD3 LDA FLAT2 Get the file number LXI H,FNAM2 ORA A Is the output different from the input file? JP CMD4 Yes, go move the file name into a text message * LDA FLAT1 No, they are the same LXI H,FNAM1 * CMD4 SHLD OUTFIL Save the output file name address * ANI PWRI+PALO Is the file write or extend protected? JZ CMD5 Go open the file if all is okay * LXI H,OFLPRT Point to the error message CALL PRINT * CALL INPUT Ask if he would like to load the file anyway CALL OUTPUT Send out his answer ANI 5FH Convert any lower case answers CPI 'Y' JNZ RABRT If he doesn't want to load, abort * MVI A,-1 Indicate the the output file is protected STA PRTCT * *----------------------------------------* * Open the file; check if the file is * * a device file -- abort if so. * *----------------------------------------* * CMD5 LXI D,FNAM1 Open the file now CALL OPEN * LXI H,ILGIFN Print the error message JZ ABTERR * *----------------------------------------* * Read in the file now. Abort if the * * file is too long to fit in the buffer * *----------------------------------------* * LXI D,BUFFER Find the length of the buffer CALL SBTRCT LXI B,401H Maximum length * LDA FILEN Get the file number LXI D,BUFFER Point to the recieving buffer CALL SYS Go read in the file DB RBLOP JMP CMD6 * LXI H,FTBIG If we got here, the file is too big JMP ABTERR * *----------------------------------------* * If the read was okay, continue here * *----------------------------------------* * CMD6 CPI EREOF If EOF has been reached, ignore it JNZ ERROR * XCHG . Blank fill the rest of the file CMD7 MVI M,' ' Put in the blank MOV A,H Are we done? CPI