home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpm
/
packet
/
rli120.ark
/
DCMD.MAC
< prev
next >
Wrap
Text File
|
1987-05-11
|
5KB
|
167 lines
; DCMD.MAC - 5/11/87 - Command dispatch.
.z80
.xlist
maclib TNC.LIB
tncdefs
.list
entry dcmd
external f1l,erwhat,logtxt,flds,fcb1,mode
defcmd macro adr,chars,args,modes
external adr
dw adr
dw chars
db args
db modes
endm
cseg
dcmd: ld a,(f1l)
or a ; Blank line?
ret z ; Yes, ignore it
cp 3 ; > 2 chars?
jp nc,erwhat ; Yes, what is it?
ld hl,(fcb1+1) ; Command
ld (logtxt),hl ; Save command for logging
ld a,(flds)
ld c,a ; (C) has # fields user typed
ld b,tblitm ; (B) has # items in table
ld de,6 ; Item size
ld ix,tbl ; First command
dca: ld a,(mode)
and (ix+5) ; Do it in this mode?
jr z,dcb ; No
ld a,(ix+4) ; Fields in this command
cp c ; Right # fields?
jr nz,dcb ; No
ld a,(ix+3) ; First letter, this command
cp l ; First letter match?
jr nz,dcb ; No
ld a,(ix+2) ; Second letter
cp h ; Same?
jr z,dcc ; Yes, match
cp '*' ; Wildcard?
jr z,dcc ; Yes, match
dcb: add ix,de ; Increment to next command
dec b ; Count the command we checked
jr nz,dca ; More to check
jp erwhat ; No such command
; Got a match, pick up address and go do it.
dcc: ld l,(ix) ; Low byte procedure entry
ld h,(ix+1) ; High byte procedure entry
jp (hl) ; Go do it to it
; gmode - GateWay commands
; lmode - Local console commands
; smode - Remote sysop commands
; umode - User commands
; Entry Cmd # flds mode
tbl: defcmd syson, '@ ', 1, umode
defcmd sysoff, '@ ', 1, smode
defcmd auto, 'A ', 1, lmode
defcmd hidfil, 'AN', 2, lmode+smode
defcmd hidfil, 'AS', 2, lmode+smode
defcmd logout, 'B ', 1, smode+umode
defcmd gbye, 'B ', 1, gmode
defcmd bsfila, 'BA', 2, lmode
defcmd bsfilb, 'BB', 2, lmode
defcmd settim, 'C ', 1, lmode+smode
defcmd cnusr, 'C ', 2, lmode
defcmd gcon1, 'C ', 1, gmode
defcmd gcon2, 'C ', 2, gmode
defcmd gcon4, 'C ', 4, gmode
defcmd dload, 'D ', 2, umode
defcmd disp, 'D ', 2, lmode+smode
defcmd lstusr, 'DB', 1, lmode+smode
defcmd lstusr, 'DE', 1, lmode+smode
defcmd lstusr, 'DL', 1, lmode+smode
defcmd disp, 'DP', 2, lmode+smode
defcmd lstusr, 'DS', 1, lmode+smode
defcmd lstusr, 'DU', 1, lmode+smode
defcmd edmsg, 'E ', 2, lmode+smode
defcmd edfil, 'EF', 2, lmode
defcmd etmsg, 'ET', 2, lmode++smode+umode
defcmd eusr1, 'EU', 1, lmode+smode
defcmd eusr2, 'EU', 2, lmode+smode
defcmd filmsg, 'F ', 3, lmode+smode
defcmd filmsg, 'FA', 3, lmode+smode
defcmd filusr, 'FB', 2, lmode+smode
defcmd filusr, 'FL', 2, lmode+smode
defcmd gate, 'G ', 1, umode
defcmd untall, 'G ', 1, lmode+smode
defcmd unt, 'GM', 1, lmode+smode
defcmd gatoff, 'GN', 1, lmode+smode
defcmd unt, 'GR', 1, lmode+smode
defcmd untusr, 'GU', 1, lmode+smode
defcmd gaton, 'GY', 1, lmode+smode
defcmd untusz, 'GZ', 1, lmode+smode
defcmd help, 'H ', 1, umode
defcmd togmen, 'H ', 1, lmode
defcmd info, 'I ', 1, umode
defcmd prthrd, 'J ', 1, lmode+smode+umode+gmode
defcmd klmsg1, 'K ', 1, lmode+umode
defcmd klmsg3, 'KF', 1, lmode+smode
defcmd klmsg3, 'KM', 1, lmode+umode
defcmd klmsg1, 'KT', 1, lmode+umode
defcmd klmsg2, 'K ', 2, lmode+umode
defcmd klmsg2, 'KT', 2, lmode+umode
defcmd lstmsg, 'LL', 2, lmode+umode
defcmd lstmsg, 'L*', 1, lmode+umode
defcmd lstmsg, 'L*', 2, lmode+umode
defcmd gmon, 'M ', 1, gmode
defcmd smsg3, 'M*', 3, lmode+smode
defcmd smsg5, 'M*', 5, lmode+smode
defcmd smsg7, 'M*', 7, lmode+smode
defcmd renfil, 'N ', 3, lmode+smode
defcmd setnam, 'N ', 2, umode
defcmd ussetx, 'NE', 1, lmode+umode
defcmd usseth, 'NH', 2, lmode+umode
defcmd opfila, 'OA', 2, lmode
defcmd opfilb, 'OB', 2, lmode
defcmd shpath, 'P ', 2, lmode+umode+gmode
defcmd paramc, 'P*', 2, lmode+smode
defcmd exit, 'Q ', 1, lmode
defcmd gater, 'R ', 1, gmode
defcmd rdmsg1, 'R ', 1, lmode+umode
defcmd rdmsg2, 'R ', 2, lmode+umode
defcmd rdmsg3, 'RM', 1, lmode+umode
defcmd smsg1, 'S*', 1, lmode+umode
defcmd smsg2, 'S*', 2, lmode+umode
defcmd smsg4, 'S*', 4, lmode+umode
defcmd smsg6, 'S*', 6, lmode+umode
defcmd talk, 'T ', 1, umode
defcmd lterma, 'TA', 1, lmode
defcmd ltermb, 'TB', 1, lmode
defcmd rcvfil, 'U ', 2, lmode+umode
defcmd gunp, 'U ', 1, gmode
defcmd rcvfil, 'UA', 2, lmode+smode
defcmd copfil, 'V ', 3, lmode+smode
defcmd dir, 'W ', 1, lmode+smode+umode
defcmd dira, 'WA', 1, lmode+smode
defcmd dirn, 'WN', 1, lmode+smode+umode
defcmd dirs, 'WS', 1, lmode+smode
defcmd dir, 'W ', 2, lmode+smode+umode
defcmd dira, 'WA', 2, lmode+smode
defcmd dirn, 'WN', 2, lmode+smode+umode
defcmd dirs, 'WS', 2, lmode+smode
defcmd togmen, 'X ', 1, umode+gmode
defcmd fwd1, 'X ', 1, lmode
defcmd fwd2, 'X ', 2, lmode
defcmd fwd3, 'XI', 1, lmode
defcmd fwd4, 'XI', 2, lmode
defcmd chgca, 'YC', 2, lmode+smode
defcmd chgf, 'YF', 2, lmode+smode
defcmd chgl, 'YL', 2, lmode+smode
defcmd kilfil, 'Z ', 2, lmode+smode
tbllen equ $-tbl
tblitm equ tbllen/6
end