add N@ and N! to transfer a group of cells to or from memory

This commit is contained in:
Jesse D. McDonald 2020-10-23 23:31:11 -05:00
parent 92d806298b
commit 15fa156d02
1 changed files with 24 additions and 0 deletions

View File

@ -843,6 +843,30 @@ defcode FILL
rep stosb rep stosb
NEXT 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) */ /* ( src dst n -- ) Block copy n bytes from src to dst (ascending addresses) */
defcode CMOVE defcode CMOVE
mov %esi,%edx mov %esi,%edx