From 15fa156d026a929686985303951f9d4f03337cca Mon Sep 17 00:00:00 2001 From: Jesse McDonald Date: Fri, 23 Oct 2020 23:31:11 -0500 Subject: [PATCH] add N@ and N! to transfer a group of cells to or from memory --- jumpforth.S | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/jumpforth.S b/jumpforth.S index bdabb8d..9c198f0 100644 --- a/jumpforth.S +++ b/jumpforth.S @@ -843,6 +843,30 @@ defcode FILL rep stosb NEXT +/* ( xu ... x1 n a-addr -- ) Store x1 through xn in ascending cells at a-addr */ +defcode NSTORE,"N!" + mov %esi,%edx + pop %edi + pop %ecx + mov %esp,%esi + lea (%esp,%ecx,4),%esp + rep movsd + mov %edx,%esi + NEXT + +/* ( n a-addr -- xu ... x1 ) Load x1 through xn from ascending cells at a-addr */ +defcode NFETCH,"N@" + mov %esi,%edx + pop %esi + pop %ecx + mov %ecx,%ebx + neg %ebx + lea (%esp,%ebx,4),%esp + mov %esp,%edi + rep movsd + mov %edx,%esi + NEXT + /* ( src dst n -- ) Block copy n bytes from src to dst (ascending addresses) */ defcode CMOVE mov %esi,%edx