Update of /cvsroot/win32forth/win32forth-stc/src/kernel
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17159/src/kernel
Modified Files:
gkernel.f
Log Message:
arm: chnages to support forth200x, add lastchar and -trailchar to kernel
Index: gkernel.f
===================================================================
RCS file: /cvsroot/win32forth/win32forth-stc/src/kernel/gkernel.f,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** gkernel.f 12 Jul 2007 21:00:18 -0000 1.42
--- gkernel.f 17 Aug 2007 02:57:20 -0000 1.43
***************
*** 1601,1604 ****
--- 1601,1609 ----
mov eax, ecx
next;
+
+ code lastchar ( str -- char ) \ returns last character from c-string
+ movzx ecx, byte [eax]
+ movzx eax, byte [eax] [ecx]
+ next c;
\ --------------------------- Perform ---------------------------------------
***************
*** 1939,1943 ****
: -trailing ( addr n1 -- addr n2 ) \ remove trailing blanks from addr,n1
bl -trailchars ;
!
: -nulls ( addr n1 -- addr n2 ) \ remove trailing nulls from addr,n1
0 -trailchars ;
--- 1944,1948 ----
: -trailing ( addr n1 -- addr n2 ) \ remove trailing blanks from addr,n1
bl -trailchars ;
!
: -nulls ( addr n1 -- addr n2 ) \ remove trailing nulls from addr,n1
0 -trailchars ;
***************
*** 2400,2405 ****
then ;
: unnest ( -- ) \ generate a return
! $c3 code-c, ; immediate
\ -------------------- Various support words --------------------------
--- 2405,2416 ----
then ;
+ gcode _unnest \ ret code (compile)
+ ret
+ ;g
+
: unnest ( -- ) \ generate a return
! (comp-only)
! compilation> drop
! _unnest (copy-code) ;
\ -------------------- Various support words --------------------------
***************
*** 3249,3253 ****
code >number ( ud addr len -- ud addr len )
! 3 3 in/out
test eax, eax \ check if anything to convert
je short @@4 \ zero, so skip
--- 3260,3264 ----
code >number ( ud addr len -- ud addr len )
! 4 4 in/out
test eax, eax \ check if anything to convert
je short @@4 \ zero, so skip
***************
*** 3267,3276 ****
cmp eax, edi
jae short @@3 \ out of base range
- \ xchg eax, 4 [ebp] \ high word * base
mov edx, eax
mov eax, 4 [ebp] \ swap eax <-> 4 [ebp]
mov 4 [ebp], edx
mul edi
- \ xchg eax, 8 [ebp] \ low word * base
mov edx, eax
mov eax, 8 [ebp] \ swap eax <-> 8 [ebp]
--- 3278,3285 ----
***************
*** 4262,4266 ****
dup code-here swap - swap cell- ! ;
: >resolve ( dest -- ) \ fixup relative jump to dest
- sync-code
code-here - code-here cell- ! ;
--- 4271,4274 ----
***************
*** 4578,4582 ****
\ EXIT compiles __LOCALFREE, but leaves LOCALSTK alone so that ; can
! \ also compile __LOCALFREE
: exit ( -- ) \ exit current word
--- 4586,4590 ----
\ EXIT compiles __LOCALFREE, but leaves LOCALSTK alone so that ; can
! \ also compile __LOCALFREE
: exit ( -- ) \ exit current word
|