Hi Matthias.
...
> There is currently no
> way to switch between forth and machine code (that would
> be ;CODE btw)
You may go from low to high level and back:
code <name>
(some code)
; -- jump to high level:
ldi XL,low(pfa_forthISR)
ldi XH,high(pfa_forthISR)
jmp DO_NEXT
pfa_forthISR:
.dw XT_MAINWORD
; -- back to low level:
.dw PC+1 ; next IP
.dw PC+1 ; next cfa
(more code )
end-code
But be shure to save all registers you use if you do so.
---
Enochs code is a macro, assembling one single instruction SBI into
dictionary and naming it.
Calling that word will execute the SBI instruction.
Michael
Am 14.02.2013 um 20:14 schrieb Matthias Trute:
> hi Enoch,
>
>
>> I'd like to see this forum also offering code snippets, so here's my
>> first humble attempt of harnessing the atomic bit manipulation
>> instructions.
>>
>> : port:hi ( portadr bitno -- ) \ SBI
>> swap $20 - 3 lshift or $9A00 or code , end-code
>
> Did you actually test this code? CODE is a parsing word
> that starts a new dictionary entry. There is currently no
> way to switch between forth and machine code (that would
> be ;CODE btw)
>
> Puzzled
> Matthias
>
>
> ----------------------------------------------------------------------
> --------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Amforth-devel mailing list for http://amforth.sf.net/
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
[email protected]
https://lists.sourceforge.net/lists/listinfo/amforth-devel