6c123cfad61406bd5549c66dae164c4e224c9308
[rrq/rrqforth.git] / adoc / p_2swap.adoc
1 // stack.asm:   WORD p_2swap, '2SWAP',fasm
2
3 anchor:p_2swap[]
4
5 === Word: 2SWAP
6
7 ....
8 Data stack: ( v1 v2 v3 v4 -- v3 v4 v1 v2 )
9 ....
10
11 "2SWAP" is a function word the reorgnizes the top 4 cells swappping
12 the upper and lower pair. This is similar to <<p_swap,SWAP>> but
13 working with cell pairs rather than single cells.
14
15 ====
16 .Word: 2SWAP
17 [caption='Definition concept {counter:exec}: ']
18 ----
19 : 2SWAP 3 ROLL 3 ROOL ;
20 ----
21 ====