|
From: pito <pi...@vo...> - 2010-09-11 07:50:09
|
Marcin, thanks!
> First, I am assuming that "Luboš assembler" is a
> set of words
> from the lib/assembler.frt file in the amforth
> distribution.
> Is this correct?
Yes
> (I don't understand this - what is your "header"
> etc.)
E.g.:
; ( n1 -- n2 ) Arithmetics
; R( -- )
; optimized increment
VE_1PLUS:
.dw $ff02
.db "1+"
.dw VE_HEAD
.set VE_HEAD = VE_1PLUS
XT_1PLUS:
.dw PFA_1PLUS
PFA_1PLUS:
> If you want to return only one cell ("y") you need
> just to set the
> TOS in tosh:tosl register pair. No need to use
> savetos.
tosh:tosl contains the value - you need to execute st -Y, rx to
write it to ram, don'you?
> First, from what I understand - Matthias please
> correct me if I am
> wrong - the "code" word creates a new word for you
> but
> it does not switch FORTH into the compilation mode
> (unlike ":"
> or "]").
>
M?
> I don't know - where does assembler use Z?
Lubos is using Z in his assembler source e.g.
code high ( pinmask portadr -- )
\ dup c@ rot or swap c! \ replaced by assembler
ZL TOSL movw, \ tos->z
R16 Z ld, \ addr c@
loadtos, \ delete portadr
R16 TOSL or, \ or pinmask
Z R16 st, \ c!
loadtos, \ delete pinmask
end-code
> Please feel free to "allot" something and use
> that.
> There is also "pad" available as well.
>From my assembler source, how? Or it shall be done before?
> I am not sure whether the code is correct in
> assembler.frt -
> it uses "here" to indicated labels in the code,
> where
> it should probably use "dp" (dictionary pointer) -
> due to
> RAM (last position pointed to by "here", advanced
> by "allot") and dictionary
> in flash (managed by "dp", advanced by comma) are
> different thing
> in amforth.
M?
> Use "here" and "allot".
>From asm sorce?
> Of course you can use it. It's what "push" and
> "pop" do.
So when calling within an asm source properly I will not destroy
Rstack, it means it will stay as before I executed my asm?
> You do not need "rjmp DO_NEXT" (or most probably
> "jmp DO_NEXT")
> if using "end-code" word ($940c and DO_NEXT
> address will be
> compiled - see "end-code.asm").
I meant normal asm (L.asm=lubos's forth asm asm-normal asm)
> I don't know what kind of portability you mean.
When writing _any_ "words" (e.g. fuX) in asm. Portability means use
ANS forth words only..
> I was
> thinking
> about uploading .hex files or even ready-to-run
> object
Yes this is exactly what I am talking about..
Pito
|