home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / os20 / util / ssl / ssmac.doc < prev    next >
Encoding:
Text File  |  1993-12-21  |  5.3 KB  |  167 lines

  1.  
  2.                              Special Support Macros
  3.  
  4.                                   Version 3.0
  5.  
  6.               (c) 1993 MJSoft System Software, SinSoft and PCSoft
  7.  
  8. ================================================================================
  9.  
  10. ### Typical structure of program which uses the macros: ###
  11.  
  12. ;DEBUG    set    1        ; Set only when debugging and your
  13.                 ; debugger doesn't pass the arguments
  14.                 ; correctly (see StartupInit doc)
  15.  
  16.     include    "ssmac.h"    ; include the macros
  17.     [tbase    a4]        ; define text base register if you want
  18.     start            ; or clistart if you want only CLI
  19. ; here is automatically defined the "go" label
  20.  
  21.     ; here is your program
  22.  
  23.     tags            ; start of tag list
  24.     ; here are your tags
  25.     finish            ; end of tag list
  26.     end
  27.  
  28.  
  29. ### Universal macros ###
  30.  
  31. push    r/m        - store register/memory onto stack
  32. pop    r/m        - get register/memory from stack
  33. mpush    reglist        - store register list onto stack
  34. mpop    reglist        - get register list from stack
  35. rptr    label        - store relative pointer to specified label
  36.  
  37. ### Variable definition macros ###
  38.  
  39. dv.size    name        - define variable, size={b,w,l}
  40. dbuf[.size]    name,nritems    - define buffer of nritems items size={b,w,l},
  41.               default=byte
  42. get.type    from,to        - MOVE.type <variable>,<to>
  43. put.type    from,to        - MOVE.type <from>,<variable>
  44. geta    from,to        - LEA <variable>,<to>
  45. clv.type    dest        - CLR.type <variable>
  46. tsv.type    src        - TST.type <variable>
  47.  
  48. ### Variable manipulation macros ###
  49.  
  50. vpush    var        - push longword variable onto stack
  51. vpop    var        - pop longword variable from stack
  52.  
  53.   - following macros are clones of standard instructions manipulating with
  54.     variables. 'v' on the left means that source is a variable, 'v' on the right
  55.     means that destination is a variable:
  56.  
  57. negv.size    to
  58. notv.size    to
  59. stv.size    to
  60. clrv.size    to
  61. seqv.size    to
  62. snev.size    to
  63. sccv.size    to
  64. scsv.size    to
  65. tstv.size    from
  66. bchgv    bitnr,byte
  67. bclrv    bitnr,byte
  68. bsetv    bitnr,byte
  69. btstv    bitnr,byte
  70. subqv.type    nr,byte
  71. addqv.type    nr,byte
  72. vpea    var
  73. eorv.type    src,dest
  74. divsv    src,dest
  75. divuv    src,dest
  76. mulsv    src,dest
  77. muluv    src,dest
  78. addv.type    src,dest
  79. vadd.type    src,dest
  80. andv.type    src,dest
  81. vand.type    src,dest
  82. cmpv.type    src,dest
  83. vcmp.type    src,dest
  84. movev.type    src,dest
  85. vmove.type    src,dest
  86. orv.type    src,dest
  87. vor.type    src,dest
  88. subv.type    src,dest
  89. vsub.type    src,dest
  90. vlea    src,dest
  91. vmovev.type    src,dest
  92. movemv.type    src,dest
  93. vmovem.type    src,dest
  94.  
  95. ### Text macros ###
  96.  
  97. tbase    basereg        - define text base register, must be before START
  98. dt.[c][l]    [label,]text    - define a text in text section
  99.                 l = put NL character after the text
  100.                 c = don't put 0 character after the text
  101. gett    textlabel,areg    - get address of text to <areg>
  102. tlea    textlabel,areg    - same as above
  103. dtl    text,areg    - define text and load its address
  104.  
  105. ### System interface ###
  106.  
  107. call    [base,]name    - call function <name> of specified library
  108.               if no library is specified, it will use current
  109.               contents of A6 as the base
  110. jump    [base,]name    - jump to function <name> ... see CALL
  111.  
  112. ### Startup and exit ###
  113.  
  114. start            - perform standard startup and open ss.library
  115. clistart            - START with no respect to WorkBench
  116. tags            - start final declaration of tags
  117. finish            - end of tag list, inserts size of variables
  118.  
  119. ### Startup tags ###
  120.  
  121. wbconsole            - open console window when started from WorkBench
  122. template    <template>    - set template, followed by dv.l <name> for each
  123.               argument
  124. exitrout    routine        - <routine> will be called before exit
  125. errrout    routine        - <routine> will be called for error messages
  126.               (see SSLib.doc/ReportError)
  127. library    name,version    - open library and define variable containing
  128.               its base; error if not available;
  129. trylib    name,version    - same as LIBRARY, but doesn't fail if not available
  130. cputype    min,max        - require CPU 680<min>0 to 680<max>0, max=-1 for
  131.               no limit
  132. fputype    min,max        - require FPU in specified range, see SS.i
  133. sysver    min,max        - require kickstart version min..max, max=-1...
  134. diserr    flags        - disable error messages specified by flags
  135.               (it's a bit field with the same format as
  136.               sv_errors)
  137. wbconname    name        - open console window with specified name when
  138.               started from WorkBench
  139. usrtrk    tablelabel    - define user tracker types (see UserTrkTypes)
  140. extrahelp    [<string>]    - define extra help string. If no argument is
  141.               given, you should continue with sequence of
  142.               DC.Bs ended by ENDHELP
  143. endhelp            - end of extra help string (see EXTRAHELP)
  144.  
  145. ### Text output macros ###
  146.  
  147. write    <text>        - write text to standard output
  148. writeln    <text>        - write text followed by NL to standard output
  149. printfs[.L]    <text>        - write formatted text to std. output
  150.               parameters are stored on the stack, .L=newline
  151. printfr[.L]    <text>,reg    - write formatted register contents
  152. printfv[.L]    <text>,variable    - write formatted variable contents
  153. printfl[.L]    <text>,reglist    - write formatted register list contents
  154.               you can supply number of registers you have
  155.               passed as the 3rd parameter, it will simplify
  156.               the code generated by this macro
  157. err    <text>        - write text and exit with error return code
  158. doserr    <text>        - write text + dos error text and exit
  159. errc.condition    <text>        - if <condition> is false, write text and exit
  160.  
  161. ### NOTES ###
  162.  
  163.    If you define the _GlobVec symbols before startup macro, the startup code
  164. generated will use pointer to global vector passed in A2. This is automatically
  165. done by the system, but not by most debuggers, therefore programs compiled
  166. using this option are hardly debuggable unless you specify the DEBUG option.
  167.