|
From: pito <pi...@vo...> - 2010-07-06 23:16:17
|
Hi friends, I've found 2constant in lib but I cannot find 2variable in
the libraries. Is that word available in amforth 4.0? I'm going to redo
a routine I'm using in my PIC dev for a quite precise 1sec tick:
int32 Ticker;
TIMER2_FREQUENCY 19999870 (in Hz=xtal freq when atmega, /4 when pic)
#int_TIMER2
void TIMER2_isr()
{
Ticker -= 65536; // Decrement ticker by clocks
per interrupt (16bit timer), or 256*prescaler when atmega32 and timer2
if ( Ticker < 65536 ) // If second has expired
{ Ticker += TIMER1_FREQUENCY; // Increment ticker by clocks
per second
Seconds++; // Increment number of seconds
}
The 2variable is required for higher precision. Any help where to find
2variable?
Pito.
|
|
From: pito <pi...@vo...> - 2010-07-07 13:59:40
|
I am trying with:
: 2variable ( "name" -- ) create 0 , 0 , ;
It seems the 2constant and 2variable needs the number entered as:
w_low w_high 2constant dollars ( w_high*2^16 + w_low )
2variable euro
w_low w_high euro 2!
Does Amforth know somehow to compile double cell input? E.g.:
123456789 @constant dollars
98765432 euro 2!
Pito
----- PŮVODNÍ ZPRÁVA -----
Od: "pito" <pi...@vo...>
Komu: amf...@li...
Předmět: [Amforth-devel] 2variable
Datum: 7.7.2010 - 1:16:07
> Hi friends, I've found 2constant in lib but I cannot
> find 2variable in
> the libraries. Is that word available in amforth 4.0?
> I'm going to redo
> a routine I'm using in my PIC dev for a quite precise
> 1sec tick:
> int32 Ticker;
> TIMER2_FREQUENCY 19999870 (in Hz=xtal freq when atmega,
> /4 when pic)
> #int_TIMER2
> void TIMER2_isr()
> {
> Ticker -= 65536; // Decrement
> ticker by clocks
> per interrupt (16bit timer), or 256*prescaler when
> atmega32 and timer2
>
> if ( Ticker < 65536 ) // If second
> has expired
> { Ticker += TIMER1_FREQUENCY; // Increment
> ticker by clocks
> per second
> Seconds++; // Increment
> number of seconds
>
> }
>
> The 2variable is required for higher precision. Any
> help where to find
> 2variable?
> Pito.
>
>
>
>
>
> ------------------------------------------------------------------------------
> > This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Amforth-devel mailing list
> Amf...@li...
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
|
|
From: pito <pi...@vo...> - 2010-07-07 14:17:00
|
google knows - trailing dot.....:
> 2variable euro1
ok
> 1300200100. 2constant euro2
ok
> 1300200100. euro1 2!
ok
> euro2 euro1 2@ d+ ud.
2600400200 ok
> Pito
----- PŮVODNÍ ZPRÁVA -----
Od: "pito" <pi...@vo...>
Komu: pi...@vo..., amf...@li...
Předmět: Re: [Amforth-devel] 2variable
Datum: 7.7.2010 - 15:38:07
> I am trying with:
>
> : 2variable ( "name" -- ) create 0 , 0 , ;
>
> It seems the 2constant and 2variable needs the number
> entered as:
>
> w_low w_high 2constant dollars ( w_high*2^16 + w_low
> )
>
> 2variable euro
> w_low w_high euro 2!
>
> Does Amforth know somehow to compile double cell input?
> E.g.:
>
> 123456789 @constant dollars
> 98765432 euro 2!
>
> Pito
>
>
>
>
> ----- PŮVODNÍ ZPRÁVA -----
> Od: "pito" <pi...@vo...>
> Komu: amf...@li...
> Předmět: [Amforth-devel] 2variable
> Datum: 7.7.2010 - 1:16:07
>
> > Hi friends, I've found 2constant in lib but I cannot
> > > find 2variable in
> > the libraries. Is that word available in amforth
> > 4.0?
> > > I'm going to redo
> > a routine I'm using in my PIC dev for a quite precise
> > > 1sec tick:
> > int32 Ticker;
> > TIMER2_FREQUENCY 19999870 (in Hz=xtal freq when atmega,
> > > /4 when pic)
> > #int_TIMER2
> > void TIMER2_isr()
> > {
> > Ticker -= 65536; // Decrement
> > > ticker by clocks
> > per interrupt (16bit timer), or 256*prescaler when
> > > atmega32 and timer2
> >
> > if ( Ticker < 65536 ) // If second
> > > has expired
> > { Ticker += TIMER1_FREQUENCY; // Increment
> > > ticker by clocks
> > per second
> > Seconds++; // Increment
> > > number of seconds
> >
> > }
> >
> > The 2variable is required for higher precision. Any
> > > help where to find
> > 2variable?
> > Pito.
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------------
> > > > > > This SF.net email is sponsored by Sprint
> > What will you do first with EVO, the first 4G phone?
> > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> > > _______________________________________________
> > Amforth-devel mailing list
> > Amf...@li...
> > https://lists.sourceforge.net/lists/listinfo/amforth-devel
> >
>
|
|
From: Matthias T. <mt...@we...> - 2010-07-07 18:54:58
|
Am Mittwoch, den 07.07.2010, 01:16 +0200 schrieb pito:
> Hi friends, I've found 2constant in lib but I cannot find 2variable in
> the libraries. Is that word available in amforth 4.0?
basically yes, but you need to load the file lib/ans94/2x.frt and use
the following definition as well
: 2variable
here 2 cells allot constant
;
Matthias
PS: I need some more time to read your remaining emails, the higgs boson
has to wait slightly longer...
|
|
From: pito <pi...@vo...> - 2010-07-07 19:24:40
|
I've used other 2variable definition, it works as well (hopefully). The Higgs boson is waiting for 14billion years, so let him wait.. Pito ----- PŮVODNÍ ZPRÁVA ----- Od: "Matthias Trute" <mt...@we...> Komu: "Everything around amforth" <amf...@li...> Předmět: Re: [Amforth-devel] 2variable Datum: 7.7.2010 - 20:54:48 > Am Mittwoch, den 07.07.2010, 01:16 +0200 schrieb pito: > > > Hi friends, I've found 2constant in lib but I cannot > > find 2variable in > > > the libraries. Is that word available in amforth > > 4.0? > > > basically yes, but you need to load the file lib/ans94/2x.frt > and use > the following definition as well > > : 2variable > here 2 cells allot constant > ; > > Matthias > > PS: I need some more time to read your remaining emails, > the higgs boson > has to wait slightly longer... > |