home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pdp11 / k11cdf.mac < prev    next >
Text File  |  2020-01-01  |  2KB  |  99 lines

  1.     .sbttl    define command macro
  2.  
  3.     .iif ndf, true,  true  = -1
  4.     .iif ndf, false, false =  0
  5.  
  6.  
  7. ;    example
  8. ;
  9. ;    command    SEND,3,c$send,true
  10. ;
  11. ;    Would define the SEND command with a minimum length of
  12. ;    three characters and allow trailing options on the cmd
  13. ;    line
  14.  
  15.  
  16.     string    =    0
  17.     octnum    =    1
  18.     decnum    =    2
  19.  
  20.     
  21.     .macro    command    list ,name , min , addres , arg , argtyp
  22.  
  23. $listl    ==    6
  24.     .save
  25.  
  26.     .if b    ,<name>
  27.  
  28.     .ift
  29.     .psect    cmddsp    ,con,rel,d,lcl,ro
  30.     .rept    $listl
  31.     .word    0
  32.     .endr
  33.  
  34.     .iff
  35.     .iif ne, $cmglob,.globl    addres
  36.     .psect    cmdtxt    ,con,rel,d,lcl,ro
  37. $$name    =    .
  38.     .asciz    #name#
  39. $arg    =    .
  40.     .if b    ,<arg>
  41.     .ift
  42.     .byte    0
  43.     .iff
  44.     .asciz    #arg#
  45.     .endc
  46.     .even
  47.     .psect    cmddsp    ,con,rel,d,lcl,ro
  48.     .if ndf    ,list
  49.     .ift
  50.      .if ne,$cmglob
  51.      .ift
  52. 'list::
  53.      .iff
  54. 'list:
  55.      .endc
  56.     .endc
  57.     .word    $$name
  58.     .word    min
  59.     .word    addres
  60.     .word    $arg
  61.     .word    argtyp
  62.     .word    0
  63.     .endc
  64.     .restore
  65.     .endm
  66.  
  67.  
  68.     .sbttl    $name macro. Allow site checking for command names
  69.  
  70.  
  71. ;    MACRO $NAME
  72. ;
  73. ;    This  is macro is intended to allow local sites to
  74. ;    try to control the  user  access  to  the  various
  75. ;    commands.  The  cmd  name address is passed on the
  76. ;    stack (at 2(sp)) and the local site is  given  the
  77. ;    option  of  checking to see if the user is allowed
  78. ;    to  access  this  command  or  not.  If  not,  the
  79. ;    routine  called  okuser  should  simply  do  a cmp
  80. ;    (sp)+,(sp)+ and a return else do a mov (sp)+  ,@sp
  81. ;    and return.
  82. ;    The command name is  .asciz  and only  the first 3
  83. ;    characters are stored.
  84.  
  85.     .macro    $name    nam
  86.     .save
  87.     .psect    $pdata
  88. $nam    =    .
  89.     .asciz    #nam#
  90.     .restore
  91.     mov    #$nam    ,-(sp)
  92.     call    okuser
  93.     global    <okuser>
  94.     .endm    $name
  95.  
  96.  
  97.     code                ; insure $code psect
  98.  
  99.