procedure ... eproc


SYNTAX

"procedure" ["loc:"] NAME:sym "[" [RL1:regslist] "]" ["," RL2:regslist]
...
"eproc"


MEANING

  1. A label is defined as the entry point of the procedure NAME.
  2. If RL2 is declared, the specified registers are stored in the stack.
  3. The code "..." is processed.
  4. If RL2 is declared, the registers are restored from the stack.
  5. An rts is added as last operation.


NOTES

  1. RL1 tells how to assign the arguments when the procedure is called.
  2. Size of RL2 is always .l.
  3. The exit point of the procedure is marked with a label to allow forced exiting.
  4. Normally procedure labels are global (regardless of the prefix character chosen); if loc: is declared, the procedure definition will be local, i.e. its labels will start with '.'.
  5. NAME can be up to 30 characters long.
  6. Do not put a label on the same line of procedure....
  7. Repetition of procedure names is not checked.
  8. Brackets are used in place of parentheses for uniformity with functions.


EXAMPLE 1

ESA
           procedure loc:WaitMouse[]
.w         btst.b     #6,$bfe001
           bne.s      .w
           eproc
assembly
.0000000
.w         btst.b     #6,$bfe001
           bne.s      .w
.0000001   rts


EXAMPLE 2

ESA
           procedure SlowClr[a0/d0.b],a0/d1
           move.l     d0,d1
           lsr.l      #2,d1
           subq.l     #1,d1
.c         clr.l      (a0)+
           dbra       d1,.c
           eproc
assembly
p0000000   movem.l    a0/d1,-(sp)      ;store RL2 registers
           move.l     d0,d1
           lsr.l      #2,d1
           subq.l     #1,d1
.c         clr.l      (a0)+
           dbra       d1,.c
p0000001   movem.l    (sp)+,a0/d1      ;restore registers
           rts



home