home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
kermit11.tar.gz
/
kermit11.tar
/
k11cdf.mac
< prev
next >
Wrap
Text File
|
1989-06-13
|
2KB
|
99 lines
.sbttl define command macro
.iif ndf, true, true = -1
.iif ndf, false, false = 0
; example
;
; command SEND,3,c$send,true
;
; Would define the SEND command with a minimum length of
; three characters and allow trailing options on the cmd
; line
string = 0
octnum = 1
decnum = 2
.macro command list ,name , min , addres , arg , argtyp
$listl == 6
.save
.if b ,<name>
.ift
.psect cmddsp ,con,rel,d,lcl,ro
.rept $listl
.word 0
.endr
.iff
.iif ne, $cmglob,.globl addres
.psect cmdtxt ,con,rel,d,lcl,ro
$$name = .
.asciz #name#
$arg = .
.if b ,<arg>
.ift
.byte 0
.iff
.asciz #arg#
.endc
.even
.psect cmddsp ,con,rel,d,lcl,ro
.if ndf ,list
.ift
.if ne,$cmglob
.ift
'list::
.iff
'list:
.endc
.endc
.word $$name
.word min
.word addres
.word $arg
.word argtyp
.word 0
.endc
.restore
.endm
.sbttl $name macro. Allow site checking for command names
; MACRO $NAME
;
; This is macro is intended to allow local sites to
; try to control the user access to the various
; commands. The cmd name address is passed on the
; stack (at 2(sp)) and the local site is given the
; option of checking to see if the user is allowed
; to access this command or not. If not, the
; routine called okuser should simply do a cmp
; (sp)+,(sp)+ and a return else do a mov (sp)+ ,@sp
; and return.
; The command name is .asciz and only the first 3
; characters are stored.
.macro $name nam
.save
.psect $pdata
$nam = .
.asciz #nam#
.restore
mov #$nam ,-(sp)
call okuser
global <okuser>
.endm $name
code ; insure $code psect