home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-13 | 22.6 KB | 1,038 lines |
- ; ZCPR3 Z3TCAP (MYTERM.Z3T) file to source code (MYTERM.Z80) generator
- ; Program Name: TCSRC.Z80
- ; Author: Terry Hazen
- ; Version: 1.3
- ; Date: 24 August 90
-
- ; Takes specified Z3TCAP (MYTERM.Z3T) file and creates commented
- ; source code (MYTERM.Z80) file for editing or customizing.
-
- VERS EQU 14 ; 24 August 90 jth
-
- ; Revised to change the command interface and the name of the default
- ; environmental TCAP file from Z3ENV.Z80 to Z3TCAP.Z80 to be
- ; compatible with ENVSRC.COM. Documentation now correctly describes
- ; the RC function.
-
- ; vers equ 13 ; 07 May 90 jth
- ; Revised to add ability to create blank source code file when infile
- ; is specified as BLANK.
-
- ; vers equ 12 ; 05 Feb 90 jth
- ; Revised to reflect changes in control string locations in VLIB4D,
- ; including replacing the last byte of the name string (now reduced to
- ; 13 bytes) by GOFF, the offset from the start of the Z3TCAP to the
- ; start of the graphics area at GOELD. Also added the ability to
- ; generate source code from current the Z3TCAP in the environment by
- ; specifying 'Z3ENV' as the infile.
-
- ; vers equ 11 ; 26 Jan 90 jth
- ; Rewritten to do translation and loading in loops. Fixed missing
- ; putud in help requests. Added outfile specification, graphics
- ; support per VLIB4C. Unless otherwise specified, the default
- ; outfile (INFILE.Z80) is now placed in the default directory.
-
- ; vers equ 10 ; 12 Jan 90 jth
- ; Original release.
-
- ;
- ; Basic equates
- ;
- FCB EQU 5CH
- FCB2 EQU 6CH
- TBUFF EQU 80H
- CTRLC EQU 'C'-'@'
- ;
- ; ASCII character equates
- ;
- NULL EQU 0 ; Null
- BEL EQU 7 ; Bell
- BS EQU 8 ; Backspace
- TAB EQU 9 ; Tab
- LF EQU 10 ; Line feed
- CR EQU 13 ; Carriage return
- EOF EQU 1AH ; EOF
- SPACE EQU 32 ; Space
- ESC EQU 27 ; Escape
- ;
- ; Z3LIB and SYSLIB references
- ;
- .REQUEST Z3LIB
- EXT Z3LOG
-
- .REQUEST SYSLIB
- EXT CODEND,RETUD,COMPB,FILLB
- EXT MAFDC,MA2HC,PFN2,PRINT,COUT
- EXT GFA,F$OPEN,F$MAKE,F$READ,F$WRITE
- EXT F$CLOSE,F$EXIST,F$DELETE
-
- ;
- ; Program start
- ;
- JP START
- DB 'Z3ENV' ; This is a ZCPR3 Utility
- DB 1 ; External environmental descriptor
- Z3EADR: DW 0
- ;
- START: LD (STACK),SP ; Save CCP stack pointer
- LD SP,STACK ; Local stack
- LD HL,EXIT ; Save exit routine address
- PUSH HL ; On the new stack
- ;
- ; Start of program -- display sign-on
- ;
- CALL PRINT
- DB 'TCSRC vers '
- DB (VERS/10)+'0','.',(VERS MOD 10)+'0',CR,LF
- DB 'Creates a commented source code [.Z80] file',CR,LF
- DB 'from the ZCPR3 environment or from '
- DB 'a Z3TCAP[.Z3T] file.',CR,LF
- DB 0
- ;
- ; Check for entry in FCB
- ;
- LD HL,FCB+1 ; Point to first character
- LD A,'/'
- CP (HL) ; Help request?
- JP NZ,INIT ; No
- INC HL ; Point to next
- CP (HL) ; Help request?
- JP NZ,INIT ; No, continue
- ;
- ; Display help screen
- ;
- HELP: CALL PRINT
- DB CR,LF
- DB 'Syntax:',TAB,'TCSRC '
- DB '[[dir:]infile[.Z3T]] [[dir:]outfile[.z80]]'
- DB CR,LF,LF
- DB TAB,'Default outfile name is infile.Z80.'
- DB CR,LF
- DB TAB,'Infile ''BLANK'' creates blank commented source code.'
- DB CR,LF
- DB TAB,'If no infile is specified, Z3TCAP.Z80 is created '
- DB CR,LF
- DB TAB,TAB,'from the environment.'
- DB CR,LF
- DB 0
- RET
- ;
- ; Initialize data area
- ;
- INIT: XOR A
- LD HL,DATA
- LD B,DATALEN
- CALL FILLB
- ;
- ; Set default infile file type if none
- ;
- LD DE,FCB+9 ; Point to file type
- LD A,(DE) ; Get first character
- CP ' ' ; None if space
- JR NZ,LOAD1
- ;
- LD HL,INTYP ; Point to default file type
- LD BC,3 ; File type length
- LDIR ; Otherwise set default filetype
- ;
- ; Check if infile specified
- ;
- LOAD1: LD A,(FCB+1) ; Get first infile byte
- CP ' ' ; Anything?
- JR NZ,LOAD2 ; File specified, so continue
- ;
- LD HL,Z3TNAME ; Point to default infile
- LD DE,FCB+1 ; Move it to infile FCB
- LD BC,8
- LDIR
- ;
- ; Move default outfile FCB to OUTFCB
- ;
- LOAD2: LD HL,FCB2 ; Point to second FCB
- LD DE,OUTFCB ; Point to outfile FCB
- PUSH DE ; Save a copy
- LD BC,14 ; Move drive thru user bytes
- LDIR
- ;
- POP DE ; Restore OUTFCB pointer
- LD A,(DE) ; Get drive
- OR A ; Was it the default drive?
- JR NZ,LOAD3 ; Drive was specified
- ;
- CALL RETUD ; Default, so get default du in BC
- LD A,B
- INC A ; Make it A=1
- LD (OUTFCB),A ; Save as default outfile drive
- ;
- LOAD3: LD A,(DE) ; Save outfile drive for PDU routine
- LD (OUTDR),A
- ;
- INC DE ; Point to filename
- LD A,(DE) ; Do we have an outfile name specified?
- CP ' '
- JR NZ,LOAD4 ; Yes
- ;
- ; No outfile filename specified, use infile filename
- ;
- LD HL,FCB+1 ; Point to infile filename
- LD BC,8 ; Copy it to outfile filename
- LDIR ; Move it
- ;
- ; Set default outfile file type if none
- ;
- LOAD4: LD DE,OUTFCB+9
- LD A,(DE) ; Filetype specified?
- CP ' '
- JR NZ,LOAD5 ; Yes
- ;
- LD HL,OUTTYP ; Point to default file type
- LD BC,3 ; Copy default file type
- LDIR
- ;
- ; Check if infile = 'BLANK'
- ;
- LOAD5: LD HL,FCB+1
- LD DE,BLANK ; Point to 'BLANK '
- LD B,8
- CALL COMPB
- JR NZ,LOAD6 ; Not blank, so continue
- ;
- LD HL,NEWTCP ; Point to blank Z3TCAP area
- LD A,SPACE ; Pad name area with spaces
- LD B,13
- CALL FILLB
- ;
- PUSH HL ; Save pointer
- LD HL,NEWTCP+14 ; Point to B14
- LD A,80H ; Make it an extended Z3TCAP
- LD (HL),A
- POP HL ; Restore pointer
- JR SAVETCP
- ;
- ; Check for input file 'Z3TCAP'
- ;
- LOAD6: LD HL,FCB+1
- LD DE,Z3TNAME ; Point to 'Z3TCAP '
- LD B,8
- CALL COMPB
- JR NZ,LOAD7 ; Not Z3TCAP, so continue
- ;
- LD HL,(Z3EADR) ; Get Z3ENV address
- LD DE,80h ; Offset to Z3TCAP
- ADD HL,DE
- ;
- SAVETCP:LD (TCPTR),HL ; Save pointer
- JR MAIN0 ; And continue
- ;
- ; Look for Z3T file
- ;
- LOAD7: LD DE,FCB ; Point to FCB
- CALL Z3LOG ; Log into DU
- CALL F$EXIST ; Look for file
- JR NZ,INREAD ; File found
- ;
- ; Z3T file not found
- ;
- FNFERR: CALL PRINT
- DB CR,LF,'File ',0
- LD DE,FCB+1 ; Print file name
- CALL PFN2
- CALL PRINT
- DB ' Not Found',CR,LF,0
- RET
- ;
- ; Read Z3T file
- ;
- INREAD: CALL F$OPEN ; Open file
- JR NZ,FNFERR
- CALL F$READ ; Read file into TBUFF
- JR Z,MAIN ; Read without error
- CALL F$CLOSE ; Close file
- ;
- ; Error in reading file
- ;
- RERR: POP AF ; Clear stack
- CALL PRINT
- DB CR,LF,'File Read Error',CR,LF,0
- RET
- ;
- ; Now make source code file
- ;
- MAIN: LD HL,TBUFF ; Set pointer to Z3TCAP
- LD (TCPTR),HL
- ;
- MAIN0: CALL CODEND ; Point to start of source file buffer
- LD (OUTFILE),HL ; Save pointer
- ;
- ; Move terminal name
- ;
- LD HL,(TCPTR) ; Get Z3TCAP pointer
- LD DE,Z3TERM ; Point to TERMNAME in source code file
- LD BC,13 ; Length of name
- LDIR ; Move it
- ;
- ; Load terminal configuration bytes.
- ;
- INC HL ; Point to B14
- LD DE,B14 ; Point to B14 in text
- CALL LDBIN ; Load it in ASCII binary form
- LD DE,B15 ; Point to B15 in text
- CALL LDBIN ; Load it in ASCII binary form
- PUSH HL ; Save Z3T pointer on stack
- ;
- ; Translate terminal control strings into ASCII and load them
- ; to file buffer.
- ;
- LD HL,FILESTART ; HL=text pointer
- LD DE,(OUTFILE) ; DE=file buffer pointer
- CALL LOAD ; Load text to buffer
- ;
- ; Move outfile filename
- ;
- ;;;;;
- LD HL,OUTFCB+1 ; Point to filename
- LD B,8 ; Eight characters max
- CALL FNLOOP ; Move filename
- LD A,'.' ; Separator
- LD (DE),A ; Move it
- INC DE ; Bump pointer
- LD HL,OUTFCB+9 ; Point to filetype
- LD B,3 ; Three characters max
- CALL FNLOOP ; Move filetype
- ;
- LD HL,TNAME ; HL=text pointer
- CALL LOAD ; Load it
- ;
- ; Load arrow key characters
- ;
- LD B,4 ; 4 arrow keys
- CALL CLOAD
- ;
- ; Load delays
- ;
- LD B,3 ; 3 delays
- CALL DLOAD
- ;
- ; Load terminal control strings
- ;
- LD B,14 ; 14 strings
- CALL TCLOAD
- ;
- ; Load graphics delay
- ;
- LD B,1
- CALL DLOAD
- ;
- ; Load terminal control strings
- ;
- LD B,4 ; 4 strings
- CALL TCLOAD
- ;
- ; Load graphics characters
- ;
- LD B,13 ; 13 characters
- CALL CLOAD
- ;
- ; Pad end of file with EOF's
- ;
- LD A,EOF ; EOF character
- LD B,128 ; At least a record's worth
- EX DE,HL ; HL=destination pointer
- CALL FILLB
- ;
- POP HL ; Restore stack pointer
- ;
- ; Create target file
- ;
- MAKE0: LD DE,OUTFCB ; Point to FCB
- CALL Z3LOG
- CALL F$EXIST ; Test of presence of file
- JR Z,MAKE2 ; Create file
- ;
- CALL GFA ; Check attributes of existing file
- AND 1 ; R/O?
- JR Z,MAKE1 ; No
- ;
- CALL PRINT
- DB CR,LF,'Existing File ',0
- CALL PDU ; Display du
- LD DE,OUTFCB+1
- CALL PFN2 ; Display filename
- CALL PRINT
- DB ' is Read/Only',CR,LF,0
- RET
- ;
- MAKE1: CALL F$DELETE ; Delete file
- ;
- MAKE2: CALL F$MAKE ; Create file
- CP 0FFH ; Error
- JR NZ,WRITEFILE
- ;
- CALL PRINT
- DB CR,LF,'File Create Error',CR,LF,0
- RET
- ;
- ; Write block to file
- ;
- WRITEFILE:
- LD HL,(OUTFILE) ; Point to file buffer
- ;
- WRITEF: LD DE,TBUFF ; Copy into buffer
- LD BC,128 ; 128 bytes
- LDIR
- ;
- LD DE,OUTFCB ; Point to FCB
- CALL F$WRITE ; Write record
- JR NZ,WERR
- ;
- PUSH HL ; Save file pointer
- LD HL,TBUFF ; Check TBUFF for EOF marker
- LD BC,128
- LD A,1AH ; EOF marker
- CPIR
- POP HL ; Restore file pointer
- JR NZ,WRITEF ; Loop till EOF
- ;
- CALL F$CLOSE ; Close file
- CALL PRINT
- DB CR,LF,'File ',0
- CALL PDU ; Display du
- LD DE,OUTFCB+1
- CALL PFN2 ; Display filename
- CALL PRINT
- DB ' Created',CR,LF,0
- RET
- ;
- ; Can't write file
- ;
- WERR: CALL PRINT
- DB CR,LF,'File Write Error',CR,LF,0
- RET
- ;
- ; Main exit point
- ;
- EXIT: LD SP,(STACK) ; Restore CCP stack
- RET ; And return to system
-
- ;-------------------------------
- ;
- ; Load terminal configuration byte As ASCII binary bits
- ;
- LDBIN: LD B,8 ; Do whole byte
- LD A,(HL) ; Get byte
- INC HL ; Point to next
- ;
- LDBLOOP:RLC A ; Look at next highest bit
- PUSH AF
- AND 1 ; Just next bit
- ADD '0' ; Make ASCII
- LD (DE),A ; Load it
- INC DE ; Bump destination pointer
- POP AF
- DJNZ LDBLOOP
- RET
-
- ;-------------------------------
- ;
- ; Load terminal control string
- ; Entry: HL to source, DE points to destination
- ;
- LDSTR: LD C,0 ; Initialize comment counter
- LD A,(HL) ; Get character
- OR A ; String present?
- JR NZ,QFRST ; Yes
- ;
- INC HL ; No, bump pointer and quit
- RET
- ;
- QFRST: XOR A ; Reset quote flag
- LD (QF),A
- ;
- LSLOOP: LD A,(HL) ; Get character
- INC HL ; Bump source pointer
- OR A ; End of string?
- JR NZ,LDS0 ; Not yet
- ;
- LD A,(QF) ; Check quote flag
- OR A
- JP NZ,QCOMMA ; Add quote, comma and quit
- RET ; Not in quotes
- ;
- LDS0: CP SPACE ; Control character?
- JR C,LDS1 ; Yes
- ;
- BIT 7,A ; 80H or greater?
- JR Z,LDSD0 ; No
- PUSH AF ; Save character
- LD A,(QF)
- OR A
- CALL NZ,QCOMMA ; Add quote and comma
- ;
- POP AF
- CALL MA2HC
- LD A,'H'
- LD (DE),A
- INC DE ; Bump destination pointer
- INC C ; Increment counter
- CALL COMMA
- JR QFRST ; Do next
- ;
- LDSD0: PUSH AF ; Save character
- LD A,(QF) ; Check quote flag
- OR A
- JR NZ,LDSD1 ; In quotes already
- ;
- CALL QUOTE ; Add quote
- LD A,0FFH ; And set flag
- LD (QF),A
- ;
- LDSD1: POP AF ; Restore character
- LD (DE),A ; Displayable, so load it
- INC DE ; Bump destination pointer
- INC C ; Increment counter
- JR LSLOOP ; And do next
- ;
- ; Load escape string
- ;
- LDS1: CP ESC ; Escape?
- JR NZ,LDS2 ; No
- LD A,(QF) ; Check quote flag
- OR A
- CALL NZ,QCOMMA ; Add end quote and comma
- ;
- PUSH HL ; Save source pointer
- PUSH BC
- LD HL,ESCSTR ; Load escape string
- LD BC,ESCLEN
- LDIR
- POP BC
- POP HL
- ;
- LD A,ESCLEN ; Account for string length
- ADD C
- LD C,A
- JR QFRST ; Reset quote flag and do next
- ;
- ; Load control character
- ;
- LDS2: PUSH AF ; Save character
- LD A,(QF)
- OR A
- CALL NZ,QCOMMA ; In quotes, end with quote and comma
- ;
- POP AF
- CALL LDCC ; Load control character
- CALL COMMA
- JR QFRST ; Reset quote flag and do next
-
- ;-------------------------------
- ;
- ; Load single character, with control (-40H) or hex (+80H) notation
- ; if required.
- ; Entry: DE points to destination, HL to source
- ;
- LDCHR: LD C,0 ; Initialize comment counter
- LD A,(HL) ; Get character
- INC HL ; Point to next
- OR A ; Character present?
- JR NZ,LDC0 ; Yes
- ;
- ZERO: LD A,'0' ; Load an ASCII zero
- LD (DE),A
- INC DE ; Bump destination pointer
- INC C ; Increment counter
- RET
- ;
- LDC0: CP SPACE ; Control character?
- JR C,LDCC ; Yes, load it
- ;
- PUSH AF ; Save character
- AND 7FH ; Filter possible high bit
- CALL QUOTECQ ; Load quoted character
- POP AF ; Get character back
- BIT 7,A ; 80H or greater?
- RET Z ; Quit if not
- ;
- PUSH HL
- PUSH BC
- LD HL,HISTR ; Point to high character string
- LD BC,HILEN ; Length of high character string
- LDIR
- POP BC
- POP HL
- ;
- LD A,HILEN ; Account for string length
- ADD C
- LD C,A
- RET
- ;
- LDCC: ADD '@' ; Make character ASCII
- CALL QUOTECQ ; Load quoted character
- ;
- PUSH HL
- PUSH BC
- LD HL,CTRLSTR ; Point to control character string
- LD BC,CCLEN ; Length of control character string
- LDIR
- POP BC
- POP HL
- ;
- LD A,CCLEN ; Account for string length
- ADD C
- LD C,A
- RET
-
- ;-------------------------------
- ;
- ; Load quote and comma
- ;
- QCOMMA: CALL QUOTE ; Load quote and fall thru
- ;
- ; Load comma
- ;
- COMMA: PUSH AF ; Save character
- LD A,',' ; Load comma
- JR QUOTE0
- ;
- ; Load quote, character, quote
- ;
- QUOTECQ:
- CALL QUOTE ; Load leading quote
- LD (DE),A ; Load character
- INC DE ; Bump dest pointer and fall thru
- INC C ; Increment counter
- ;
- ; Load quote
- ;
- QUOTE: PUSH AF ; Save character
- LD A,'''' ; Load quote
- ;
- QUOTE0: LD (DE),A
- INC DE ; Bump destination pointer
- INC C ; Increment counter
- POP AF
- RET
-
- ;-------------------------------
- ;
- ; Load number of characters in B
- ;
- CLOAD: POP IX ; Save return address
- ;
- CLOOP: EX (SP),HL ; HL=Z3T pointer
- CALL LDCHR ; Load it
- EX (SP),HL ; HL=text pointer
- CALL LOAD ; Load text
- DJNZ CLOOP
- JP (IX) ; Return
-
- ;-------------------------------
- ;
- ; Load number of delays in B
- ;
- DLOAD: POP IX ; Save return address
- ;
- DLOOP: EX (SP),HL ; HL=Z3T pointer
- LD A,(HL) ; Get it
- INC HL ; Point to next
- CALL MAFDC ; Load delay
- EX (SP),HL ; HL=text pointer
- CALL LOAD ; Load text
- DJNZ DLOOP
- JP (IX) ; Return
-
- ;-------------------------------
- ;
- ; Load number of terminal control strings in B
- ;
- TCLOAD: POP IX ; Save return address
- ;
- TCLOOP: EX (SP),HL ; HL=Z3T pointer
- CALL LDSTR ; Load it
- EX (SP),HL ; HL=text pointer
- PUSH HL ; Save it
- PUSH BC ; Save counter
- LD HL,TERM ; Load string termination
- LD BC,TERMLEN
- LDIR
- POP BC
- LD A,TERMLEN ; Account for string length
- ADD C
- LD C,A
- CALL FORM ; Space out comments
- POP HL ; HL=text pointer
- CALL LOAD ; Load text
- DJNZ TCLOOP
- JP (IX) ; Return
-
- ;-------------------------------
- ;
- ; Add spaces to place comments at or after line 33
- ;
- FORM: LD A,16 ; Set limit
- SUB C ; How many spaces to go?
- RET Z ; Ok if exactly 16
- RET C ; None, ok
- ;
- PUSH BC ; Save B
- LD B,A ; Count in B
- LD A,SPACE
- ;
- FLOOP: LD (DE),A ; Space out comments to line 33
- INC DE
- DJNZ FLOOP
- POP BC
- RET
-
- ;-------------------------------
- ;
- ; Move 0-terminated file text to file buffer
- ;
- LOAD: LD A,(HL) ; Get character
- INC HL ; Point to next
- OR A ; Check for end
- RET Z ; Yes, quit
- ;
- LD (DE),A ; Move character
- INC DE ; Bump pointer
- JR LOAD
-
- ;-------------------------------
- ;
- ; Move filename and filetype to buffer
- ;
- FNLOOP: LD A,(HL) ; Get a character
- INC HL
- CP ' ' ; Quit at first space
- RET Z ; Finished
- LD (DE),A ; Put it away
- INC DE ; Point to next
- DJNZ FNLOOP
- RET
-
- ;-------------------------------
- ;
- ; Display outfile drive and user
- ;
- PDU: LD A,(OUTDR) ; Get drive (A=1)
- ADD '@' ; Make it ASCII
- CALL COUT ; Display it
- LD A,(OUTFCB+13) ; Get user
- AND 7FH ; Filter high bit
- LD B,'0'-1 ; Set counter
- CP 10 ; Single digit?
- JR C,PDU1 ; Yes
- ;
- PDU0: INC B
- SUB 10 ; Keep subtracting until CARRY set
- JR NC,PDU0
- ;
- ADD A,10 ; Get remaining units digit back
- LD C,A ; Save it
- LD A,B ; Tens digit
- CALL COUT ; Display it
- LD A,C ; Restore units digit
- ;
- PDU1: ADD A,'0' ; Make ASCII
- CALL COUT
- LD A,':'
- CALL COUT
- RET
-
- ;-------------------------------
- ;
- ; Source code file
- ;
- FILESTART:
- DB ';',CR,LF
- DB '; Z3TCAP file: ',0
- ;
- TNAME: DB CR,LF,';',CR,LF
- DB 'ESC',TAB,'EQU',TAB,'27',TAB,TAB,'; Escape character'
- DB CR,LF
- DB ';',CR,LF
- DB '; The first character in the terminal name must not be '
- DB 'a space. For',CR,LF
- DB '; Z3TCAP.TCP library purposes only, the name terminates '
- DB 'with a space',CR,LF
- DB '; and must be unique in the first eight characters.',CR,LF
- DB ';',CR,LF
- DB 'TNAME:',TAB,'DB',TAB,''''
- ;
- Z3TERM: DB ' ' ; Break it so FILT won't insert TABs
- DB ' '
- DB ' ''',TAB,'; Name of terminal (13 chars)',CR,LF
- DB ';',CR,LF
- DB 'GOFF:',TAB,'DB',TAB
- ;
- B13: DB 'GOELD-TNAME',TAB,'; Graphics offset from Z3TCAP start'
- DB CR,LF
- DB ';',CR,LF
- DB '; Terminal configuration bytes B14 and B15 are defined '
- DB 'and bits assigned',CR,LF
- DB '; as follows. The remaining bits are not currently '
- DB 'assigned. Set these',CR,LF
- DB '; bits according to your terminal configuration.',CR,LF
- DB ';',CR,LF
- DB ';',TAB,'B14 b7: Z3TCAP Type.... '
- DB '0 = Standard TCAP 1 = Extended TCAP',CR,LF
- DB ';',CR,LF
- DB ';',TAB,'bit:',TAB,'76543210',CR,LF
- DB 'B14:',TAB,'DB',TAB
- ;
- B14: DB '00000000B',TAB,'; Configuration '
- DB 'byte B14',CR,LF
- DB ';',CR,LF
- DB ';',TAB,'B15 b0: Standout....... '
- DB '0 = Half-Intensity 1 = Reverse Video',CR,LF
- DB ';',TAB,'B15 b1: Power Up Delay. '
- DB '0 = None 1 = Ten-second delay',CR,LF
- DB ';',TAB,'B15 b2: No Auto Wrap... '
- DB '0 = Auto Wrap 1 = No Auto Wrap',CR,LF
- DB ';',TAB,'B15 b3: No Auto Scroll. '
- DB '0 = Auto Scroll 1 = No Auto Scroll',CR,LF
- DB ';',TAB,'B15 b4: ANSI........... '
- DB '0 = ASCII 1 = ANSI',CR,LF
- DB ';',CR,LF
- DB ';',TAB,'bit:',TAB,'76543210',CR,LF
- DB 'B15:',TAB,'DB',TAB
- ;
- B15: DB '00000000B',TAB,'; Configuration '
- DB 'byte B15',CR,LF
- DB ';',CR,LF
- DB '; Single character arrow keys or WordStar diamond'
- DB CR,LF
- DB ';',CR,LF
- DB TAB,'DB',TAB,0
- ;
- CUP0: DB TAB,TAB,'; Cursor up'
- DB CR,LF
- DB TAB,'DB',TAB,0
- ;
- CDN0: DB TAB,TAB,'; Cursor down'
- DB CR,LF
- DB TAB,'DB',TAB,0
- ;
- CRT0: DB TAB,TAB,'; Cursor right'
- DB CR,LF
- DB TAB,'DB',TAB,0
- ;
- CLF0: DB TAB,TAB,'; Cursor left'
- DB CR,LF
- DB ';',CR,LF
- DB '; Delays (in ms) after sending terminal control strings'
- DB CR,LF
- DB ';',CR,LF
- DB TAB,'DB',TAB
- DB 0
- ;
- CLD: DB TAB,TAB,'; CL delay',CR,LF
- DB TAB,'DB',TAB
- DB 0
- ;
- CMD: DB TAB,TAB,'; CM delay',CR,LF
- DB TAB,'DB',TAB
- DB 0
- ;
- CED: DB TAB,TAB,'; CE delay',CR,LF
- DB ';',CR,LF
- DB '; Strings start here',CR,LF
- DB ';',CR,LF
- DB 'CL:',TAB,'DB',TAB
- DB 0
- ;
- CL0: DB '; Home cursor and clear screen',CR,LF
- DB 'CM:',TAB,'DB',TAB
- DB 0
- ;
- CM0: DB '; Cursor motion macro',CR,LF
- DB 'CE:',TAB,'DB',TAB
- DB 0
- ;
- CE0: DB '; Erase from cursor to end-of-line',CR,LF
- DB 'SO:',TAB,'DB',TAB
- DB 0
- ;
- SO0: DB '; Start standout mode',CR,LF
- DB 'SE:',TAB,'DB',TAB
- DB 0
- ;
- SE0: DB '; End standout mode',CR,LF
- DB 'TI:',TAB,'DB',TAB
- DB 0
- ;
- TI0: DB '; Terminal initialization',CR,LF
- DB 'TE:',TAB,'DB',TAB
- DB 0
- ;
- TE0: DB '; Terminal deinitialization',CR,LF
- DB ';',CR,LF
- DB '; Extensions to standard Z3TCAP',CR,LF
- DB ';',CR,LF
- DB 'LD:',TAB,'DB',TAB
- DB 0
- ;
- LD0: DB '; Delete line at cursor position',CR,LF
- DB 'LI:',TAB,'DB',TAB
- DB 0
- ;
- LI0: DB '; Insert line at cursor position',CR,LF
- DB 'CD:',TAB,'DB',TAB
- DB 0
- ;
- CD0: DB '; Erase from cursor to end-of-screen',CR,LF
- DB ';',CR,LF
- DB '; The attribute string contains the four command '
- DB 'characters to set',CR,LF
- DB '; the following four attributes for this terminal in the '
- DB 'following',CR,LF
- DB '; order: ',TAB,'Normal, Blink, Reverse, Underscore',CR,LF
- DB ';',CR,LF
- DB 'SA:',TAB,'DB',TAB
- DB 0
- ;
- SA0: DB '; Set screen attributes macro',CR,LF
- DB 'AT:',TAB,'DB',TAB
- DB 0
- ;
- AT0: DB '; Attribute string',CR,LF
- DB 'RC:',TAB,'DB',TAB
- DB 0
- ;
- RC0: DB '; Read current cursor position',CR,LF
- DB 'RL:',TAB,'DB',TAB
- DB 0
- ;
- RL0: DB '; Read line until cursor',CR,LF
- DB ';',CR,LF
- DB '; Graphics TCAP area',CR,LF
- DB ';',CR,LF
- DB 'GOELD:',TAB,'DB',TAB
- DB 0
- ;
- GOELD0: DB TAB,TAB,'; Graphics On/Off delay in ms',CR,LF
- DB ';',CR,LF
- DB '; Graphics strings',CR,LF
- DB ';',CR,LF
- DB 'GO:',TAB,'DB',TAB
- DB 0
- ;
- GO0: DB '; Graphics mode On',CR,LF
- DB 'GE:',TAB,'DB',TAB
- DB 0
- ;
- GE0: DB '; Graphics mode Off',CR,LF
- DB 'CDO:',TAB,'DB',TAB
- DB 0
- ;
- CDO0: DB '; Cursor Off',CR,LF
- DB 'CDE:',TAB,'DB',TAB
- DB 0
- ;
- CDE0: DB '; Cursor On',CR,LF
- DB ';',CR,LF
- DB '; Graphics characters',CR,LF
- DB ';',CR,LF
- DB 'GULC:',TAB,'DB',TAB
- DB 0
- ;
- GULC0: DB TAB,TAB,'; Upper left corner',CR,LF
- DB 'GURC:',TAB,'DB',TAB
- DB 0
- ;
- GURC0: DB TAB,TAB,'; Upper right corner',CR,LF
- DB 'GLLC:',TAB,'DB',TAB
- DB 0
- ;
- GLLC0: DB TAB,TAB,'; Lower left corner',CR,LF
- DB 'GLRC:',TAB,'DB',TAB
- DB 0
- ;
- GLRC0: DB TAB,TAB,'; Lower right corner',CR,LF
- DB 'GHL:',TAB,'DB',TAB
- DB 0
- ;
- GHL0: DB TAB,TAB,'; Horizontal line',CR,LF
- DB 'GVL:',TAB,'DB',TAB
- DB 0
- ;
- GVL0: DB TAB,TAB,'; Vertical line',CR,LF
- DB 'GFB:',TAB,'DB',TAB
- DB 0
- ;
- GFB0: DB TAB,TAB,'; Full block',CR,LF
- DB 'GHB:',TAB,'DB',TAB
- DB 0
- ;
- GHB0: DB TAB,TAB,'; Hashed block',CR,LF
- DB 'GUI:',TAB,'DB',TAB
- DB 0
- ;
- GUI0: DB TAB,TAB,'; Upper intersect',CR,LF
- DB 'GLI:',TAB,'DB',TAB
- DB 0
- ;
- GLI0: DB TAB,TAB,'; Lower intersect',CR,LF
- DB 'GIS:',TAB,'DB',TAB
- DB 0
- ;
- GIS0: DB TAB,TAB,'; Mid intersect',CR,LF
- DB 'GRTI:',TAB,'DB',TAB
- DB 0
- ;
- GRTI0: DB TAB,TAB,'; Right intersect',CR,LF
- DB 'GLTI:',TAB,'DB',TAB
- DB 0
- ;
- GLTI0: DB TAB,TAB,'; Left intersect',CR,LF
- DB ';',CR,LF
- DB '; Fill remaining space with zeros',CR,LF
- DB ';',CR,LF
- DB TAB,' REPT',TAB,'128-($-TNAME)',CR,LF
- DB TAB,'DB',TAB,'0',CR,LF
- DB TAB,' ENDM',CR,LF
- DB CR,LF
- DB TAB,'END',CR,LF
- DB ';',CR,LF
- DB '; End of Z3TCAP',CR,LF
- DB ';',CR,LF,LF
- DB 0
-
- ;--------------------------------
- ;
- ; Initialized data area
- ;
- BLANK: DB 'BLANK ' ; Filename for blank source
- Z3TNAME:DB 'Z3TCAP ' ; Default infile filename
- INTYP: DB 'Z3T' ; Default infile filetype
- OUTTYP: DB 'Z80' ; Default outfile filetype
- ;
- CTRLSTR:DB '-40H' ; Control notation for arrow keys
- CCLEN EQU $-CTRLSTR ; Length of control character string
- ESCSTR: DB 'ESC,' ; Escape character string
- ESCLEN EQU $-ESCSTR ; Length of escape character string
- HISTR: DB '+80H' ; String for character > 80H
- HILEN EQU $-HISTR ; Length of hi character string
- TERM: DB '0 ' ; String termination
- TERMLEN EQU $-TERM ; Length of termination string
-
- ;--------------------------------
- ;
- ; Uninitialized data area, initialized at INIT
- ;
- DSEG
- DATA EQU $ ; Start of data area to be initialized
- OUTDR: DS 1 ; Outfile drive
- OUTFCB: DS 36 ; Outfile FCB
- TCPTR: DS 2 ; Pointer to start of Z3TCAP
- OUTFILE:DS 2 ; Pointer to start of source file buffer
- QF: DS 1 ; ON if character within quote string
- NEWTCP: DS 128 ; Blank TCAP for NEWFILE
- ;
- DATALEN EQU $-DATA ; Length of data area to be initialized
- ;
- DS 48 ; Local stack
- STACK: DS 2 ; CCP stack pointer
- ;
- END