diff --git a/arch/arm/ext.S b/arch/arm/ext.S index ffb0301..5edc3e7 100644 --- a/arch/arm/ext.S +++ b/arch/arm/ext.S @@ -87,3 +87,8 @@ defprimitive "over",4,over,REGULAR defprimitive "time",4,time,REGULAR /* ( -- unixtime ) */ push {r0} NEXT + +defprimitive "r@",2,rfetch,REGULAR + ldr r0, [r6] + push {r0} + NEXT diff --git a/generic/forth/test.forth b/generic/forth/test.forth index c334bc2..c0c312b 100644 --- a/generic/forth/test.forth +++ b/generic/forth/test.forth @@ -391,6 +391,10 @@ marker: -test-mark -test-mark dp dp-before-mark @ =assert ; +: test:r@ + 123 >r r@ 123 =assert r> drop + -34 >r r@ -34 =assert r> drop ; + depth 0= assert test depth 0= assert