40 lines
862 B
Tal
40 lines
862 B
Tal
( stack.tal )
|
|
( )
|
|
|
|
@swap32 ( x** y** -> y** x** )
|
|
STH2 ROT2 ROT2
|
|
STH2r ROT2 ROT2 JMP2r
|
|
|
|
@over32 ( x** y** -> x** y** x** )
|
|
STH2 STH2 OVR2 OVR2
|
|
STH2r STH2r ;swap32 JSR2 JMP2r
|
|
|
|
@rotate32 ( x** y** z** -> y** z** x** )
|
|
STH2 STH2 ;swap32 JSR2
|
|
STH2r STH2r ;swap32 JSR2 JMP2r
|
|
|
|
@rev-rotate32 ( x** y** z** -> z** x** y** )
|
|
;swap32 JSR2 STH2 STH2
|
|
;swap32 JSR2 STH2r STH2r JMP2r
|
|
|
|
@pop32 ( x** -> )
|
|
POP2 POP2 JMP2r
|
|
|
|
@store-abs32 ( x** addr* -> )
|
|
STH2k #0002 ADD2 STA2 STH2r STA2 JMP2r
|
|
|
|
@load-abs32 ( addr* -> x** )
|
|
STH2k LDA2 STH2r #0002 ADD2 LDA2 JMP2r
|
|
|
|
@store-rel32 ( x** rel^ -> )
|
|
STHk #02 ADD STR2 STHr STR2 JMP2r
|
|
|
|
@load-rel32 ( rel^ -> x** )
|
|
STHk LDR2 STHr #02 ADD LDR2 JMP2r
|
|
|
|
@store-zero32 ( x** addr^ -> )
|
|
STHk #02 ADD STZ2 STHr STZ2 JMP2r
|
|
|
|
@load-zero32 ( addr^ -> x** )
|
|
STHk LDZ2 STHr #02 ADD LDZ2 JMP2r
|