Hi.
Recently someone asked how otherwise imported subroutines (c-code)  
can be used by amforth.
You may use icall of AVR instruction set to do so.
Include icall.asm example in your application to test it.
Add more stack to register moves if necessary for a given subroutine.

Michael



; ( adr -- )
; R( -- )
; use icall to execute a code subroutine
; operation: PC <-- Z  and push PC+1 to returnstack.
VE_ICALL:
     .dw $ff05
     .db "icall",0
     .dw VE_HEAD
     .set VE_HEAD = VE_ICALL
XT_ICALL:
     .dw PFA_ICALL
PFA_ICALL:
     movw zl,tosl
     loadtos
     icall
     jmp DO_NEXT

; to test icall make a subroutine:
subdup:
     savetos
     ret
subdrop:
     loadtos
     ret


------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Amforth-devel mailing list
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to