home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / b / krtnhd.min < prev    next >
Text File  |  2020-01-01  |  1KB  |  76 lines

  1.     .sbttl    KRTNHD.MIN  EIS macros for a non-EIS CPU
  2.     .ident    "V03.62"
  3.  
  4. ; /62/    31-May-93  Billy Youdelman
  5.  
  6.     NONEIS    =    1
  7.  
  8.     .macro    mul    src,reg
  9.     .ntype    $$    ,reg
  10.     mov    src    ,-(sp)
  11.     mov    reg    ,-(sp)
  12.     call    p$mul
  13.     .iif eq <$$-1>    mov    (sp)+    ,r1
  14.     .iif eq <$$-3>    mov    (sp)+    ,r3
  15.     .iif eq <$$-5>    mov    (sp)+    ,r5
  16.     .iif ne <<$$+1>&1> .error      <; bad dst reg for MUL macro>
  17.     .endm    mul
  18.  
  19.     .macro    div    src,reg
  20.     .ntype    $$    ,reg
  21.     mov    src    ,-(sp)
  22.     .if eq $$
  23.     mov    r1    ,-(sp)
  24.     mov    r0    ,-(sp)
  25.     .endc
  26.     .if eq $$-2
  27.     mov    r3    ,-(sp)
  28.     mov    r2    ,-(sp)
  29.     .endc
  30.     .if eq $$-4
  31.     mov    r5    ,-(sp)
  32.     mov    r4    ,-(sp)
  33.     .endc
  34.     call    p$div
  35.     .if eq $$
  36.     mov    (sp)+    ,r1
  37.     mov    (sp)+    ,r0
  38.     .endc
  39.     .if eq $$-2
  40.     mov    (sp)+    ,r3
  41.     mov    (sp)+    ,r2
  42.     .endc
  43.     .if eq $$-4
  44.     mov    (sp)+    ,r5
  45.     mov    (sp)+    ,r4
  46.     .endc
  47.     .endm    div
  48.  
  49.     .macro    sob    reg,dst
  50.     dec    reg
  51.     bne    dst
  52.     .endm    sob
  53.  
  54.     .macro    ash    amount,reg
  55.     .ntype    $$$0    ,amount
  56.     .iif ne <27-$$$0> .error       <; must be auto pc for ASH macro>
  57.     $$type    = 1
  58.     $$size    = 0
  59.       .irpc    $a ,<amount>
  60.       $c    = ''$a
  61.       .iif eq <$c - '-> $$type = -1
  62.       .iif eq <$c - '.> .error     <; only use octal in ASH macro please>
  63.       .iif eq <$c - '^> .error     <; only use octal in ASH macro please>
  64.       $c    = $c - '0
  65.         .if ge $c
  66.           .if le $c-7
  67.           $$size = <$$size*10>+$c
  68.           .endc
  69.         .endc
  70.       .endr
  71.     .rept    $$size
  72.     .iif gt <$$type>  asl    reg
  73.     .iif lt <$$type>  asr    reg
  74.     .endr
  75.     .endm
  76.