home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 1 / amigaformatcd01.iso / demos / secal / quickrefs.txt < prev    next >
Encoding:
Text File  |  1996-04-30  |  8.2 KB  |  263 lines

  1.            Quick summary of the Secal instruction set and syntax
  2.            =====================================================
  3.  
  4. The Secal compiler recognises the followings:
  5.  
  6. - Secal instructions
  7. - Assembly
  8.     (Standard Motorola 68000-68020 assembly instructions, closed by a
  9.     semicolon, with the Secal syntax of effective addressing (see later).
  10.     Also the operand separator have been changed to a comma (",") in some
  11.     special cases, where standard assembly uses something else)
  12. - Labels
  13.     (An identifier followed by a colon, for marking a program location)
  14. - Assignments
  15.     (In the form of "ea := expr ;")
  16.  
  17. >-------------------------------------------------------------------------<
  18.  
  19.                             Secal instructions
  20.                             ~~~~~~~~~~~~~~~~~~
  21. Legend:
  22.   <xx>       = to be substituted
  23.   [xx]       = optional
  24.   xx1, xx2   = repeatable
  25.   <...>      = multiple instructions
  26.   ...        = multiple macro parameters
  27.   xx | xx    = one or the other
  28.   ea         = effective address
  29.  
  30. Conditional execution:
  31.   IF <cond> THEN <...> [ELIF <cond> THEN <...>] [ELSE <...>] ;
  32.  
  33. Loops:
  34.   REPEAT <...> UNTIL <cond> ;
  35.   WHILE <cond> DO <...> ;
  36.   FOR <counter> := <start> UPTO | DOWNTO | TO <stop> [STEP <step>] DO <...> ;
  37.  
  38. Macros:
  39.   DEF <id> [(<par1>, <par2>, ...)] [= <text>] ;
  40.   PATTERN <id> [(<par1>, <par2>, ...)] IS <...> ENDP ;
  41.  
  42. File inclusion:
  43.   INCLUDE "<filename>" ;
  44.   INCBIN "<filename>" [, <offset>, <size>] ;
  45.   INCOBJ "<filename>" ;
  46.   INCLIB "<filename>" ;
  47.  
  48. Section control:
  49.   SECTION <name> [, <type>] ;
  50.   SECTION <name> [, <type_a>, <org> [, <load>]] ;
  51.   CODE ; CODE_C ; CODE_F ; DATA ; DATA_C ; DATA_F ; BSS ; BSS_C ; BSS_F ;
  52.   ORG [<address>] ;
  53.  
  54. Direct code operations:
  55.   DC [. <size>] <val1>, <val2> ;
  56.   DS [. <size>] <count> ;
  57.   DCB [. <size>] <repcount> [, <val1>, <val2>] ;
  58.   BLK [. <size>] <count> [, <val1>, <val2>] ;
  59.   ALIGN <value> [, <offset>] ;
  60.  
  61. Compiler variable:
  62.   SET <id> = <value> ;
  63.  
  64. Variables, structures:
  65.   OBJ | DOBJ [<id1>, <id2>] : <type> = <initval> ;
  66.   STRUCT | UNION <id> IS <...> ;
  67.  
  68. Control transfer:
  69.   GO | CALL | GO_cc <address> ;
  70.  
  71. Stack operations:
  72.   PUSH [. <size>] <ea1 | reglist1>, <ea2 | reglist2> ;
  73.   POP <ea1 | reglist1>, <ea2 | reglist2> ;
  74.  
  75. Parallel assignments:
  76.   SAFE <...> ;
  77.  
  78. External interface:
  79.   IMPORT [<extname> AS] <id1>, <id2> : <type> ;
  80.   EXPORT <id1>, <id2> [AS <extname>] ;
  81.  
  82. Compiler options:
  83.   OPT <keyword> = <text> ;
  84.  
  85.  
  86.                            Effective addressing
  87.                            ~~~~~~~~~~~~~~~~~~~~
  88. M68000
  89.         Dn
  90.         An
  91.         [An]
  92.         [An+]
  93.         [-An]
  94.         [An+d16]
  95.         [An+Rn.SIZE+d8]
  96.         [PC+d16]
  97.         [PC+Rn.SIZE+d8]
  98.         [addr.w]
  99.         [addr.l]
  100.         const
  101.  
  102.         pc, sr, ccr, ssp, usp
  103.  
  104. M68020+
  105.         [An+Rn.SIZE*SCALE+d8]
  106.         [bd+An+Rn.SIZE*SCALE]
  107.         [[bd+An]+Rn.SIZE*SCALE+od]
  108.         [[bd+An+Rn.SIZE*SCALE]+od]
  109.         [PC+Rn.SIZE*SCALE+d8]
  110.         [bd+PC+Rn.SIZE*SCALE]
  111.         [[bd+PC]+Rn.SIZE*SCALE+od]
  112.         [[bd+PC+Rn.SIZE*SCALE]+od]
  113.  
  114.         Dx:Dy
  115.         sfc, dfc, vbr, cacr, caar, msp, isp
  116.  
  117.    (Note that bd and od are not supported together, and their sizes must be
  118.    word. ZAn and ZPC can be used to indicate a suppressed base register.)
  119.  
  120.  
  121.                                    Types
  122.                                    ~~~~~
  123.         byte    .b
  124.         ubyte   .ub
  125.         word    .w
  126.         uword   .uw
  127.         long    .l
  128.         ulong   .ul
  129.  
  130.   In the place of these standard types, a new structure/union definition can
  131.   also be recognised, introduced with the STRUCT or UNION keyword, similar to
  132.   the STRUCT and UNION instructions.
  133.  
  134.  
  135.                                  Operators
  136.                                  ~~~~~~~~~
  137.         +, -, /, *
  138.         and=&, or=|, xor
  139.         lsl=<<, lsr=>>, asl, asr, rol, ror, roxl, roxr
  140.         bchg, bclr, bset
  141.         inv=~, -
  142.  
  143.         orif=||, andif=&&
  144.         not=!
  145.  
  146. >-------------------------------------------------------------------------<
  147.  
  148.                                  Secal.lib
  149.                                  ~~~~~~~~~
  150. String functions:
  151. ~~~~~~~~~~~~~~~~~
  152. strlen( str )                                   -> d0.l=length, a0=stringend
  153. strcopy( source, dest )                         -> a0=destend
  154. strcopym( source, dest, max )                   -> a0=destend
  155. strdiff( source, dest )                         -> d0=firstdiff/0
  156. strdiffi( source, dest )                        -> d0=firstdiff/0
  157. strcat( source, dest )                          -> a0=destend
  158. strcatm( source, dest, max )                    -> a0=destend
  159.  
  160. >-------------------------------------------------------------------------<
  161.  
  162.                                  Extension
  163.                                  ~~~~~~~~~
  164.  
  165. General functions:
  166. ~~~~~~~~~~~~~~~~~~
  167.   x_Init                                                -> d0=success
  168.   x_Done
  169.  
  170. Audio functions:
  171. ~~~~~~~~~~~~~~~~
  172.   x_AudioStart( chanmask )                              -> d0=success
  173.  
  174.   x_Mus_New( modul, chanmask )                          -> a0=mus/0
  175.   x_Mus_Load( filename, chanmask )                      -> a0=mus/0
  176.   x_Mus_Dispose( mus )
  177.   x_Mus_Play( mus, pos )
  178.   x_Mus_Stop( mus)
  179.   x_Mus_Continue( mus )
  180.   x_Mus_Modify( mus, pos, volume )
  181.  
  182.   x_PlaySound( start, length, repstart, replen, channel, period, volume )
  183.   x_StopSound( channel )
  184.   x_ModifySound( channel, period, volume )
  185.   x_PlaySoundQ( pri, start, length, repstart, replen, channel, period, volume )
  186.  
  187.   x_SetFilter( state )
  188.  
  189. Graphics variables:
  190. ~~~~~~~~~~~~~~~~~~~
  191.   x_VBlankCode : ulong
  192.   x_VBlankCnt : ulong
  193.  
  194. Graphics functions:
  195. ~~~~~~~~~~~~~~~~~~~
  196.   x_GraphicsStart
  197.  
  198.   x_Scr_Open( mode, width, height, depth, title, colors, taglist )   -> a0=scr/0
  199.   x_Scr_Close( scr )
  200.   x_Scr_AddBmp( scr )                                   -> d0=success
  201.   x_Scr_ActivateBmp( scr, index, xoffset, yoffset )
  202.   x_Scr_GetBmp( scr, index )                            -> a0=bmp
  203.   x_Scr_LoadRGB8( scr, colors, start, count )
  204.  
  205.   x_RGB8Intensity( source, count, dest, intensity, target )
  206.  
  207.   x_Bmp_Alloc( width, height, depth )                   -> a0=bmp/0
  208.   x_Bmp_Free( bmp )
  209.  
  210.   x_Ani_New( animdata, looping )                        -> a0=ani/0, a1=rbg8, d0=numcolors
  211.   x_Ani_Load( filename, looping )                       -> a0=ani/0, a1=rbg8, d0=numcolors
  212.   x_Ani_Dispose( ani )
  213.   x_Ani_DoFrame( ani, bmp, x, y, scr )                  -> d0=duration
  214.  
  215.   x_Spr_NewGrp( sprarray, sprcnt, flags, depth )        -> a0=sgrp/0
  216.   x_Spr_DisposeGrp( sgrp )
  217.   x_Spr_Draw( sgrp, destbmp, xoffset, yoffset )
  218.   x_Spr_Restore( sgrp, destbmp, bgnd, bgndwidth )
  219.   x_Spr_PrepGfx( sgfxarray, sgrp, count )               -> d0=success
  220.   x_Spr_UnPrepGfx( sgfxarray, count )
  221.   x_Spr_ChngGfx( sgfx, spr, nextframe )
  222.   x_Spr_CollChk( mode, spr1, spr2 )                     -> d0=collission
  223.   x_Spr_Sort( sgrp, customsort )
  224.   x_Spr_CutMsk( spr, data, x, y, width, height )
  225.   x_Spr_GrpCutMsk( sgrp, data, x, y, width, height )
  226.   x_Spr_AddBgBuf( spr, size )                           -> d0=success
  227.   x_Spr_GrpAddBgBuf( sgrp )                             -> d0=success
  228.   x_Spr_AddMskBuf( spr, size )                          -> d0=success
  229.   x_Spr_GrpAddMskBuf( sgrp )                            -> d0=success
  230.  
  231.   x_MakeMask( source, dest, width, height, depth, mplane )
  232.   x_ClrBlit( dst, dstw, width, height )
  233.   x_MoveBlit( src, srcw, dst, dstw, width, height )
  234.  
  235. Miscellaneous functions:
  236. ~~~~~~~~~~~~~~~~~~~~~~~~
  237.   x_Randomize
  238.   x_Rnd                                                 -> d0=random
  239.  
  240.   x_LoadFile( filename, memflags )                      -> a0=loadedfile, d0.l=size
  241.   x_UnLoadFile( loadedfile )
  242.  
  243.   x_SetTaskPri( task, pri )                             -> d0=oldpri
  244.   x_RevertTaskPri
  245.   x_EasyRequest( window, titletxt, bodytxt, gadgettxt ) -> d0=num
  246.  
  247. General system functions callable without a library base:
  248. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  249.   x_DisplayBeep( scr )
  250.   x_Delay( ticks )
  251.   x_OwnBlitter
  252.   x_DisownBlitter
  253.   x_WaitBlit
  254.   x_WaitTOF
  255.   x_VBeamPos                                            -> d0.l=beampos
  256.   x_WBenchToFront                                       -> d0=success
  257.   x_WBenchToBack                                        -> d0=success
  258.   x_OpenWorkbench                                       -> d0=success
  259.   x_CloseWorkbench                                      -> d0=success
  260.  
  261. >-------------------------------------------------------------------------<
  262.  
  263.