TITLE 'SYA Vers. 1.3 4/2/85' TRUE EQU 0FFh FALSE EQU 00h ; User-definable Features: ;******************* Define Editor ******************************** ; *** One, and ONLY one, Editor Equate May be TRUE *** * TSC EQU FALSE ;TSC is a line editor that defines line * ; numbers with 3 bytes after each CR * WORDSTAR30 EQU TRUE ; * ; * ;*******************End Editor Definition********************* ; Terminal Definition ; Right now only for Televideo 950 - to display TXTPTR and ; mode (scrolling, paging, or line-by-line) TVI950 EQU FALSE ;displays TXTPTR in status line (except scrolling) ; ;*********************End Terminal Definition******************************* ; ORG 100H JMP START ;jump over DW for start of edit space IF WORDSTAR30 ;if WORDSTAR 3.0 ED$SP$STRT DW 7849H ENDIF ;WS 3.0 IF TSC ED$SP$STRT DW 0249Bh ;Start of Edit Space for XED22 ;(actually, 2498H, but first 3 bytes ENDIF ;TSC ; are LINO not preceded by CR) IF TVI950 TVI950FLG: DB 0FFh ;set the flag to display the TVI950 ELSE ; flag as desired TVI950FLG DB 00h ENDIF START: LXI SP,STAK ;set up stack pointer CALL ILPRT ;do short starting message DB CR,LF,9 DB 'SYA (SAVE YOUR ASSets)',' v.1.3, ' IF TSC DB 'for XED-22',CR,LF ENDIF ;TSC IF WORDSTAR30 DB 'for WordStar 3.0',CR,LF ENDIF DB 9,' (C) E.Stork, Arlington VA 22205',0 ; LHLD ED$SP$STRT ;get the starting point for the editor SHLD TXTPTR ;and store it ;enter MENU with all pointers saved. MENU trashes all registers MENU: CALL ILPRT DB CR,LF,LF,9,9,9,9 DB 'MENU:',CR,LF,LF,9 DB '''D'' = Display Memory from Current Pointer Position',CR,LF,9 DB '''L'' = Scroll, Page, or Line-by line Display',CR,LF,9 DB '''B'' = Back up (Max 255 lines each time)',CR,LF,9 DB '''T'' = Return to Top of Edit Space',CR,LF,9 DB '''S'' = Save to a file, from Top to current Pointer Position',CR,LF,9 IF TVI950 DB '''F'' = Toggle Textpointer display on TVI-950 Status Line ON/OFF',CR,LF,9 ENDIF DB '''M'' = Display this Menu',CR,LF,9 DB '''X'' = Exit Now : ',0 CALL INKEY ; and fall through ;Table for menu selection FUNC$TST: CPI 'D' ! JZ DUMP IF TVI950 CPI 'F' ! JNZ MEN1 LDA STATLINFLG ;if 'F', we want to complement the flag CMA ; so do it STA STATLINFLG ! JMP MENU ; and store it away. ENDIF ;tvi950 MEN1: CPI 'B' ! JZ BACKUP CPI 'L' ! JZ LINES CPI 'M' ! JZ MENU CPI 'S' ! JZ SAVE CPI 'T' ! JZ TOP CPI 'X' ! JZ WRMBOOT CPI 03h ! JZ WRMBOOT CALL ILPRT DB CR,LF,LF,LF,LF,9 DB 'Only ''B'',''L'',''M'',''S'',''D'',' IF TVI950 DB '''F'',' ENDIF DB 'and ''T'' are legal.',CR,LF,LF,9 DB 'Type any key to return to Menu, ^C to quit: ',0 CALL INKEY JMP MENU ;end of menu selection table ;DUMPing starts at value in TXTPTR ;all registers available for use DUMP: MVI C,CONOUT MVI E,0AH ;send LF to console first CALL BDOS MVI A,22 ;set up EOL counter STA EOLCNTR ;set the counter to 22, for paging DMP1: LHLD TXTPTR ;get the starting point MOV A,M ;get the byte from memory INX H ;bump the pointer SHLD TXTPTR ;save it. JMP CNTRL$CHAR ;check for control character DMP2: MOV E,A ;put character into [E] MVI C,CONOUT CALL BDOS ;and output the character ;now check for interrupt (any key will interrupt dumping) MVI C,DIRCONIO ;use non-echo conin function #6 MVI E,0FFH ;we want to get a character CALL BDOS ;returns non-zero if char is waiting, and ORA A ;it's zero until character is typed JNZ EOL1 ;jump out of here if character waiting JMP DMP1 ;loop and keep dumping EOLINE: ;comes here from CNTRL$CHAR on EOL PUSH PSW ;save [A] IF TSC ;assemble only if TSC Editor equate is TRUE CALL SKIP$LINO ENDIF ;end if TSC LDA SCROLFLG ;get the flag ORA A ;is non-zero if scrolling is wanted JZ EOL0 ;if zero, jump over immediate return JMP EOL3 ;return without stopping. EOL0: LDA TVI950FLG ORA A ;flag is non-zero if TVI950 status display wanted IF TVI950 CNZ DISP$STAT ;in which case, do the routine ENDIF LDA SNGL$LN$FLG ;if single line mode, skip the message ORA A JNZ EOL1 ;if it is, skip counter & messages, but wait for keyin LDA EOLCNTR ;get the counter DCR A ;bump the counter down one STA EOLCNTR ;and save it ORA A ;is it zero yet? JNZ EOL3 ;if not yet 0, go on MVI A,22 ;else reset the counter STA EOLCNTR ; to 22 lines EOL1: CALL INKEY IF TVI950 ;kill status line PUSH PSW ;save the response to INKEY CALL ILPRT DB ESC,'g',ESC,'f',ESC,'G0',CR,0 POP PSW ;get INKEY response back for testing ENDIF ;TVI950 CPI 'M' ! JZ EOL2 CPI 'L' ! JZ EOL2 CPI 'D' ! JZ EOL2 CPI 'B' ! JZ EOL2 CPI 'S' ! JZ EOL2 CPI 'T' ! JZ EOL2 CPI 'X' ! JZ WRMBOOT CPI 03h ! JZ WRMBOOT JMP EOL3 ;anything else, go on EOL2: POP D ;balance stack (the PUSH PSW in this routine) ;(OK to trash [DE]) PUSH PSW ;save the selected function MVI C,CONOUT MVI E,0DH ;send to console first CALL BDOS POP PSW ;get the selected function back JMP FUNC$TST ;go see what is wanted, and do it EOL3: POP PSW ;get [A] back JMP DMP2 ;send the char to console, and continue EOLCNTR: DB 22 ;counter for EOLs IF TSC SKIP$LINO: ;routine used only for TSC Editor LHLD TXTPTR ;get the text pointer INX H ; .. and bump it twice INX H ; .. to get past 2 of the 3 LINO bytes ; .. that TSC inserts after CR MVI M,LF ; Then put a carriage return into the 3rd one SHLD TXTPTR ;and store the text pointer again. RET ;then return to calling routine ENDIF ;end of TSC-only routine ;CALLed from DUMP. Enters & returns with current character in [A], unless ;control character other than CR, LF, and TAB, which are dumped. ;Might want to changed for WS* version CNTRL$CHAR: ;first make a few tests, in case we overran the text CPI 0AFH ;that's XRA A - quite common JZ BACKUP ;get out of here CPI 99H ;sometimes memory has that JZ BACKUP ;get out CPI 0D1H ;POP D JZ BACKUP CPI 0E1H ;POP H JZ BACKUP CPI 0F1H ;POP PSW JZ BACKUP ;In case this is a 2nd try and there are already ^Z (EOF) in memory, ;we'll NULL them out. If we did not, we could not SAVE past that point. CPI 1AH ;^Z JZ NOZ ;Jump to routine to NULL it out ; ANI 7fh ;now reset high bit 0, just in case CPI 7fh ;we don't want deletes JZ CC1 CPI CR JZ EOLINE ;on CR, go do EOLINE routine CPI LF JZ CC2 ;linefeed is OK CPI TAB JZ CC2 ;TAB is OK CPI 20h JNC CC2 ;this skips all other control chars CC1: JMP DMP1 ;If we get here, we don't ; want to send it to the screen CC2: JMP DMP2 ;send it to screen, and keep going NOZ: LHLD TXTPTR ;get the pointer. It already points past the ^Z, DCX H ;so decrement it by one MVI M,0 ;NULL the byte in memory JMP DMP1 ;DMP1 reloads the the pointer from earlier save, ;and we did not distrub that value ;routine to back up 'n' lines ;use all registers BACKUP: CALL ILPRT DB LF,LF,CR,0 BAK0: CALL ILPRT DB CR,'Enter # of lines to back up ' DB '(255 Max) or ''M'' for menu: ',7,0 CALL GETNUM ;routine to get number of lines to back up, ; convert to binary, returns with value in [B] ; as well as in BIN$BUF LHLD TXTPTR BAK1: DCX H MOV A,M ;get byte into [A] CPI CR ;is it a carriage return? JNZ BAK1 ;loop if not CR SHLD TXTPTR XCHG ;get TXTPTR into [DE] LHLD ED$SP$STRT ; and start of edit space into [HL] CALL CMP16 ;If TXTPTR is equal to or less than ED$SP$STRT, ; we return from CALL with s=1 and c=1. ; So long as TXTPTR is greater than ED$SP$STRT, ; the return is with C=0 and S=0. (Z=1 if equal.) JC BAK1A ;TXTPTR is above start of Edit Space, so keep going. LHLD ED$SP$STRT ;point to start of edit space SHLD TXTPTR ; JMP DUMP BAK1A: LHLD TXTPTR LDA BIN$BUF ;number of lines to back up DCR A ;take one away STA BIN$BUF ;save it JNZ BAK1 ;and loop unless the line counter is zero CALL ILPRT DB 7,0 ;ring bell when ready to go again JMP DUMP ;When BIN$BUF=0, return to DUMP ;end BACKUP routine LINES: ;comes here from MENU (sets to Paging as default mode) XRA A ;clear [A] STA SNGL$LN$FLG ;clear the flags STA SCROLFLG CALL ILPRT DB CR,LF,9,'Type ''1'' for Single-Line Advance, ' DB '''S'' for Scrolling,',CR,LF DB 9,'any other key for Paging :',0 CALL INKEY PUSH PSW ;send a to the console before proceeding MVI C,CONOUT ;\ MVI E,0DH ; \ CALL BDOS ; \ POP PSW ;get it back CPI '1' ;do we want single lines? JNZ LIN1A ;no, so try scrolling STA SNGL$LN$FLG ;else make the flag non-zero JMP DUMP ;and continue dumping in that mode LIN1A: CPI 'S' ;Scrolling wanted? JNZ DUMP ;if not scrolling, paging is the default mode STA SCROLFLG ;else make the flag non-zero JMP DUMP ;and scroll ;Routine to move TXTPTR to start of edit space TOP: LHLD ED$SP$STRT ;point to start of edit space SHLD TXTPTR ; JMP DUMP ; reset disks system to assure disk can be written to RESET: LDA 4 ;get current default disk into [A] PUSH PSW ;save it on the stack MVI C,13 ;reset disk system, in case user forgot to do ^C CALL BDOS POP PSW ;get default disk back into [A] MOV E,A ;move it to [E] MVI C,SELDSK CALL BDOS ;Reselect former default disk RET ;end RESET routine ;FILE SAVE ROUTINE SAVE: CALL ILPRT DB CR,LF,LF,7 DB 9,'Are you SURE you want to SAVE now?',CR,LF,LF DB 9,'You will save ONLY to the last line on ' DB 'the screen.',CR,LF,LF DB 9,'Type ''Y'' if you want to proceed,',CR,LF DB 9,'Any other key to return to MENU :',0 CALL INKEY CPI 'Y' JNZ MENU ;First insert EOFs and end of memory wanted LHLD TXTPTR ;first point to next byte in memory INX H ;bump it MVI M,CR ;put in CR INX H MVI M,EOF INX H IF TSC ;for EOS' editor MVI M,EOF ;need a bunch because of SKIP$LINO routine INX H MVI M,EOF INX H MVI M,EOF INX H MVI M,EOF INX H MVI M,EOF ENDIF ;TSC SHLD TXTPTR ;store it away ;Now set up file into which to save SAV3: CALL ILPRT DB CR,LF,LF,9,'Enter Filename (not FTP) to save into :',0 LXI D,F$NAM$BUF MVI C,RDCONBF ;BDOS function 10 CALL BDOS LDA F$NAM$BUF+1 ;see if anything put in buffer ORA A ;if just , it's empty JNZ SAV3A ;if not zero we don't need default filename LXI B,0 ;clear [BC] MVI B,8 LXI H,DFLTNAM ;point [HL] to default file name LXI D,EFCB+1 ; and [DE] to EFCB space CALL MOVER JMP SAV5 ;no need to capitalize default file name DFLTNAM: DB 'DEFAULT ' ;need total of 8 characters & spaces here ;capitalize filename, in case entered as lower case SAV3A LXI B,0 ;zero [BC] MVI B,8 ;set up [B] as counter LXI H,EFCB+1 ;make filename upper case UC1: MOV A,M ;get the byte CALL UCASE MOV M,A INX H ;bump the pointer DCR B JNZ UC1 ;loop until done LXI H,EFCB ;point to first byte (used by F$NAM$BUF) MVI M,0 ;make it default disk ;now define disk drive to save (CR for default) SAV5: CALL ILPRT DB CR,LF,LF DB 9,'Save to which Disk (e.g., ''A'', or ''B'')',CR,LF DB 9,'Type for Default Disk',CR,LF DB 9,'Be SURE desired drive has disk inserted',CR,LF DB 9,'Your choice?: ',0 CALL INKEY CPI CR JZ SAV5A ;leave it default CPI 'A' JC NOGOOD CPI 'P'+1 JNC NOGOOD SUI 40H ;make binary STA EFCB ;and store it away JMP SAV6 NOGOOD: CALL ILPRT DB CR,LF,9,'Only ''A'' through ''P'' are valid entries ' DB '- hit to try again',CR,LF CALL INKEY JMP SAV5 SAV5A: LDA 4 ;get default byte ANI 0FH ;0000 1111 - gets low nibble INR A ;bump it one, because 0=A,1=B, etc STA EFCB ;and put it into first byte of EFCB SAV6: LXI D,EFCB ;point to first char in EFCB MVI C,SRCHF ;search for first occurrence CALL BDOS ;search on CURLOG disk CPI 0FFH ;if file is not on disk, returns FFH JZ SAVE1 ;if no such file, go make it LDA EFCB ;get the disk byte ADI 40H ;make it ascii STA SAV6A ; CALL ILPRT ;print first part of message to console DB CR,LF,LF,LF,LF,LF,LF,'*** Output File ' DB 'exists on disk ' SAV6a: DB ' :' ;space for disk identifier DB ' ***',CR,LF,LF DB 9,9,'Type ''E'' to erase and proceed,',CR,LF DB 9,9,9,' any other key to define another filename: ',7,0 ;get decision on what to do CALL INKEY ;char returned in [A] CPI 'E' JNZ SAV3 ;try again if 'E' was not typed LXI D,EFCB ;point to outfile FCB MVI C,ERASE ; to erase the existing file CALL BDOS ; that was identified above. SAVE1: LXI D,EFCB ;point to the EFCB MVI C,MAKE ;create file call CALL BDOS CPI 0FFh ;bad make? JZ WRT$ERR ;else fall through ;this is where we start the real saving. The first 3 lines do set-up LXI B,0 ;set [BC] to zero, to indicate real data LHLD ED$SP$STRT ;go to starting point SHLD TXTPTR ;store it SAV11: LXI D,EFCB ;point [DE] to EFCB LHLD TXTPTR ;get the pointer MOV A,M ;get the character INX H ;bump the pointer SHLD TXTPTR ;store after bumping IF TSC ;for EOS' editor CPI CR ;is it a CR? CZ SKIP$LINO ;if so, bump pointer past LINO bytes ENDIF ;TSC CPI EOF JNZ SAV12 ;not EOF MVI B,1 ;on EOF, set [B] to 1 SAV12: PUSH B ;[BC] is 0 unless EOF CALL PUTC ;put the character POP B ;was it EOF last time? MOV A,B ;must be in [A] to test ORA A ;if it was, we're non-zero JNZ FINISH ;so go finish up JMP SAV11 ;else loop for more. ; PUTC (Adapted from A.Johnson-Laird's Book, page 113) ; This subroutine either puts the next chararacter out ; to a sequential file, writing out completed 'records' ; (128-byte sectors) or, if requested to, will fill the ; remainder of the current 'record' with 1AH's to indicate ; End of File to CP/M. ; ; Entry Parameters ; ; DE -> File Control Block ; B = 0, A = next data character to be output ; If B not 0, fill the current 'record' with 1AH's ; ; BUFSIZ EQU 128 ;Buffer Size PUTBUF: DS BUFSIZ ;Declare buffer CHAR$CNT: DB 0 ;Char. count (initially 'empty') ; PUTC: PUSH D ;Save EFCB Address PUSH PSW ;Save data character MOV A,B ;Check if end of file requested ORA A JNZ PUTCEF ;Yes CALL PUTCGA ;No, get address of next free byte ;HL -> next free byte ;E = Current Char. count (as well as A) POP PSW ;Recover data character MOV M,A ;Save in buffer MOV A,E ;Get current character count INR A ;Update character count CPI BUFSIZ ;Check if buffer full JZ PUTCWB ;Yes, write buffer STA CHAR$CNT ;No, save updated count POP D ;Dump EFCB Address for return RET ; PUTCEF: ;End of file POP PSW ;Dump data character CALL PUTCGA ;HL -> next free byte ;A = Current character count PUTCCE: ;Copy EOF character CPI BUFSIZ ;Check for end of buffer JZ PUTCWB ;Yes, write out the buffer MVI M,EOF ;No, store EOF in buffer INR A ;Update count INX H ;Update buffer pointer JMP PUTCCE ;Continue until end of buffer ; PUTCWB: ;Write buffer XRA A ;Reset character count to 0 STA CHAR$CNT LXI D,PUTBUF ;DE -> Buffer MVI C,SETDMA ;Set DMA Address -> Buffer CALL BDOS POP D ;Recover EFCB Address MVI C,WRITE ;Write Sequential Record CALL BDOS ORA A ;Check if error JNZ WRT$ERR ;Yes if A = NZ RET ;No, return to caller ; PUTCGA: ;Return with HL -> next free char. ;and A = current char. count LDA CHAR$CNT ;Get current character count MOV E,A ;Make word value in DE MVI D,0 LXI H,PUTBUF ;HL -> Base of buffer DAD D ;HL -> next free character RET ;CMP16 Routine to compare two 16-bit values, from L.Leventhal's ; 8080/8085 Ass'y Language Routines, page 210. ; Results expressed in PSW flags: ; If minuend=subtrahend, z=1,s=0,c=0 ; If minuend>subtrahend, z=0,s=0,c=0 ; If minuend typed? JNZ CONVERT ;fall through to CONVERT if not POP H ;else balance the stack JMP BAK0 ; and try again - means the user got ; overshot, not knowing he hit end of file CONVERT: ;this routine converts the ASCII numerical value ; in BUFF$TMP to its binary equivalent ; (e.g., 65 is converted to 41H) and stores that ; binary value in BIN$BUF LDA TMP$BUF+1 ;get actual lenght of TMP$BUF into (A) MOV B,A ;else store [A] in [B] PUSH B ;and save it away LXI D,TMP$BUF+2 ;point (DE) to data in ASCII line-length buffer LXI H,0 ;and zero out HL ASC$BIN: LDAX D ;get the character INX D ;point (DE) to next char CPI '0' ;is character <'0' (30h)? JC GET$NUM$ERR ;non-numeric is error CPI '9'+1 ;is it more than 9 (39h)? JNC GET$NUM$ERR SUI '0' ;make ASCII binary (-30h) MOV B,H ;copy partial answer to (BC) MOV C,L ; for later user in multiplying DAD H ;HL = 2xHL now DAD H ;HL = 4xHL now DAD B ;HL = 5x HL now DAD H ;HL = 10x orig HL now ADD L ;adds L to accumulator MOV L,A ;put answer back into (L) STA BIN$BUF ;store in binary buffer & ; up-date on every loop till jumpout POP B ;get the buffer length counter DCR B ;reduce by 1 JZ DONE ;if 0, we're done converting PUSH B ;if not 0, save for next loop JMP ASC$BIN ;loop until done DONE: LDA BIN$BUF ;we need to add 1 to make it look right INR A ; on screen STA BIN$BUF RET TMP$BUF: DB 3 ;maximum number of bytes to be accepted DB 0,0,0,0 ;this allows for max of 3 bytes ;first of above 4 is for actual length BIN$BUF: DB 0,0 ;storage space GET$NUM$ERR: CALL ILPRT DB CR,LF,LF DB 9,'Only digits (0-9) are allowed-hit any key to try again' DB CR,LF,0 CALL INKEY POP PSW ;balance the stack from the CALL JMP BACKUP ; and try again ; end of GETNUM routine MOVER: ;called with [HL] pointing to string to be moved to ; area of memory pointed to by [DE] ;Number of bytes to be moved in [BC] ;Returns when [BC] is 0 MOV A,M ;get byte from input filename into [A] STAX D ;and store it in output filename block INX H ;else bump pointers INX D ; DCR B ;more to go? MOV A,B ORA C RZ ;when [BC] = 0, return to calling routine JMP MOVER ;LOOP for more characters ; ;This routine sends the string that follows the command ; CALL ILPRT ;to the console until a binary 0 is encountered, then ;returns to the point in the program that FOLLOWS the string ;that was sent to the console. ; ; ILPRT: XTHL ;Swap top of stack with (HL) ; {PC location following CALL ILPRT ; is now in (HL), stack top is trash} ILP1: MOV A,M ;get character pointed to by (HL) INX H ;increment our string pointer CPI 0 ;was it the last one? JZ ILP2 ;if yes, quit MOV E,A ;get ready to send char.to console MVI C,2 ;CP/M's output char. to console routine PUSH H ;save pointer CALL BDOS ;send character to console POP H ;restore pointer JMP ILP1 ;Loop for more characters ILP2: XTHL ;(HL) points to PC after the '$' -- XTHL ; switches to top of stack for return, but ; trashes (HL) RET ;To location folowing string sent to console ;routine to get character from keyboard INKEY: MVI C,DIRCONIO ;use non-echo conin function #6 MVI E,0FFH ;we want to get a character CALL BDOS ORA A ;it's zero until character is typed JZ INKEY ;so loop until we have a response. UCASE: CPI 'a' ;now make upper case RC CPI 'z'+1 RNC SUI 'a'-'A' ;subtract 20h RET IF TVI950 ;assemble only for TVI950 TXTPTR display ;Binary to Hexadecimal Ascii Conversion ;Converts one byte of binary data to two Ascii ;characters that correspond to the 2 Hexadecimal ;digits representing the value of the byte. ; ;Enter with binary byte to convert in [A] ;Exit with most significant digit in [H], least in [L] ;Source: page 153, Leventhal's 8080 Subroutines book. BN2HEX: MOV B,A ;save incoming value for later use ANI 0F0H ;get the high nibble RRC ! RRC ! RRC ! RRC ;move high nibble to low nibble CALL NASCII ;convert high nibble to ASCII MOV H,A ;put converted high nibble into [H] MOV A,B ;get incoming value back into [A] ANI 0FH ;get low nibble CALL NASCII ; MOV L,A ;put converted low niblle into [L] RET ;RETurn to caller NASCII: CPI 10 JC NAS1 ;jump if <10 ADI 7 ;else add 7 to skip 3Ah to 40h NAS1: ADI '0' ;add 30h RET ;end BN2HEX routine DISP$STAT: LDA STATLINFLG ;get the flag ORA A ;non-zero if status line is desired RZ ;so if zero, return now, else fall thru ;put TXTPTR and ED$SP$STRT values into ASCII format LHLD ED$SP$STRT XCHG ;put TXTPTR value into [DE] MOV A,E ;get the lowest significance byte CALL BN2HEX ;return with ASCII equivalent in [HL] MOV A,L ;and store for display STA DSPL+3 ;as the last byte MOV A,H ; STA DSPL+2 ;and so on MOV A,D ;now get most significant byte CALL BN2HEX ;and do it all again MOV A,L STA DSPL+1 MOV A,H STA DSPL LHLD TXTPTR XCHG ;put start of edit space value into [DE] MOV A,E ;get the lowest significance byte CALL BN2HEX ;return with ASCII equivalent in [HL] MOV A,L ;and store for display STA DSPL2+3 ;as the last byte MOV A,H ; STA DSPL2+2 ;and so on MOV A,D ;now get most significant byte CALL BN2HEX ;and do it all again MOV A,L STA DSPL2+1 MOV A,H STA DSPL2 ;now display status line DSX: CALL ILPRT ;now send string to status line DB ESC,67H,ESC,66H,ESC,'G4' ;status line reverse-video DB 'Edit Space starts at at ' DSPL: DB ' h ' DB 'TXTPTR now at ' DSPL2: DB ' h' DB CR,0 ;and send it to the console RET STATLINFLG: DB 0 ;default value is zero ;end DISP$STAT routine ENDIF ;TVI950 txtptrs display ABRT$EX: CALL ilprt DB 1BH,2AH,LF,LF,LF,9,9,'Good bye ....',7,0 JMP WRMBOOT MKE$ERR: CALL ILPRT DB CR,LF,LF,LF,LF,9,9,'Cannot make ',0 LXI H,EFCB+1 ;OUTPUT FILENAME LXI D,MKE1 LXI B,8 CALL MOVER CALL ILPRT MKE1: DB ' .SYA' ;eight spaces for filename DB CR,LF,LF,LF,9,9,9,' - disk is probably full.',CR,LF,7,0 JMP WRMBOOT WRT$ERR: CALL ILPRT DB CR,LF,LF,LF,LF,9,9,'Ooops ... File Write Error',LF,CR DB LF,9,9,9,'Disk may be full.',CR,LF,7,0 JMP WRMBOOT ;DATA AND BUFFERS BAKCNTBUF: DB 3,0,0,0,0,0 ;buffer TXTPTR: DW ED$SP$STRT ;initialize to start of edit space SNGL$LN$FLG: DB 0 ;non-zero means advance line by line SCROLFLG: DB 0 ;non-zero means scrolling F$NAM$BUF: DB 8 ;in effect, F$NAM$BUF & EFCB are the same EFCB: DB 0,' ','SYA',0,0,0,0 ;8 spaces for filename in EFCB DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;for blocks DB 0 ;33 bytes total, last one is current record DS 100 ;SAVE SPACE FOR STACK STAK: EQU $ ;STACKTOP ;standard equates WRMBOOT EQU 0 ;location for warmboot EOF EQU 1AH ;END OF FILE SYMBOL FCB EQU 5CH ;default FCB BDOS EQU 5 ;location for BDOS calls or jumps ESC EQU 1BH ;escape character ; CONIN EQU 1 ;Console input to (A) CONOUT EQU 2 ;Send char in (E) to console LSTOUT EQU 5 ;send char out list device DIRCONIO EQU 6 ;direct console i/o ; PRNTSTR EQU 9 ;print to CONSOLE string pointed to ; by (DE), end string w/ '$' ; RDCONBF EQU 10 ;read console line into buffer ; pointed to by (DE) ; CONST EQU 11 ;get console status in (A) ; FFh if char is ready, 00h if not SELDSK EQU 14 ;select disk defined in [E] (A=0,B=1,etc.) OPEN EQU 15 ;Open a file, FCB in (DE) CLOSE EQU 16 ;Close a file, FCB in (DE) SRCHF EQU 17 ;search for first file, FCB in (DE) SRCHN EQU 18 ;search for next file, FCB in (DE) ERASE EQU 19 ;erase file, FCB in (DE) READ EQU 20 ;read file sector, FCB in (DE) WRITE EQU 21 ;write file sector, FCB in (DE) MAKE EQU 22 ;make new file, FCB in (DE) REN EQU 23 ;rename file, FCB in (DE) SETDMA EQU 26 ;set DMA address as define in (DE) CR EQU 0DH ;CARRIAGE RETURN LF EQU 0AH ;LINE FEED TAB EQU 09 ;Tab character END