pop


SYNTAX

"pop"[SIZE:jsize]


MEANING

Forces the exit from the procedure/function it is called from.


NOTES

  1. SIZE is the size to be used for the bra jump (default: none).
  2. Make sure that sp is the same of when the procedure/function was entered.


EXAMPLE 1

ESA
           procedure UpperCase[a0/d0],d0-d1/a0
           IFNE       TEST_ON
           pop.s
           ENDIF
           moveq.l    #$df,d1
           subq.l     #1,d0
           expire d0=d0
            and.b      d1,(a0)+
           nexp,eq
           eproc
assembly
p0000000   movem.l    d0-d1/a0,-(sp)
           IFNE       TEST_ON
           bra.s      p0000001
           ENDIF
           moveq.l    #$df,d1
           subq.l     #1,d0

.0000002
           and.b      d1,(a0)+
           dbeq       d0,.0000002
p0000001   movem.l    (sp)+,d0-d1/a0
           rts


EXAMPLE 2

ESA
           procedure StrangePlot[a0],d0-d1/a0

           expire d0=#199
            move.b    fx[d0],(a0)+
           nexp

           pop                         ;skip fx[]

           function loc:fx[d1]:d1
           mulu.w     d1,d1
           eori.l     RndSeed,d1
           efunc

           eproc
assembly
p0000000   movem.l    d0-d1/a0,-(sp)

           move.w     #199,d0
.0000004
           move.l     d0,d1
           bsr        .0000002
           move.b     d1,(a0)+
           dbra       d0,.0000004

           bra        p0000001

.0000002
           mulu.w     d1,d1
           eori.l     RndSeed,d1
.0000003   rts

p0000001   movem.l    (sp)+,d0-d1/a0
           rts



home