~vertigo/forthbox

b1026ae7ea23ce68387af00c5b5b10e71a50c016 — Samuel A. Falvo II 4 months ago b64a40c
Introduce memory accessors for 16MB address space
2 files changed, 95 insertions(+), 0 deletions(-)

M sysf.disk0/sysf.lib0.s
M sysf.disk0/sysf.primitives.fs
M sysf.disk0/sysf.lib0.s => sysf.disk0/sysf.lib0.s +90 -0
@@ 802,6 802,96 @@ is_lt_zero:
	rts
.)


; !16M          ( n addrL addrH - )
prim_STO16M:	.xl
		.al
		lda 6,x
		sta 0
		lda 4,x
		sta 2
		lda 8,x
		sta [0]
		inx
		inx
		inx
		inx
		inx
		inx
		rts


; @16M		( addrL addrH - n )
prim_FET16M:	.xl
		.al
		lda 6,x
		sta 0
		lda 4,x
		sta 2
		lda [0]
		sta 6,x
		inx
		inx
		rts


; C!16M         ( n addrL addrH - )
prim_CSTO16M:	.xl
		.al
		lda 6,x
		sta 0
		lda 4,x
		sta 2
		lda 8,x
		_AS
		sta [0]
		_AL
		inx
		inx
		inx
		inx
		inx
		inx
		rts


; C@16M		( addrL addrH - n )
prim_CFET16M:	.xl
		.al
		lda 6,x
		sta 0
		lda 4,x
		sta 2
		_AS
		lda [0]
		_AL
		and #$00FF
		sta 6,x
		inx
		inx
		rts


; +!16M		( n addrL addrH -- )
prim_PLSSTO16M:	.xl
		.al
		lda 6,x
		sta 0
		lda 4,x
		sta 2
		clc
		lda [0]
		adc 8,x
		sta [0]
		inx
		inx
		inx
		inx
		inx
		inx
		rts


; This must be the last thing in this file.

#include "sysf.s"

M sysf.disk0/sysf.primitives.fs => sysf.disk0/sysf.primitives.fs +5 -0
@@ 29,6 29,11 @@ xname: TWOSL      2/
xname: UMSLASHMOD UM/MOD
xname: LTZERO     0<
xname: GEZERO     0>=
xname: CSTO16M    C!16M
xname: CFET16M    C@16M
xname: STO16M     !16M
xname: FET16M     @16M
xname: PLSSTO16M  +!16M

xname: DOVOC   (dovoc)