Hi Jan.

CREATE is not statesmart. Use XT_CREATE inside a definition.
Outside a definition CREATE will work.

You have to use _HEX (with a preceeding underscore) in the source to  
switch to hex, otherwise you get a translation of the word "HEX" to  
asm. And append BYE at the end of file, forth will return to command  
line then.

Modified file and resulting file is appended.
Michael

PS: Pito is right, for a real app an assembled version is faster.
m
-------------- next part --------------






Am 18.06.2012 um 16:02 schrieb Jan Kromhout:

>
> Dear Michael,
>
> I try to convert the lib bitnames.frt.
> See the results here.
> There is going sommething wrong, but get not the finger behand it.
> I have used the latest version.
> Please can you take a look?
>
> Cheers,
>
> Jan
>
> FLOAD '\\psf\Home\Documents\amforth-4.8\amforth-4.8\lib\bitnames.frt'
> ; V 1.3 02.11.2007
> ; Code: Matthias Trute
> ; Text: M.Kalus
> ; A named port pin puts a bitmask on stack, wherin the set bit  
> indicates which
> ; bit of the port register corresponds to the pin.
> ; And then puts the address of its port on stack too.
> ; Use it this way:
> ; PORTD 7 portpin: PD.7  ( define portD pin #7)
> ; PD.7 high              ( turn portD pin #7 on, i.e. set it high- 
> level)
> ; PD.7 low               ( turn portD pin #7 off, i.e. set it low- 
> level)
> ; PD.7 <ms> pulse        ( turn portD pin #7 for <ms> high and low)
> ; the following words are for "real" IO pins only
> ; PD.7 pin_output        ( set DDRD so that portD pin #7 is output)
> ; PD.7 pin_input         ( set DDRD so that portD pin #7 is input)
> ; PD.7 pin_high?         ( true if pinD pin #7 is high)
> ; PD.7 pin_low?          ( true if pinD pin #7 is low)
> ;
> ; multi bit operation
> ; PORTD F portpin PD.F   ( define the lower nibble of port d )
> ; PD.F pin@              ( get the lower nibble bits )
> ; 5 PD.F pin!            ( put the lower nibble bits, do not change  
> the others )
>     .dw XT_HEX
> ; At compiletime:
> ; Store combination of portaddress and bit number in a cell and  
> give it a name.
> ; At runtime:
> ; Get pinmask and portaddress on stack.
> VE_PORTPIN::
>     .dw $FF08
>     .db "PORTPIN:"
>     .dw VE_HEAD
>     .set VE_HEAD = VE_PORTPIN:
> XT_PORTPIN::
>     .dw DO_COLON
> PFA_PORTPIN::
> : portpin: create ( C: "ccc" portadr n -- ) ( R: -- pinmask portadr )
>                   ^
> Warning(-4100): ( is redefined in file \\PSF\HOME\DOCUMENTS 
> \AMFORTH-4.8\AMFORTH-4.8\LIB\BITNAMES.
> RT at line 32
> ; create:
> VE_(:
>     .dw $FF01
>     .db "(",0
>     .dw VE_HEAD
>     .set VE_HEAD = VE_(
> XT_(:
>     .dw PFA_DOCONSTANT
> PFA_(:
> : portpin: create ( C: "ccc" portadr n -- ) ( R: -- pinmask portadr )
>                        ^^^^^
> Error(-13): "CCC" is undefined in file \\PSF\HOME\DOCUMENTS 
> \AMFORTH-4.8\AMFORTH-4.8\LIB\BITNAMES.
> RT at line 32
>
>
>
>
>
>
>
>> Date: Sun, 17 Jun 2012 23:21:59 +0200
>> From: mik.ka...@googlemail.com
>> To: amforth-devel@lists.sourceforge.net
>> Subject: Re: [Amforth] Where to store my word?
>>
>> Hi Jan.
>> ..
>>> I also not find the win32 forth version any more!
>>> Please can you take a look!
>>
>> Its still there and updated:
>> http://www.forth-ev.de/repos/g4/g4w32f.fs
>>
>> m
>>
>> --------------------------------------------------------------------- 
>> ---------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond.  
>> Discussions
>> will include endpoint security, mobile security and the latest in  
>> malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Amforth-devel mailing list for http://amforth.sf.net/
>> Amforth-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/amforth-devel
>                                       
> ---------------------------------------------------------------------- 
> --------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond.  
> Discussions
> will include endpoint security, mobile security and the latest in  
> malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to