From: Kalus M. <mic...@on...> - 2010-09-30 19:07:37
|
Hi Pito. >float is an assembler defined word, or is it colon definition? http://www.bradrodriguez.com/papers/moving6.htm: COMPILER OPERATION "... Also, : will HIDE the new word, and ; will REVEAL it (by setting and clearing the "smudge" bit in the name). This is to allow a Forth word to be redefined in terms of its "prior self"." What amforth-4.2 does to hide a word during compilation, and reveal it on completion of definition, is setting a noname variable in ram internaly called COLON_SMUDGE. While DP proceeds while compiling, content of COLON_SMUDGE does not. When the definition is complete, you fetch content of COLON_SMUDGE and store it to the current pointer. Now the last defined word gets revealed. Its basicaly this (is this true Mathias?): variable colon_smudge ... dp colon_smudge ! code: <name> {..code..} end_code colon_smudge @ get-current ! Since COLON_SMUDGE is noname, try this work around. Include smudge.asm in your dict_appl.inc - this is what has to go into smudge.asm: VE_SMUDGE: .dw $ff06 .db "smudge" .dw VE_HEAD .set VE_HEAD = VE_SMUDGE XT_SMUDGE: .dw DO_COLON PFA_SMUDGE: .dw XT_DOLITERAL .dw COLON_SMUDGE .dw XT_FETCH .dw XT_GET_CURRENT .dw XT_ESTORE .dw XT_EXIT Then code your >float and execute smudge thereafter. Use smuge after every code definition. Maybe we should put it into the end-code word. Hope it does the job and you find your >float then. Michael Am 30.09.2010 um 20:37 schrieb Matthias Trute: > hi, > >> Hi Pito. >> >> If >float is assembler defined and closed with something like end- >> code, this end-code has to smudge the definition the same way ; >> (semicolon) does it. > >> float is forth code. (http://github.com/lnmaurer/amforth-float ) > >> It has been a long standing claim that a definition may not be found >> until it is finished. So setting the "smudgebit" is last thing to do. >> amforth4.2 has this behavior now. Maybe you found a side effect of >> this new behaviour. But there shoud be some kind of "smudge" word to >> solve this problem then. > > what should that smudge do? if you want to use the word currently > beeing defined, use recurse, after the ; the new name will be visible > anyway. btw: there is no smudge bit in amforth. > > > Matthias > > > > ---------------------------------------------------------------------- > -------- > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |