home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / code / andylib / s / general < prev    next >
Encoding:
Text File  |  1994-12-07  |  2.9 KB  |  85 lines

  1. ; > <Asm$LibRoot>general
  2.  
  3. S0_bit          *               1 :SHL: 0
  4. S1_bit          *               1 :SHL: 1
  5. F_bit           *               1 :SHL: 26
  6. I_bit           *               1 :SHL: 27
  7. V_bit           *               1 :SHL: 28
  8. C_bit           *               1 :SHL: 29
  9. Z_bit           *               1 :SHL: 30
  10. N_bit           *               1 :SHL: 31
  11.  
  12.                 MACRO
  13. $label          PROC            $name, $symbol
  14. $label          DCB             "$name"
  15.                 DCD             &ff000000 + ((:LEN: "$name" + 3) :AND: &FFFC)
  16.                 [               "$symbol" = ""
  17.                 EXPORT          $name
  18.                 |
  19.                 EXPORT          $symbol
  20.                 ]
  21.                 MEND
  22.  
  23.                 MACRO
  24. $label          SWIX            $swinum, $cc
  25. $label          SWI$cc          (1 :SHL: 17) :OR: $swinum
  26.                 MEND
  27.  
  28.                 MACRO
  29. $label          PRINT           $message
  30. $label          SWI             XOS_WriteS
  31.                 =               "$message", 0
  32.                 ALIGN
  33.                 MEND
  34.  
  35.                 MACRO
  36. $label          ERROR           $code, $message
  37. $label          &               $code
  38.                 =               "$message", 0
  39.                 ALIGN
  40.                 MEND
  41.  
  42.                 MACRO
  43. $label          CMD             $module, $name, $routine, $min, $max, $GSTmap, $flags
  44. $label          =               "$name", 0
  45.                 ALIGN
  46.                 &               $routine.Code - $module
  47.                 [               "$min" = ""
  48.                 &               0
  49.                 |
  50.                 =               $min, $GSTmap, $max, $flags
  51.                 ]
  52.                 &               $routine.Syntax - $module
  53.                 &               $routine.Help - $module
  54.                 MEND
  55.  
  56.                 MACRO
  57. $label          DIV             $div, $top, $bot, $temp
  58.                 ASSERT          $top <> $bot
  59.                 ASSERT          $top <> $temp
  60.                 ASSERT          $bot <> $temp
  61.                 [               "$div" <> ""
  62.                 ASSERT          $div <> $top
  63.                 ASSERT          $div <> $bot
  64.                 ASSERT          $div <> $temp
  65.                 ]
  66. $label          MOV             $temp, $bot
  67.                 CMP             $temp, $top, LSR #1
  68. 90              MOVLS           $temp, $temp, LSL #1
  69.                 CMP             $temp, $top, LSR #1
  70.                 BLS             %b90
  71.                 [               "$div" <> ""
  72.                 MOV             $div, #0
  73.                 ]
  74. 91              CMP             $top, $temp
  75.                 SUBCS           $top, $top, $temp
  76.                 [               "$div" <> ""
  77.                 ADC             $div, $div, $div
  78.                 ]
  79.                 MOV             $temp, $temp, LSR #1
  80.                 CMP             $temp, $bot
  81.                 BHS             %b91
  82.                 MEND
  83.  
  84.                 END
  85.