Code A@  ax push  op ax mov  Next end-code macro :ax 0 T&P
Code A!  ax op mov  ax pop   Next end-code macro 0 :ax T&P
Code A@+  ax push op ) ax mov  cell # op add next end-code macro :ax 0 T&P
Code A!+  ax op ) mov  cell # op add  ax pop next end-code macro 0 :ax T&P

USER _B
Code B@  ax push  user' _B UP D) ax mov  Next end-code macro :ax 0 T&P
Code B!  ax user' _B UP D) mov  ax pop   Next end-code macro 0 :ax T&P
Code B@+  ax push user' _B UP D) dx mov dx ) ax mov
    cell # dx add dx user' _B UP D) mov next end-code macro :ax 0 T&P
Code B!+  user' _B UP D) dx mov ax dx ) mov
    cell # dx add dx user' _B UP D) mov ax pop next end-code macro :ax 0 T&P

1 [IF] #256   
[ELSE] #65536
[THEN] CONSTANT size

CREATE area1 size CELLS ALLOT
CREATE area2 size CELLS ALLOT

: PROCESS-DIRECT ( -- )
        size 0 DO  area1 I CELLS + @
                   7 * #33 +  #6996 MAX
                   area2 I CELLS + !
             LOOP ; 

: PROCESS-LOCALS ( -- )
        area1 area2 LOCALS| B@ A@ |
        size 0 DO  A@ I CELLS + @
                   7 * #33 +  #6996 MAX
                   B@ I CELLS + !
             LOOP ; 

: PROCESS-PARAMS ( -- )
        area1 area2 { A@ B@ }
        size 0 DO  A@ I CELLS + @
                   7 * #33 +  #6996 MAX
                   B@ I CELLS + !
             LOOP ; 

: PROCESS-STACK1 ( -- )
        area1 area2 
        size 0 DO  OVER I CELLS + @
                   7 * #33 +  #6996 MAX
                   OVER I CELLS + !
             LOOP 
        2DROP ; 

: PROCESS-STACK2 ( -- )
        area1 area2 
        size 0 DO  SWAP @+ swap
                   7 * #33 +  #6996 MAX
                   ROT !+
             LOOP 
        2DROP ; 

: PROCESS-A/B ( -- )
        area1 A!
        area2 B!
        size 0 DO  A@+
                   7 * #33 +  #6996 MAX
                   B!+
             LOOP ; 

: TEST-A/B ( -- )
        #25600000 size / { #times }
        CR ." Testing with size = " size .
        CR ." process (params) : " !time #times 0 ?DO  PROCESS-PARAMS  LOOP .time 
        CR ." process (direct) : " !time #times 0 ?DO  PROCESS-DIRECT  LOOP .time 
        CR ." process (locals) : " !time #times 0 ?DO  PROCESS-LOCALS  LOOP .time 
        CR ." process (stack1) : " !time #times 0 ?DO  PROCESS-STACK1  LOOP .time 
        CR ." process (stack2) : " !time #times 0 ?DO  PROCESS-STACK2  LOOP .time 
        CR ." process (A/B)    : " !time #times 0 ?DO  PROCESS-A/B     LOOP .time ;

: .ABOUT CR ." Try: TEST-A/B" ;

.ABOUT
