mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-25 17:34:06 +00:00
181 lines
3.6 KiB
NASM
181 lines
3.6 KiB
NASM
title 'MP/M II V2.0 Banked XDOS '
|
||
name 'bnkxdos'
|
||
cseg
|
||
;do;
|
||
|
||
;/*
|
||
; Copyright (C) 1979, 1980,1981
|
||
; Digital Research
|
||
; P.O. Box 579
|
||
; Pacific Grove, CA 93950
|
||
;
|
||
; Revised:
|
||
; 14 Sept 81 by Thomas Rolander
|
||
;*/
|
||
|
||
; declare sysdatadr address;
|
||
sysdatadr:
|
||
dw $-$
|
||
|
||
; declare cmnbufferadr address;
|
||
cmnbufferadr:
|
||
dw $-$
|
||
|
||
; declare Proc$Address$Table (20) address data (
|
||
; 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
||
ProcAddressTable:
|
||
dw parse,patch,0,0,0
|
||
dw 0,0,0,0,0
|
||
dw 0,0,0,0,0
|
||
dw 0,0,0,0,0
|
||
|
||
;
|
||
; /* Banked XDOS Procedures */
|
||
;
|
||
|
||
parse: ; BC->.(.filename,.fcb)
|
||
;
|
||
; filename = [d:]file[.type][;password]
|
||
;
|
||
; fcb assignments
|
||
;
|
||
; 0 => drive, 0 = default, 1 = A, 2 = B, ...
|
||
; 1-8 => file, converted to upper case,
|
||
; padded with blanks
|
||
; 9-11 => type, converted to upper case,
|
||
; padded with blanks
|
||
; 12-15 => set to zero
|
||
; 16-23 => password, converted to upper case,
|
||
; padded with blanks
|
||
; 24-25 => address of password field in 'filename',
|
||
; set to zero if password length = 0
|
||
; 26 => length of password (0 - 8)
|
||
;
|
||
; Upon return, HL is set to FFFFH if BC locates
|
||
; an invalid file name;
|
||
; otherwise, HL is set to 0000H if the delimiter
|
||
; following the file name is a 00H (NULL)
|
||
; or a 0DH (CR);
|
||
; otherwise, HL is set to the address of the delimiter
|
||
; following the file name.
|
||
;
|
||
lxi h,0! push h! push h! push h
|
||
mov h,b! mov l,c
|
||
mov e,m! inx h! mov d,m! inx h
|
||
mov a,m! inx h! mov h,m! mov l,a
|
||
call deblank
|
||
call delim! jnz parse1
|
||
mov a,c! ora a! jnz parse9
|
||
mov m,a! jmp parse3
|
||
parse1:
|
||
mov b,a! inx d! ldax d! cpi ':'! jnz parse2
|
||
mov a,b! sui 'A'! jc parse9
|
||
cpi 16! jnc parse9
|
||
inr a! mov m,a! inx d! call delim! jnz parse3
|
||
cpi '.'! jz parse9
|
||
cpi ':'! jz parse9
|
||
cpi ';'! jz parse9
|
||
jmp parse3
|
||
parse2:
|
||
dcx d! mvi m,0
|
||
parse3:
|
||
mvi b,8! call setfld
|
||
mvi b,3! cpi '.'! jz parse4
|
||
call padfld! jmp parse5
|
||
parse4:
|
||
inx d! call setfld
|
||
parse5:
|
||
mvi b,4
|
||
parse6:
|
||
inx h! mvi m,0! dcr b! jnz parse6
|
||
mvi b,8! cpi ';'! jz parse7
|
||
call padfld! jmp parse8
|
||
parse7:
|
||
inx d! call pw$fld
|
||
parse8:
|
||
push d! call deblank! call delim! jnz parse81
|
||
inx sp! inx sp! jmp parse82
|
||
parse81:
|
||
pop d
|
||
parse82:
|
||
mov a,c! ora a
|
||
pop b! mov a,c! pop b
|
||
inx h! mov m,c! inx h! mov m,b! inx h! mov m,a
|
||
pop b! xchg! rnz
|
||
lxi h,0! ret
|
||
parse9:
|
||
pop h! pop h! lxi h,0ffffh! pop b
|
||
pop b! mov a,b! ora c! rz
|
||
push b! ret
|
||
|
||
setfld:
|
||
call delim! jz padfld
|
||
inx h! cpi '*'! jnz setfld1
|
||
mvi m,'?'! dcr b! jnz setfld! jmp setfld2
|
||
setfld1:
|
||
mov m,a! dcr b
|
||
setfld2:
|
||
inx d! jnz setfld
|
||
setfld3:
|
||
call delim! rz
|
||
pop h! jmp parse9
|
||
|
||
pw$fld:
|
||
call delim! jz padfld
|
||
inx sp! inx sp! inx sp
|
||
inx sp! inx sp! inx sp
|
||
push d! push h! mvi l,0! xthl
|
||
dcx sp! dcx sp
|
||
pw$fld1:
|
||
inx sp! inx sp! xthl! inr l! xthl! dcx sp! dcx sp
|
||
inx h! mov m,a! inx d! dcr b! jz setfld3
|
||
call delim! jnz pw$fld1
|
||
;jmp padfld
|
||
|
||
padfld:
|
||
inx h! mvi m,' '! dcr b! jnz padfld
|
||
ret
|
||
|
||
delim:
|
||
ldax d! mov c,a! ora a! rz
|
||
mvi c,0! cpi 0dh! rz! mov c,a
|
||
cpi 09h! rz
|
||
cpi ' '! jc delim2! rz
|
||
cpi '.'! rz
|
||
cpi ':'! rz
|
||
cpi ';'! rz
|
||
cpi '='! rz
|
||
cpi ','! rz
|
||
cpi '/'! rz
|
||
cpi '['! rz
|
||
cpi ']'! rz
|
||
cpi '<'! rz
|
||
cpi '>'! rz
|
||
cpi 'a'! rc
|
||
cpi 'z'+1! jnc delim1
|
||
ani 05fh
|
||
delim1:
|
||
ani 07fh! ret
|
||
delim2:
|
||
pop h! jmp parse9
|
||
|
||
deblank:
|
||
ldax d! cpi ' '! jz deblank1
|
||
cpi 09h! jz deblank1
|
||
ret
|
||
deblank1:
|
||
inx d! jmp deblank
|
||
|
||
Patch:
|
||
dw 0,0,0,0,0,0,0,0 ;0000-000fh
|
||
dw 0,0,0,0,0,0,0,0 ;0010-001fh
|
||
dw 0,0,0,0,0,0,0,0 ;0020-002fh
|
||
dw 0,0,0,0,0,0,0,0 ;0030-003fh
|
||
dw 0,0,0,0,0,0,0,0 ;0040-004fh
|
||
dw 0,0,0,0,0,0,0,0 ;0050-005fh
|
||
dw 0,0,0,0,0,0,0,0 ;0060-006fh
|
||
|
||
|
||
;end bnkxdos;
|
||
END
|
||
|