Update of /cvsroot/win32forth/win32forth/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21560/src
Modified Files:
CALLBACK.f
Log Message:
arm: Extended callback to allow 19 callback args (!)
Index: CALLBACK.f
===================================================================
RCS file: /cvsroot/win32forth/win32forth/src/CALLBACK.f,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CALLBACK.f 2 Jan 2005 23:04:55 -0000 1.2
--- CALLBACK.f 15 Aug 2005 19:46:39 -0000 1.3
***************
*** 3,6 ****
--- 3,7 ----
\ CALLBACK.F Windows Callback support by Tom Zimmer
\ arm 21/12/2004 21:21:09 Callback support -- moved out of kernel
+ \ arm 15/08/2005 20:01:54 n callback -- n is now max of 19 args
cr .( Loading Windows Callback...)
***************
*** 35,38 ****
--- 36,51 ----
ret 6 cells
ret 7 cells
+ ret 8 cells
+ ret 9 cells
+ ret 10 cells
+ ret 11 cells
+ ret 12 cells
+ ret 13 cells
+ ret 14 cells
+ ret 15 cells
+ ret 16 cells
+ ret 17 cells
+ ret 18 cells
+ ret 19 cells
c;
***************
*** 51,62 ****
and esp, # -16 \ align to 16 byte boundary
mov SP0 [UP] , esp \ reset SP0
!
! lea ebx, [ebp] [ecx*4] \ adjust ebx
neg ecx \ negate ecx
lea ecx, 1234 [ecx] [ecx*2] \ calculate jump offset (4 byte lea version!)
a; code-here cell- \ point at the offset (the 1234) in lea
jmp ecx \ and leap...
! a; code-here 7 3 * + swap ! \ correct the lea calculation
! push ( 0 cells) [ebx] nop \ 7 callback, nop for short from
push 1 cells [ebx] \ all entries 3 bytes
push 2 cells [ebx]
--- 64,75 ----
and esp, # -16 \ align to 16 byte boundary
mov SP0 [UP] , esp \ reset SP0
!
! lea ebx, 7 19 - cells [ebp] [ecx*4] \ adjust ebx
neg ecx \ negate ecx
lea ecx, 1234 [ecx] [ecx*2] \ calculate jump offset (4 byte lea version!)
a; code-here cell- \ point at the offset (the 1234) in lea
jmp ecx \ and leap...
! a; code-here 19 3 * + swap ! \ correct the lea calculation
! push ( 0 cells) [ebx] nop \ 19 callback, nop for short from
push 1 cells [ebx] \ all entries 3 bytes
push 2 cells [ebx]
***************
*** 64,68 ****
push 4 cells [ebx]
push 5 cells [ebx] \ 2 callback
! push 6 cells [ebx] \ 1 callback
pop ebx \ 0 callback -- recover ebx
--- 77,93 ----
push 4 cells [ebx]
push 5 cells [ebx] \ 2 callback
! push 6 cells [ebx]
! push 7 cells [ebx]
! push 8 cells [ebx]
! push 9 cells [ebx]
! push 10 cells [ebx]
! push 11 cells [ebx]
! push 12 cells [ebx]
! push 13 cells [ebx]
! push 14 cells [ebx]
! push 15 cells [ebx]
! push 16 cells [ebx]
! push 17 cells [ebx] \ 2 callback
! push 18 cells [ebx] \ 1 callback
pop ebx \ 0 callback -- recover ebx
***************
*** 77,80 ****
--- 102,106 ----
: BUILD-CALLBACK ( n1 -- a1 a2 ) \ define a callback procedure
+ dup 20 0 within abort" arg value too large for callback"
>r \ generated via macro[ ]macro
code-here \ func address (a1)
|