home *** CD-ROM | disk | FTP | other *** search
-
- ;system interface
- FCB EQU 5CH ;system FCB
- tbuf equ 80h ;system buffer
- sector equ 80h ;length of record for disk I/O
-
- ;Z3 interface constants
- exfcbo equ 24h ;Z3 external fcb offset
-
- ;ASCII constants
- ht equ 9 ;horizontal tab
- cr equ 0dh ;carriage return
- lf equ 0ah ;line feed
- spc equ 20h ;space
-
- ;constants unique to zmlib
- mrleof equ 9eh ;mREL end-of-file byte
- mrlnam equ 84h ;first 7 bits marks valid mREL file
-
- ;buffer lengths, 128 byte records
- sblen equ 8 ;source files
- oblen equ 8 ;output buffer
- cblen equ 1 ;cmd line or command file
-
- ; bit offsets in DATA+OUTOPT
- DELFLG EQU 0 ;option D - delete modules
- PUBFLG EQU 1 ;option P - show names, entry symbols
- MODFLG EQU 2 ;option M - show names only
- REPFLG EQU 3 ;option R - repplace modules
- APPFLG EQU 4 ;option A - append modules
- NAMFLG EQU 5 ;flags redirection to nambuf
- SKPFLG EQU 6 ;set to skip copy of current module
-
- ; bit offsets in DATA+STATUS
- EOS EQU 0 ;end of source (mrel eof)
- EOM EQU 1 ;end of mrel module
- NDONE EQU 2 ;name has been transferred
- PDONE EQU 3 ;public symbol end-of-line flag for display
- EOF EQU 7 ;end of file encountered during load
-
- ; INDEX REGISTER OFFSETS TO DATA AREA
- status EQU 0 ;END OF SOURCE FILE FLAG (1=EOS)
- TSTMSK EQU 1 ;BIT TEST MASK
- EOFFLG EQU 2 ;1=END OF FILE
- OUTOPT EQU 3 ;OUTPUT OPTION (1=CRT,2=LST)
- LOPCNT EQU 4 ;LOOP COUNTER
- SYMLEN EQU 5 ;CURRENT SYMBOL LENGTH
- WRFLG EQU 6 ;1=A WRITE OPERATION HAS BEEN PERFORMED
- fwid equ 7 ;items per line for screen display
- scrlin equ 8 ;lines per screen for paging
-
- ;=========================================================
- ; MACRO DEFINITIONS
-
- ;Initialize file buffer control block to
- ;default buffer sizes & location. On entry,
- ;DE contains the allocated address. On exit,
- ;DE has been incremented by the buffer size
- ;and contains the next address allocation.
- ;If the buffer is not required (high bit set
- ;in the FN field), then allocation is skipped
- ;and DE is preserved for the next allocation.
- allocb macro xx
- local bypass
- ld a,(xx&fn)
- bit 7,a ;;buffer required?
- jr nz,bypass ;;jump if not
- ld a,(xx&opl) ;;defined size, records
- call x128 ;;calculate byte size
- ld (xx&len),hl
- ld (xx&siz),bc
- ld (xx&cnt),bc
- ex de,hl ;;get buffer start alloc
- ld (xx&ptr),hl
- ld (xx&beg),hl
- add hl,bc ;;next available alloc
- ex de,hl ;;..in DE
- bypass:
- endm
-
- ;create File Access control Block, including
- ;the user area byte and FCB
- FILFAB macro xx
- xx&ptr: ds 2 ;;->next free buffer loc
- xx&cnt: ds 2 ;;beg+siz-ptr-1 = bytes remaining
- xx&beg: ds 2 ;;address of file buffer
- xx&len: ds 2 ;;length of buffer, 128 byte records
- xx&siz: ds 2 ;;length of buffer, bytes = len*128
- xx&du: ds 1 ;;user area for the file, 0..31
- xx&fcb: ds 1 ;;drive byte for the file FCB
- xx&fn: ds 8 ;;FCB1 filename field
- xx&fty: ds 7 ;;filetype field & balance of FCB1
- ;;xx&usr: ds 4 ;;Z-sys user byte & balance of FCB1
- xx&cb2: ds 1 ;;drive byte (0) for fcb2
- xx&fn2: ds 8 ;;fcb2 filename (used by RENAME)
- xx&ft2: ds 7 ;;filetype field & balance of FCB2
- ds 3,0 ;;for random file access
- endm
-
- ;=========================================================
-
- gbits macro xx
- ld b,xx
- call getbit
- endm
-
- ;=========================================================
-
- ldhlhl macro
- ld a,(hl)
- inc hl
- ld h,(hl)
- ld l,a
- endm
-
- ;=========================================================
-