TITLE 'BISHOW v1.14 -- buffered bidirectional file scroll utility' ; ; - Code usage = 800H + (32*128), therefore... ; - Use GENCMD BISHOW 8080 CODE[M180] ; ; Ver 1.14 (cp/m-86), 13 Oct 84, Jim Byram ; - add scroll conditional to allow moving forward through ; file either by scrolling or by clrscr/write page ; ; Ver 1.13 (cp/m-86), 12 Oct 84, Jim Byram ; - fix screen bug remaining from ver 1.11 ; ; Ver 1.12 (cp/m-86), 12 Oct 84, Jim Byram ; - CP/M-86 translation using 80X86.CMD ; ; - The following bug note by Earl Boone still applies ; - A remaining KNOWN small problem is that if the last ; page of a file is displayed and the last line of text ; is not at bottom of screen, then a previous page or ; previous line command will back up a little farther ; than expected (i.e., one line excess if linmax =1). ; ; Ver 1.11, 29 July 84, Earl T. Boone ; ; Ver 1.10, 2 Apr 84, Charlie Polete ; ; Ver 1.09, 17 Mar 84, Charlie Polete ; ; Ver 1.08, 7 Dec 83, Bill Randle ...!tektronix!billr ; ; Ver 1.07, 1 Aug 83, Ted H. Emigh ...!unc!tucc!emigh ; ; Ver 1.06, 2 Jul 83, Chuck Forsberg ; ; Ver 1.051, 26 Jun 83, Dick Mead ; ; Ver 1.05, 31 May 83, Bruce Ratoff ; ; Ver 1.04, 15 May 83, Keith Petersen, W8SDZ ; ; Ver 1.03, 11 May 83, Keith Petersen, W8SDZ ; ; Ver 1.02, 06 May 83, Lucien Pan ; ; Ver 1.01, 30 Mar 83, W.F. Mcgee ; ; Ver 1.00, 23 Aug 82, Phil Cary ; ; BISHOW is a buffered, bidirectional version of SHOW.ASM ; which first appeared in Interface Age, November, 1981. ; ; There are several customizing items in this program. One is ; the equate "MAXSEC" which sets the buffer size. Others are ; the strings in the subroutines CSRDSB, CSRABL, and CLRSCR ; just after the ORG statement. These should be changed to ; reflect the requirements of the user's terminal. BISHOW as ; written, requires a terminal with an erase screen and home ; cursor function. Some terminals do not allow the 80th ; column to be filled without going to the next line. For ; this reason, the screen width ("MAXCHR") initially is set to ; 79. The screen sizes can be changed using the "S" (screen) ; command. The parameters that can be changed are the maximum ; column displayed ("MAXCHR"), the minimum column displayed ; (allowing you to "window" the output), and the number of ; lines ("SCROLN"). A zero for the maximum column displayed ; will give and unlimited screen width. The maximum column ; displayed and the number of lines can be set when calling ; BISHOW, e.g., "BISHOW FILE.NAM 79 24" will give 79 columns ; and 24 lines, and "BISHOW FILE.NAM 79" will give 79 columns ; with the default number of lines. ; FALSE EQU 0 TRUE EQU NOT FALSE ; ; Define version number for help message ; VERS EQU 1 ;version number REVS EQU 14 ;revision number ; ; Operational equates ; MAXSEC EQU 32 ;number of sectors in buffer SCROLN EQU 24 ;number of lines per scroll MAXCHR EQU 79 ;number of characters per line MINCHR EQU 01 ;start at char..each input line ; SCROLL EQU FALSE ;scroll when paging forward, otherwise ;__clear screen, then write page ; DELCNT EQU 8*1000 ;clear screen delay count for 8 MHz cpu ; BASE EQU 0 ;standard zero base CP/M ; ; BDOS functions ; BOOT EQU 0 ;system reset WRCON EQU 2 ;console output CONIO EQU 6 ;direct console i/o PRINT EQU 9 ;print string RDCON EQU 10 ;read console buffer OPEN EQU 15 ;open file CLOSE EQU 16 ;close file STDMA EQU 26 ;set dma address READR EQU 33 ;read file random access COMPF EQU 35 ;compute file size ; ; Page zero equates ; FCB EQU BASE+5CH ;default fcb drive number FCBFN EQU FCB+1 ;start of filename FCBFT EQU FCB+9 ;start of filetype FCBEX EQU FCB+12 ;current extent number FCBRC EQU FCB+15 ;current record count FCBCRR EQU FCB+33 ;current record number, random access CMDTAIL EQU BASE+80H ;location of command tail TPA EQU BASE+100H ;transient program area ; ; ASCII equates ; ENDMSG EQU '$' ;end of string BELL EQU 7 ;bell TAB EQU 9 ;tab LF EQU 0AH ;line feed CR EQU 0DH ;carriage return EOF EQU 1AH ;end of file ESC EQU 1BH ;escape SPACE EQU 20H ;space ; ; Brief command summary ; BACK EQU 'B' ;scroll backward FIRST EQU '1' ;first page HELPME EQU 'H' ;request HELP menu ENDFIL EQU 'L' ;go to end of file NEXT EQU CR ;next line NXTPAG EQU SPACE ;next page PREV EQU 'P' ;previous line QUIT EQU 'Q' ;exit bishow SCREEN EQU 'S' ;set screen parameters ; ORG TPA ; JMPS START ;skip over next subroutines ; ; *** Change the following routines for your hardware *** ; ; Cursor disable -- comment out string if not needed CSRDSB: CALL CDISP ; DB ESC,'n' ;IBM - disable cursor DB 0 ;endstr RET ; ; Cursor enable -- comment out string if not needed ; CSRABL: CALL CDISP DB ESC,'m' ;IBM - enable cursor DB 0 ;endstr RET ; ; Clear screen/home cursor ; CLRSCR: CALL CDISP DB ESC,'E' ;IBM - clear screen & home cursor DB 0 ;endstr ; CALL WAIT ;uncomment if needed (not needed IBM) ; IF NOT SCROLL XOR AL,AL ;not required if WAIT called MOV LINCNT,AL ;row = 0 MOV CHRCNT,AL ;column = 0 ENDIF ; RET ; ; Delay routine required by some terminals after clearing screen ; ;WAIT: MOV CX,0 ;CX = number of ms to delay ;WAIT1: MOV AX,DELCNT/21 ;patch DELCNT for cpu speed ;WAIT2: DEC AX ; JNZ WAIT2 ; LOOP WAIT1 ; RET ; ; *** End of hardware dependent routines *** ; START: MOV AX,CS ;set up 8080 model (CS=DS) MOV SS,AX MOV SP,(OFFSET STACK) ;set new stack MOV DS,AX ; CALL CSRDSB ;disable cursor MOV BX,(OFFSET CMDTAIL) ;point to command tail MOV CH,[BX] ;get number of char in tail INC BX INC CH ; EATSP: MOV AL,[BX] ;get character if there is one INC BX DEC CH ;CH=number of characters left JZ OPENF ;no more characters CMP AL,SPACE ;ignore spaces JZ EATSP ; FILNAM: MOV AL,[BX] ;get characters in file name INC BX DEC CH ;CH=number of characters left JZ OPENF ;only file name in tail CMP AL,SPACE ;wait for next space JNZ FILNAM MOV DX,(OFFSET CHRMAX) ;point to chr/line CALL GETNBR ;get number of characters/line JC HELP ;invalid number ; MOV DX,(OFFSET LINMAX) ;point to number of lines JZ L_1 CALL GETNBR ;call only if characters still ;__in command tail L_1: JC HELP ;invalid number ; ; When writing first page we need to clear the extent and record ; number in the FCB then (re)open the file so that CP/M will load ; in the proper set of allocation blocks. ; OPENF: XOR AL,AL ;get a 0 ; IF SCROLL MOV LINCNT,AL ;store in line count MOV CHRCNT,AL ;store in character count ENDIF ; MOV .FCBEX,AL ;zero current extent MOV .FCBCRR,AL ;zero current record MOV .FCBCRR+1,AL ;__both bytes MOV .FCBCRR+2,AL ;__and the overflow DEC AL ;now -1 MOV BUFNUM,AL ;set buffer number to -1 CALL OPNFIL ;open file in default fcb WRTFWX: CALL CLRSCR ;start with a clean slate WRTFW0: CALL FILBUF ;fill the disk buffer MOV BX,(OFFSET DSKBUF) ;point to beginning of buffer WRTFW1: MOV AL,[BX] CMP AL,EOF ;test for end of file JZ GETCMD ; WRTFWA: INC BX ;bump pointer AND AL,7FH ;strip high bit CMP AL,'L'-40H ;filter form-feeds JNZ NOTFF ;__commonly found in .PRN files ; FILTER: LAHF ;save status and character PUSH AX MOV AL,'^' ;print '^' in front CALL CO1 ;__of control character POP AX SAHF ;restore status and character ADD AL,40H ;mask into displayable char CALL CO1 ;display filtered control char JMPS FWDCNT ; NOTFF: CALL CO1 ;put it on console CMP AL,CR ;see if end of line JNZ WRTFW2 ; FWDCNT: MOV AL,LINCNT ;get number of lines displayed INC AL ;bump it MOV LINCNT,AL ;__and store it MOV DH,AL ;save lincnt MOV AL,LINMAX ;get max number of line CMP AL,DH ;compare with line count JZ GETCMD ;end of screen, get command ; WRTFW2: MOV DX,FULBUF ;get end of buffer address MOV AL,DH ;compare high CMP AL,BH ;__order bytes JNZ WRTFW1 ;if not equal, continue MOV AL,DL ;else compare low CMP AL,BL ;__order bytes JNZ WRTFW1 ;continue with next character JMPS WRTFW0 ;refill buffer and start over ; HELP: MOV DX,(OFFSET MSG1) ;primer on bishow operation CALL PRTSTR JMP EXIT1 ; GETCMD: PUSH CX PUSH DX PUSH BX GETCM1: CALL CKCONS ;direct console i/o JZ GETCM1 POP BX POP DX POP CX CMP AL,'a' ;change command to JC GETCM2 ;__upper case CMP AL,'z'+1 JNC GETCM2 XOR AL,20H ;is lower case, make upper case ; GETCM2: CMP AL,NXTPAG ;next page (SPACE) JZ WRTFWZ CMP AL,'F' ;F JZ WRTFWZ CMP AL,'F'-40H ;vi uses ^F JZ WRTFWZ ;... CMP AL,BACK ;previous page (B) JNZ L_2 JMP WRTBAK L_2: CMP AL,'B'-40H ;vi uses ^B JNZ L_3 JMP WRTBAK ;... L_3: CMP AL,NEXT ;next line (RETURN) JZ WRTNXT CMP AL,'N' ;N JZ WRTNXT CMP AL,'+' ;+ JZ WRTNXT ;... CMP AL,PREV ;previous line (P) JNZ L_4 JMP WRTPRV L_4: CMP AL,'-' ;- JNZ L_5 JMP WRTPRV ;... L_5: CMP AL,FIRST ;first page (1) JNZ L_6 JMP CLSOPN ;JMP BAKCHK for no close/open ; ... L_6: CMP AL,ENDFIL ;last page (L) JZ POSEND ;... CMP AL,SCREEN ;set screen parameters (S) JNZ L_7 JMP SETSCR ;... L_7: CMP AL,QUIT ;quit (Q) JNZ HELP2 JMP EXIT ;... HELP2: CALL CLRSCR ;primer on bishow commands MOV DX,(OFFSET MSG2) CALL PRTSTR JMPS GETCMD ; WRTFWZ: MOV AL,[BX] CMP AL,EOF JZ GETCMD ; WRTFWY: ; IF NOT SCROLL CALL CLRSCR ;clear screen ENDIF ; IF SCROLL XOR AL,AL ;get a zero MOV LINCNT,AL ;store in line count MOV CHRCNT,AL ;store in character count ENDIF ; MOV AL,[BX] ;get character ; IF NOT SCROLL CMP AL,LF ;is it a linefeed? JNZ L_7A INC BX ;don't print lf after clrscr MOV AL,[BX] ;get next character L_7A: ENDIF ; JMP WRTFWA ;do full page display ; WRTNXT: MOV AL,LINMAX DEC AL ;fool wrtfw1 to write MOV LINCNT,AL ;__just one line JMP WRTFW1 ; POSEND: MOV DX,(OFFSET FCB) ;find end of file MOV CL,COMPF INT 224 MOV BX,.FCBCRR ;record number MOV DX,-MAXSEC MOV CX,-1 POS2: LAHF INC CX ;count 'buffer fulls' SAHF ADD BX,DX JC POS2 MOV BX,0 MOV DX,MAXSEC POS3: MOV AL,CH ;get record number OR AL,CL ;__of last 'buffer full' JZ POS4 DEC CX ADD BX,DX JMPS POS3 ; POS4: MOV .FCBCRR,BX ;set record number CALL FILBUF ;read last 'buffer full' MOV AL,EOF ;search for eof MOV BX,(OFFSET DSKBUF-1) POS1: INC BX CMP AL,[BX] JNZ POS1 MOV AL,LINMAX ;back up one page DEC AL ;(less one line) JMPS WRTBK0 ; WRTSAM: MOV AL,LINMAX ;back up one screen JMPS WRTBK0 ; WRTPRV: MOV AL,LINMAX ;back up one screen + 1 line INC AL JMPS WRTBK0 ; WRTBAK: MOV AL,LINMAX ;get screen line count ADD AL,AL ;__multiply by 2 ; WRTBK0: INC AL ;__and add 1 MOV LINCNT,AL ;__to backup to previous page ; IF SCROLL CALL CLRSCR ;clear the screen ENDIF ; WRTBK1: MOV DX,(OFFSET DSKBUF-1) ;get addr of buffer start MOV AL,DH ;compare high CMP AL,BH ;__order bytes JNZ WRTBK2 ;continue if not equal MOV AL,DL ;else, compare low CMP AL,BL ;__order bytes JNZ WRTBK2 MOV DX,MAXSEC ;get the buffer size MOV BX,SECCNT ;get number sectors last read ADD BX,DX ;add them XCHG DX,BX ;__and put them in DX MOV BX,.FCBCRR ;subtract low order byte MOV AL,BL SUB AL,DL ;__from current record count MOV BL,AL MOV AL,BH ;same with high order byte SBB AL,DH ;__but with borrow MOV BH,AL JS BAKCHK MOV .FCBCRR,BX ;store new record count CALL FILBUF ;fill the buffer MOV BX,FULBUF-1 ;__and point to end of buffer WRTBK2: MOV AL,[BX] ;get a character AND AL,7FH ;strip high bit DEC BX ;decrement buffer CMP AL,CR ;see if end of line JZ BAKCNT ;__or form-feed CMP AL,'L'-40H ;__and adjust line count if so JNZ WRTBK1 ;else, loop if not ; BAKCNT: MOV AL,LINCNT ;else, get number of lines ;__to move back DEC AL ;__and decrement it MOV LINCNT,AL ;__store it JNZ WRTBK1 ;__and loop if not there INC BX ;bump pointer to account for dec INC BX ;__and increment to next character ; IF SCROLL MOV AL,[BX] ;get character CMP AL,LF ;is it a linefeed? JNZ L_7B ;if linefeed, then bump over it INC BX ;__so we don't print lf after clrscr L_7B: ENDIF ; MOV AL,BYTE PTR FLBF+1 ;careful not to go CMP AL,BH ;__off end of buffer JZ L_8 JMP WRTFWZ ; L_8: MOV AL,BYTE PTR FLBF CMP AL,BL JZ L_9 JMP WRTFWZ ; L_9: JMP WRTFWX ; BAKCHK: MOV BX,0 ;force record count to zero MOV .FCBCRR,BX CALL FILBUF ;fill buffer MOV BX,(OFFSET DSKBUF) ;start at beginning of buffer JMP WRTFWZ ;go fill the screen ; CLSOPN: CALL CLOSF ;close before re-open JMP OPENF ; FILBUF: MOV DX,(OFFSET DSKBUF) ;load start of disk buffer MOV CH,MAXSEC ;number of sectors to read MOV BX,0 ;zero out the MOV SECCNT,BX ;__number of sectors in buffer MOV AL,BUFNUM ;bufnum can be -1, 0, or 1 CMP AL,1 ;if 1 then don't increment JZ FILBU1 INC AL ;else increment & use as a flag MOV BUFNUM,AL ;to determine whether to reread ; FILBU1: PUSH CX ;save all registers PUSH DX ;__from bdos clobber PUSH BX MOV CL,STDMA ;set dma to INT 224 ;__disk buffer MOV DX,(OFFSET FCB) ;set up to read MOV CL,READR ;__a record INT 224 ;do it LAHF ;save return info PUSH AX MOV BX,.FCBCRR ;get current record number INC BX MOV .FCBCRR,BX ;__and save it MOV BX,SECCNT ;get sectors in buffer INC BX MOV SECCNT,BX ;store it POP AX SAHF ;restore...result of read POP BX ;...and POP DX ;......all POP CX ;.........registers OR AL,AL ;read OK? JNZ RDERR DEC CH ;decrement it JNZ L_10 RET ;if done return ; L_10: MOV BX,128 ;else, add 128 to ADD BX,DX ;__dma address XCHG DX,BX ;put it in DX JMPS FILBU1 ;read another sector ; ; We only get here if end of file ; RDERR: MOV AL,EOF ;get bogus eof MOV SI,DX ;save buffer at end MOV [SI],AL ;__in case no eof in file XOR AL,AL ;get a zero to direct to start RET ;__of buffer on ret ; OPNFIL: MOV AL,.FCBFN ;point to filename CMP AL,SPACE ;anything there? JNZ L_11 JMP HELP ;no, give help message ; L_11: MOV DX,(OFFSET FCB) ;file name in default fcb MOV CL,OPEN ;set up to open INT 224 ;do it INC AL ;open OK? JZ L_12 RET ;yes ; L_12: MOV DX,(OFFSET MSG3) ;else, give error msg and quit CALL PRTSTR JMP EXIT1 ;leave msg on screen on exit ; GETNBR: MOV AL,[BX] ;get first digit INC BX DEC CH ;CH=number chars left in buffer JNZ L_13 RET ;no digit ; L_13: CMP AL,SPACE JZ GETNBR ;wait until next non-space PUSH DX ;save location to save number MOV DH,0 ;initialize number GNUM1: SUB AL,30H ;change ASCII to number JC INVNUM ;not a number CMP AL,10 CMC JC INVNUM ;not a number LAHF ;save number PUSH AX MOV AL,DH ;multiply old number by 10 ADD AL,AL ;*2 ADD AL,AL ;*4 ADD AL,DH ;*5 ADD AL,AL ;*10 MOV DH,AL POP AX SAHF ;restore new digit ADD AL,DH MOV DH,AL MOV AL,[BX] ;get next digit INC BX DEC CH JZ ENDNUM CMP AL,SPACE JNZ GNUM1 ; ENDNUM: MOV AL,DH ;save number XCHG DX,BX ;set to restore save location POP BX ;restore save location MOV [BX],AL ;save digit XCHG DX,BX ;put buffer locn where it belongs MOV AL,CH ;see if any chars left in buffer OR AL,AL ;zero if no characters in buffer RET ; INVNUM: POP DX ;correct stack RET ; ASCIIN: MOV CH,100 ;divide by 100, change CALL DIVIDE ;__to ASCII, store at BX MOV CH,10 ;divide by 10, change CALL DIVIDE ;__to ASCII, store at BX+1 MOV CH,30H ;change ones place number ADD AL,CH ;__to ASCII and store at BX+2 MOV [BX],AL DEC BX ;delete leading zeroes DEC BX ;__in the number MOV CL,SPACE ;__and replace with spaces MOV AL,CH CMP AL,[BX] ;check first digit for '0' JZ L_14 JMP CDISP ;not zero ; L_14: MOV [BX],CL ;replace with space INC BX CMP AL,[BX] ;check second digit for '0' JZ L_15 JMP CDISP ;not zero ; L_15: MOV [BX],CL ;replace with space JMP CDISP ; SETSCR: PUSH BX PUSH DX PUSH CX CALL CSRABL ;enable cursor GETMAX: MOV AL,CHRMAX ;get max number characters MOV BX,(OFFSET HUNS) CALL ASCIIN ;put ASCII number in message DB CR,LF,'Maximum Column: ' HUNS DB '000 New? ',0 CALL GETINP ;read input from console MOV DX,(OFFSET CHRMAX) ;set new chrmax in memory CALL GETNBR JC GETMAX ;if error, repeat last message GETMIN: MOV AL,CHRMIN ;get minimum character display INC AL ;bump it MOV CHRMIN,AL ;save..later gets decremented MOV BX,(OFFSET HUN) CALL ASCIIN ;put ASCII number in message DB LF,'Minimum Column: ' HUN DB '000 New? ',0 CALL GETINP ;read input from console MOV DX,(OFFSET CHRMIN) ;set new chrmin in memory CALL GETNBR JC GETMIN ;if error, repeat last message MOV AL,CHRMIN ;get minimum column DEC AL ;decrement MOV CHRMIN,AL ;store corrected value GETLIN: MOV AL,LINMAX ;get nmbr lines per display MOV BX,(OFFSET HUND) CALL ASCIIN ;put ASCII number in message DB LF,'Lines Displayed: ' HUND DB '000 New? ',0 CALL GETINP ;read input from console MOV DX,(OFFSET LINMAX) ;set new linmax in memory CALL GETNBR JC GETLIN ;if error, repeat last message CALL CSRDSB ;disable cursor POP CX POP DX POP BX JMP WRTSAM ;write the same screen ; GETINP: MOV AL,5 ;get set to read new max column MOV .CMDTAIL,AL MOV CL,RDCON ;read console buffer MOV DX,(OFFSET CMDTAIL) INT 224 ;get maximum column MOV BX,(OFFSET CMDTAIL+1) ;now, change to ASCII MOV CH,[BX] INC BX INC CH RET ;return with input in buffer ; DIVIDE: MOV CL,'0'-1 ;extract dividend of A div C ; DIV1: INC CL ;store in location pointed SUB AL,CH ;__to by BX JNC DIV1 ADD AL,CH MOV [BX],CL ;save ASCII digit INC BX ;bump pointer to next location RET ; CDISP: POP SI ;exchange top of stack and BX PUSH BX MOV BX,SI ; CDIS1: MOV AL,[BX] ;BX now pointing to db message OR AL,AL ;see if 0 at end of message LAHF INC BX SAHF JZ CDIS2 ;yes, restore stack and return CALL CO ;no, print the character JMPS CDIS1 ;__and loop ; CDIS2: POP SI ;get return addr on stack PUSH BX MOV BX,SI RET ;__and return ; CO: PUSH CX ;save the registers PUSH DX ;__from bdos clobber PUSH BX LAHF PUSH AX CMP AL,'O'-40H ;wordstar uses ^O JNZ L_16 ;as non-break space MOV AL,' ' ;__so substitute space L_16: MOV DL,AL ;set up character MOV CL,WRCON ;__to send to console INT 224 ;do it POP AX SAHF POP BX ;restore the registers POP DX POP CX RET ; CO1: PUSH DX ;save the registers PUSH BX MOV DL,AL ;save AL reg MOV BX,(OFFSET CHRCNT) ;get address of char cnt CMP AL,CR ;see if end of line JNZ NOTCR MOV (BYTE PTR [BX]),0 ;reset character count JMPS CO6 NOTCR: CMP AL,LF ;print linefeed JZ CO6 ;but don't count it CMP AL,TAB ;fix chrcnt for tabs JNZ NOTTAB TAB1: MOV AL,SPACE ;expand tab CALL CO1 MOV AL,[BX] ;character count AND AL,7 ;multiple of 8? JNZ TAB1 ;print more spaces JMPS CO5 ; NOTTAB: INC (BYTE PTR [BX]) ;increment character count MOV AL,CHRMAX ;get max chars per line CMP AL,[BX] ;see if too many char JC CO5 ;don't print character MOV AL,CHRMIN ;up to min display yet? CMP AL,[BX] JNC CO5 ;display character CO6: MOV AL,DL CALL CO CO5: MOV AL,DL POP BX ;restore the registers POP DX RET ; CLOSF: MOV DX,(OFFSET FCB) ;close file MOV CL,CLOSE ;__in case this is MP/M INT 224 RET ; CKCONS: MOV DL,0FFH ;clear console of characters MOV CL,CONIO ;direct console i/o INT 224 ;get any waiting characters OR AL,AL ;set for status or character RET ;zero = no character waiting ;__on return ; PRTSTR: PUSH CX ;print message pointed to by DX PUSH BX MOV CL,PRINT ;print string INT 224 POP BX POP CX RET ; EXIT: CALL CLOSF ;close the file CLCON: CALL CKCONS ;clear ALL waiting characters JNZ CLCON ;loop till no more characters CALL CLRSCR ;clear the screen EXIT1: CALL CSRABL ;enable the cursor ; MOV CL,BOOT ;system reset MOV DL,0 ;return to ccp INT 224 ; ; Data area ; MSG1 DB CR,LF,' BISHOW Version ' DB (VERS MOD 10)+'0','.' DB REVS/10+'0',(REVS MOD 10)+'0',CR,LF DB CR,LF,' Syntax: BS [d:]filename.ext [cols [lines]]',BELL,CR,LF DB ENDMSG ; MSG2 DB CR,LF,LF,LF,LF DB 'COMMANDS: Next Page = SP,F,^F',CR,LF DB ' Back Page = B,^B',CR,LF DB ' Next Line = CR,N,+',CR,LF DB ' Back Line = P,-',CR,LF DB ' First Page = 1',CR,LF DB ' Last Page = L',CR,LF DB ' Quit = Q',CR,LF DB ' Set Screen = S',CR,LF DB ' Help = H',CR,LF DB ENDMSG ; MSG3 DB CR,LF,' File not found.',BELL,CR,LF,ENDMSG ; FLBF DW FULBUF SECCNT DW 0 ;number of sectors in buffer LINMAX DB SCROLN ;number lines to write on console CHRMAX DB MAXCHR ;number chars to display/line CHRMIN DB MINCHR-1 ;character to start on line CHRCNT RB 1 ;character number in line LINCNT RB 1 ;line number on write BUFNUM RB 1 ;flag for first buffer check ; ; Stack area ; RB 64 STACK RB 1 ; ; Buffer area ; DSKBUF EQU $ ;disk buffer area FULBUF EQU (OFFSET DSKBUF)+(MAXSEC*128) ;need to know end of buffer ; END