.sbttl KRTCDF Define command macro ; .ident "V03.62" ; this is an .include file ; /62/ 27-Jul-93 Billy Youdelman ; ; $$trip hack to avoid "ndf/df" tests blowing up .LST output ; /BBS/ 1-Dec-91 Billy Youdelman V03.61 ; ; dump unused argtyp ; usage example: ; ; command cmdlst SEND ,3 ,c$send , ; ; Would define the SEND command with a minimum length of ; three characters, and dispatch it to c$send. Use of a ; prompt will cause same to appear when the command is ; given without argument(s). cmdlst is the listhead for ; all commands and is only used once, but must be used ; in all entries to keep other arguments in place. KRTCDF = 1 ; used to detect an .include error $LISTL == 4 ; number of args stuffed in list here $$TRIP = 0 ; /62/ init trip counter .macro command list ,name ,min ,addres ,arg .list me .save .nlist me .if b ; command name supplied this time? .list me .psect cmddsp ,ro,d,lcl,rel,con ; no, at end of list .nlist me .word 0 ; /62/ mark it with a null $$trip = 0 ; /62/ reset trip counter for next cmd .iff ; ya, process args into command data .iif ne $cmglob, .globl addres .list me .psect cmdtxt ,ro,d,lcl,rel,con .nlist me $$name = . .asciz #name# ; store the command name $arg = . .if b ; was an optional_prompt string given? .byte 0 ; no, stick a null where it would be .iff .asciz #arg# ; ya, store the text for it .endc .list me .even .psect cmddsp ,ro,d,lcl,rel,con .nlist me .if eq $$trip ; /62/ if first pass label listhead .if ne $cmglob ; and if the global flag is flyin 'list:: ; make the listhead a global .iff 'list: ; global flag was not set .endc $$trip = 1 ; /62/ not first time through anymore .endc ; no .word $$name ; store address of command name text .word min ; min number of chars to match .word addres ; the command routine's address .word $arg ; address of possible prompt .endc ; b .list me .restore .nlist me .endm