Re: [Amforth] AVR8 watchdog (reset and interrupt) atmega328p

2017-05-07 Thread MIchael Kalus
Müsste es dann nicht c!wd heißen?
Michael

2017-05-07 15:42 GMT+02:00 Matthias Trute :

> Hi Tristan,
>
> I've put your code online, revision 2252 contains the new
> file. There is only one change: I renamed the wd! into !wdc.
> It tells "store to watchdog control" and follows the more
> or less informal convention that ! and @ can be preceeded
> with size information and followed by location information.
> Just like c!e or @i. Hope that's ok for you.
>
> http://amforth.sourceforge.net/TG/recipes/Watchdog.html
>
> Thank you
> Matthias
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] New release 6.2

2016-07-04 Thread MIchael Kalus
Is there a link to a list of those strange behaving? May be of use beyond
amforth.
Michael
Am 04.07.2016 20:26 schrieb "Matthias Trute" :

> Hi,
>
> It's been a long time since the last release but some strange
> effects needed to be handled with the FRAM equipped MSP430 devices.
> They behave much like a diva and are worse than the fuses of the
> atmega's ;)
>
> Most of the changes are for the MSP430 devices, I started to learn
> the assembler programming for them. Some changes are for both
> platforms, details as usual on the homepage http://amforth.sourceforge.
> net/ The update from version 6.1 is recommended.
>
> Have fun
> Matthias
>
> --
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
>
--
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] My FM Radio Article

2015-12-21 Thread MIchael Kalus
And it was covered in Forth Magazin "Vierte Dimension"
4d2014-01.pdf

www.forth-ev.de  --> Menu: Download --> PDF-Archiv

Michael

2015-12-21 15:24 GMT+01:00 craig and heather :
> In case anyone is interested I also coded up the FM radio project in
> AmForth. It is available on my website here:
>
> craigandheather.net/misc/fm_receiver.zip
>
> --
> Craig Lindley
>
> New Recordings: craigandheather.net/cnmpage.html
> Latest rock CD: craigandheather.net/hellinahandbasket.html
> Latest non-rock CD: craigandheather.net/craigdoesfingerstyle.html
>
> Personal Website: craigandheather.net
>
> Phone: (719) 495-1873
> Cell: (719) 502-7925
>
> If you’re one in a million, there are now seven thousand people exactly
> like you.
> --
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] OT: Cycle accurate balanced assemly?

2015-11-04 Thread MIchael Kalus
Perhaps we should email?
mik.ka...@gmail.com
Am 04.11.2015 10:42 schrieb "Hannu Vuolasaho" :

>
>
> Michael wrote:
> >
> > ; Were'synced
> > ; calculate output part 1
> > ; wait 2300 cycles
> > ; Read inputs
> > ; Choose output port
> > ; calculate output part 2
> > ; 170 cycles after read write output
> >
> > This same routine runs parallel in 3 different MCUs?
> > So they have to be hardware synced.
> >
> > Make MCU0 the master, slaves are MCU1 and MCU2 then.
> >
> > MCU0 needs 2 sync-signal input port pins.
> >
> > MCU1+2 need 1 sync-signal output port pin.
> >
> > MCU1 and MCU2 need a ready input pin.
> >
> > When R is done, MCU1+2 set their sync signal port bit.
> >
> > Connect MCU2-sync-out --> MCU0-sync2-in
> > Connect MCU1-sync-out --> MCU0-sync1-in
> > Connect MCU0-ready-out --> MCU1+2-ready-in
> >
> > When Master MCU0 is ready, it pulls those incomming sync-bits until all
> > are set. Now master sets his ready port pin for MCU2 and MCU3. Now you
> > are synced again. Proceed...
> >
> > Is that what was on your mind?
>
> That was my first idea. There are two problems, mechanical space and
> isolation.
> The clock signal is optocoupler isolated and using more pins doesn't fit
> and
> decoupling more signals would also use too much space.
>
> However I'm trying to tackle this problem with simavr.
>
> If that doesn't help I'll wirite something which calculates time for me
> from source files.
>
> Hannu Vuolasaho
>
>
> --
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
>
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Is this a bug ?

2015-01-31 Thread MIchael Kalus
2015-01-31 20:27 GMT+01:00 Andrew Holt :
> : test ," Hello" cr ;

does amforth realy have a ," word? (komma-quote)

Try ."  instead (dot-quote)
mk

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth last week changes

2014-10-28 Thread MIchael Kalus
.-(

2014-10-29 0:02 GMT+01:00 Enoch :
> Hello Matthias,
>
> (1) I don't know what exactly isn't working but between trunk@1680 to
> trunk@1685 there is something that breaks my system badly. System
> reboots on almost any command line input...
>
> (2) Please explain why you changed the license in trunk@1687 from GPLv2
> to GPLv3. Correct me if I am wrong, it seems to me that you did not
> choose the "any later version" option of the GPLv3 (a constantly
> updating GPL). Until I grasp the full meaning of GPLv3, including
> your new expectations, you may be pleased to learn that you have
> managed to shake off your loyal shadow
> .
>
> (3) Regarding trunk@1675, I consider your removal of the warning from
> amforth-shell.py when it tries to append the file name to a non
> existant uploaded-wl wordlist even worse than the previous
> situation. I really don't undertstand why you are not providing this
> feature through a command line option.
>
> Sincerely, Enoch.
>
>
> --
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] R: Re: R: Re: R: Re: R: Re: HW flow control

2014-08-10 Thread Michael Kalus
Good luck for your project.
Michael

Am 10.08.2014 um 16:22 schrieb Paolo Garro:

> Hi Michael,
> The Matthias implementation handles flow control once for each line.
> That's ok for me.
> Perhaps XON XOFF are not the right names... The goal is to manage a  
> ready/busy flag.
> The canonical SW flow control might work different but also the  
> echo control is not a standard.
> Using both of these we can write a good serial (custom) interface.
> Com device must be used with NO flow control being our a SW level  
> infomation rather than a communication state.
>
> Paolo
>
> Inviato da Samsung Mobile
>
>  Original message 
> Subject: Re: [Amforth] R: Re:  R: Re:  R: Re:  HW flow control
> From: Michael Kalus 
> To: Everything around amforth 
> CC:
>
> Never forget: xon/xoff is for *single* character exchange - send one,
> get echo,  check it, send another one...
> Sender must interpret *each* echo character immediately and stop at
> xoff at once.
> Use xon/xoff to connect two amforth devices via TXD/RXD.
> Or on a PC use a sending tool able to do that. amforth shell is such
> a tool.
>
> If you send ascii to amforth using a terminal emulator on your PC via
> a USB-serial converter, forget xon/xoff.
>   There will be huge blocks of characters already send to the
> pipeline of USB, overrunning your forth target, before any terminal
> emulator will notice the xoff.
>
> Or do you have a USB-serial converter that handles xon/xoff ?
>
> Michael
>
>
>
> Am 10.08.2014 um 14:34 schrieb Paolo Garro:
>
>> Hi Matthias,
>> Does REFILL load a single line?
>> In a multiline colon definition is it called for each line?
>> If so I think the best place to handle XON/XOFF is QUIT itself.
>> At the begin of the loop after calling REFILL assert XOFF and
>> before closing the loop assert XON.
>> That way transmission is blocked while the interpreter is working
>> including the case of an error answer (xxx ?? -nn nn) and, on the
>> other side, I will receive an XON at the end of each answer.
>>
>> Paolo
>>
>> Inviato da Samsung Mobilenull
>> - 
>> -
>> 
>> ___
>> Amforth-devel mailing list for http://amforth.sf.net/
>> Amforth-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/amforth-devel
>
>
> -- 
> 
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
> -- 
> 
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] R: Re: R: Re: R: Re: HW flow control

2014-08-10 Thread Michael Kalus
Never forget: xon/xoff is for *single* character exchange - send one,  
get echo,  check it, send another one...
Sender must interpret *each* echo character immediately and stop at  
xoff at once.
Use xon/xoff to connect two amforth devices via TXD/RXD.
Or on a PC use a sending tool able to do that. amforth shell is such  
a tool.

If you send ascii to amforth using a terminal emulator on your PC via  
a USB-serial converter, forget xon/xoff.
  There will be huge blocks of characters already send to the  
pipeline of USB, overrunning your forth target, before any terminal  
emulator will notice the xoff.

Or do you have a USB-serial converter that handles xon/xoff ?

Michael



Am 10.08.2014 um 14:34 schrieb Paolo Garro:

> Hi Matthias,
> Does REFILL load a single line?
> In a multiline colon definition is it called for each line?
> If so I think the best place to handle XON/XOFF is QUIT itself.
> At the begin of the loop after calling REFILL assert XOFF and  
> before closing the loop assert XON.
> That way transmission is blocked while the interpreter is working  
> including the case of an error answer (xxx ?? -nn nn) and, on the  
> other side, I will receive an XON at the end of each answer.
>
> Paolo
>
> Inviato da Samsung Mobilenull
> -- 
> 
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] R: Adding WANT_X and a forth constant in asm (was: HW flow control)

2014-08-02 Thread Michael Kalus
Hi.
In 4e4th the PROMPT is a forth word, executed right after INTERPRET .
That way it is easy to modify.
I use character ACK ( $06 EMIT ) as signal for the 4e4th-IDE shell.
You may serve other information with the prompt string, like the  
current number base, or what ever you need.

mk


; C PROMPT  --prompt user
 HEADLESS PROMPT,DOCOLON
 IF PREFIXPROMPT!=1
   DW STATE,FETCH,ZEROEQUAL,qbran
   DEST PROMPT1
   DW lit,06H,EMIT ; send ACK
   DW BASE,FETCH,DUP,HEX,lit,'$',EMIT,lit, 
02,ZEROUDOTR,BASE,STORE
   DW XISQUOTE
   DB 3,'ok '; for traditional Forth style
   DW ITYPE
 ENDIF
PROMPT1:DW EXIT


Am 02.08.2014 um 16:46 schrieb Paolo Garro:

> Hi Erich,
> You are pretty right...
> Wait the " ok" and then the "\n> " prompt is not a valid solution.
> In the middle of a ":" definition, the response is a sole " ok"  
> without a prompt so it is ambiguous in general.
> I've also tried to wait for an error message r"\?\? -\d+ \d+ \n> $"  
> to stop the loop while any other response was intended ok.
> But I still have the timeout calibrating problem.
> An unambiguous EOT char will state that mcu is ready.
>
> Paolo
>
>
> Inviato da Samsung Mobile
>
>  Original message 
> Subject: [Amforth] Adding WANT_X and a forth constant in asm (was:  
> HW flow
>   control)
> From: Erich Waelde 
> To: amforth-devel@lists.sourceforge.net
> CC:
>
> Hi Paolo,
>
> Thank you for your response.
>
> On 08/02/2014 01:39 PM, Paolo Garro wrote:
>> Hi Erich
>> There is nothing wrong.
>> Me too I'm reading the echo char while transmitting.
>> The timeout problem is while receiving form the mcu.
>> After transmitting a line you stay earing for a response.
>> How can I know when the response is complete?
> When you received the prompt "\n> ".
>> Wait a lot of seconds is not so logic.
>> How can I know if the mcu is ready to receive another line?
> When you received the "\n> " prompt, too, I think.
>
>> An XON ending char would be fine...
>
> I have the timeout question in my stuff as well, but it is
> not easy. There are several (more than 1) controllers on
> the same rs485 bus. I do not want them to just send anything
> unless I asked them. So I removed any output from startup
> including the prompt. When I address one controller I send
> its address (with the highest bit set) and it shall "wake up"
> and present it's prompt. I also added the controller address
> to the prompt itself, a station with address $4f will answer
> as
> "\n~4F> "
> and the programm controlling everything needs to wait for this
> string to be received. This particular setup cannot work with
> xon/xoff. The bus has only one pair of cables. Therefore I want
> to see each and every character echoed, so I know the remote
> station is still avalailable (connected and alive). But that
> is just my setup and I'm not saying, you are wrong. I just
> doubt that it will help you as much as you think.
>
>
> So lets assume for the moment, you want XOFF/XON hw flow control.
> Fine. So you select two output pins of the controller to drive
> the signals. Still fine. Next question: where in amForth do you
> assert the xon and xoff signals? I might be wrong, but the
> prompt function looks like the correct place to me to assert XON.
> You are at the same place, where the prompt is sent. So does
> XON help you?
>
> Again, I might be wrong alltogether. And if you really want xon/xoff,
> it can definitely be added to your system. And if it works, great!
>
> You can add
> .set WANT_XON_XOFF = 1
> in your "template.asm" or equivalent file and use it in any other
> assembly file like so
>
> .if  WANT_XON_XOFF == 1
>   .set XON_XOFF_PORT = PORTD; io location, not mem mapped
>   .set XON_XOFF_PIN  = 7
> .endif
>
> or similar. If you want to have a FORTH constant at the same time
> to know for example the pin number, then you create the equivalent
> asm code in a file (words/xon_xoff.asm for example):
>
> ; asm(XON_XOFF_PIN) constant xon_xoff_pin
> VE_XON_XOFF_PIN:
> .dw $FF0C
> .db "xon_xoff_pin"
> .dw VE_HEAD
> .set VE_HEAD = VE_XON_XOFF_PIN
> XT_XON_XOFF_PIN:
> .dw PFA_DOVARIABLE
> PFA_XON_XOFF_PIN:
> .dw XON_XOFF_PIN
>
> this creates the "xon_xoff_pin" as a forth constant. Please note
> that this code is adapted from my experiments with amForth-4.6, so
> it might need to change for a current version. The file needs to
> be included into your build via dict_appl.inc
>
> .if  WANT_XON_XOFF == 1
>   .include "words/xon_xoff.asm"
> .endif
>
> Rebuild amForth, test, repeat. Look into core/words/ for inspiration.
>
> Hope this helps and good luck!
>
> Cheers,
> Erich
>
>
> -- 
> 
> Want fast and easy access to all the code in your enterprise? Index  
> and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's l

Re: [Amforth] Adding WANT_X and a forth constant in asm (was: HW flow control)

2014-08-02 Thread Michael Kalus
xon/xoff are characters send.
With USB this is does not work better than CR or any other character.
Target and PC do not communicate character by character any more.
Terminal emulaters do not stop in time, there are buffers inbetween,  
overrunning oldfashion xon/off protokolls.

Michael



Am 02.08.2014 um 15:07 schrieb Erich Waelde:

> Hi Paolo,
>
> Thank you for your response.
>
> On 08/02/2014 01:39 PM, Paolo Garro wrote:
>> Hi Erich
>> There is nothing wrong.
>> Me too I'm reading the echo char while transmitting.
>> The timeout problem is while receiving form the mcu.
>> After transmitting a line you stay earing for a response.
>> How can I know when the response is complete?
> When you received the prompt "\n> ".
>> Wait a lot of seconds is not so logic.
>> How can I know if the mcu is ready to receive another line?
> When you received the "\n> " prompt, too, I think.
>
>> An XON ending char would be fine...
>
> I have the timeout question in my stuff as well, but it is
> not easy. There are several (more than 1) controllers on
> the same rs485 bus. I do not want them to just send anything
> unless I asked them. So I removed any output from startup
> including the prompt. When I address one controller I send
> its address (with the highest bit set) and it shall "wake up"
> and present it's prompt. I also added the controller address
> to the prompt itself, a station with address $4f will answer
> as
> "\n~4F> "
> and the programm controlling everything needs to wait for this
> string to be received. This particular setup cannot work with
> xon/xoff. The bus has only one pair of cables. Therefore I want
> to see each and every character echoed, so I know the remote
> station is still avalailable (connected and alive). But that
> is just my setup and I'm not saying, you are wrong. I just
> doubt that it will help you as much as you think.
>
>
> So lets assume for the moment, you want XOFF/XON hw flow control.
> Fine. So you select two output pins of the controller to drive
> the signals. Still fine. Next question: where in amForth do you
> assert the xon and xoff signals? I might be wrong, but the
> prompt function looks like the correct place to me to assert XON.
> You are at the same place, where the prompt is sent. So does
> XON help you?
>
> Again, I might be wrong alltogether. And if you really want xon/xoff,
> it can definitely be added to your system. And if it works, great!
>
> You can add
> .set WANT_XON_XOFF = 1
> in your "template.asm" or equivalent file and use it in any other
> assembly file like so
>
> .if  WANT_XON_XOFF == 1
>   .set XON_XOFF_PORT = PORTD; io location, not mem mapped
>   .set XON_XOFF_PIN  = 7
> .endif
>
> or similar. If you want to have a FORTH constant at the same time
> to know for example the pin number, then you create the equivalent
> asm code in a file (words/xon_xoff.asm for example):
>
> ; asm(XON_XOFF_PIN) constant xon_xoff_pin
> VE_XON_XOFF_PIN:
> .dw $FF0C
> .db "xon_xoff_pin"
> .dw VE_HEAD
> .set VE_HEAD = VE_XON_XOFF_PIN
> XT_XON_XOFF_PIN:
> .dw PFA_DOVARIABLE
> PFA_XON_XOFF_PIN:
> .dw XON_XOFF_PIN
>
> this creates the "xon_xoff_pin" as a forth constant. Please note
> that this code is adapted from my experiments with amForth-4.6, so
> it might need to change for a current version. The file needs to
> be included into your build via dict_appl.inc
>
> .if  WANT_XON_XOFF == 1
>   .include "words/xon_xoff.asm"
> .endif
>
> Rebuild amForth, test, repeat. Look into core/words/ for inspiration.
>
> Hope this helps and good luck!
>
> Cheers,
> Erich
>
>
> -- 
> 
> Want fast and easy access to all the code in your enterprise? Index  
> and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] ATmega16 and ATmega128

2014-05-18 Thread Michael Kalus
Hi.

Never split a winning team :-)
Michael


Am 18.05.2014 um 20:38 schrieb Matthias Trute:

> Hi Enoch,
>
>> I understand the reason for the change in trunk@1584 macros.asm, that
>> is, to put things "behind the curtains". However, you have created
>> another forward reference warning, an unnecessary annoyance to a
>> diligent programmer:
>
> Diligent and annoyed programmer, you are? H
>
>>
>> macros.asm refers to RAMEND which is introduced only later through
>> device.asm.
>
> Indeed. I uploaded an unfinished work. I beg your pardon.
>
> Matthias
>
> -- 
> 
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing  
> platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Waking up a dormant forum :-)

2013-06-07 Thread Michael Kalus
Hi.



Am 08.06.2013 um 02:37 schrieb Enoch:

> "Michael Kalus" 
> writes:
>
>> Hi.
>>
>>> ..but not sacrifying compactness
>>
>> Here is what you can do with NO vm kernel word at all:
>>   http://mecrisp.sourceforge.net/
>> ..standalone native code Forth for MSP430 microcontroller chips...
>> ..It fits tightly into 9kb of Flash and runs with 512 Bytes of Ram...
>>
>> By the way, its free. Use whatever routine you like, a great pit.
>> A good job Matthias did there - no not Trute, is Koch this time. :-)
>>
>> Good luck!
>> Michael
>>
>
> Hello Michael,
>
> Not again what's the best 8 bit micro :-) I chose the AVR a couple of
> years ago for its better open source C support. Now we are here at
> AmForth to make its Forth variant the best around too!

Mecrisp is just an example that it can be done, and it could be done  
on AVR as well I guess.


> And our Matthias is doing great job and he has demonstratd being  
> open to
> criticism too!

Thats true, without doubt.

> We still have to convince him though what's the correct
> stack order .s ;-)

Which is without doubt too. ;-)

Michael




>
> Cheers, Enoch.
>
>>
>>
>>
>>
>>
>>
>>
>>
>> Am 07.06.2013 um 10:11 schrieb Rafael Gonzalez:
>>
>>> One of the criteria that you should use is that the pure assembly
>>> implementation should not exceed
>>> in size to the VM assembly implementation +10% (let's give a
>>> margin, ok?)
>>> Speed, yes but not sacrifying compactness
>>> Rafael
>>>
>>>
>>> 
>>>  De: Enoch 
>>> Para: amforth-devel@lists.sourceforge.net
>>> Enviado: Jueves 6 de junio de 2013 21:37
>>> Asunto: [Amforth] Waking up a dormant forum :-)
>>>
>>>
>>> Hello AmForth-ers,
>>>
>>> Can somebody give me good reasons why we should not convert words/
>>> *.asm
>>> implementations (as much as possible) from VM assembly to AVR
>>> assembly.
>>>
>>> For example:
>>>
>>> ; ( a-addr1 -- a-addr2 )
>>> ; Arithmetics
>>> ; add the size of an address-unit to a-addr1
>>> VE_CELLPLUS:
>>> .dw $ff05
>>> .db "cell+",0
>>> .dw VE_HEAD
>>> .set VE_HEAD = VE_CELLPLUS
>>>
>>> Current implementation:
>>> ===
>>>
>>> XT_CELLPLUS:
>>> .dw DO_COLON
>>> PFA_CELLPLUS:
>>> .if CELLSIZE == 2 ;
>>> .dw XT_1PLUS
>>> .dw XT_1PLUS
>>> .else
>>> .dw XT_DOLITERAL
>>> .dw CELLSIZE
>>> .dw XT_PLUS
>>> .endif
>>> .dw XT_EXIT
>>>
>>>
>>> Suggested implementation:
>>> =
>>>
>>> XT_CELLPLUS: .dw pc + 1
>>>   adiw tosl, CELLSIZE
>>>   jmp_ DO_NEXT
>>>
>>>
>>> There are two good reasons to prefer the AVR implementation:
>>>
>>> 1. Speed (10x faster?)
>>> 2. Ease of debugging through the Studio.
>>>
>>> Comments? [flames :-)]
>>>
>>> Thanks, Enoch.
>>>
>>>
>>>
>>>
>>>
>>>  
>>> --
>>> 
>>> How ServiceNow helps IT people transform IT departments:
>>> 1. A cloud service to automate IT design, transition and operations
>>> 2. Dashboards that offer high-level views of enterprise services
>>> 3. A single system of record for all IT processes
>>> http://p.sf.net/sfu/servicenow-d2d-j
>>> ___
>>> Amforth-devel mailing list for http://amforth.sf.net/
>>> Amforth-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/amforth-devel
>>>  
>>> --
>>> 
>>> How ServiceNow helps IT people transform IT departments:
>>> 1. A cloud service to automate IT design, transition and operations
>>> 2. Dashboards that offer high-level views of enterprise services
>>> 3. A single system of record for all IT processes
>>> http://p.sf.net/sfu/servicenow-d2d-j
>>> ___
>>> Amforth-devel mailing list for http://amforth.

Re: [Amforth] Waking up a dormant forum :-)

2013-06-07 Thread Michael Kalus
Hi.

> ..but not sacrifying compactness

Here is what you can do with NO vm kernel word at all:
  http://mecrisp.sourceforge.net/
..standalone native code Forth for MSP430 microcontroller chips...
..It fits tightly into 9kb of Flash and runs with 512 Bytes of Ram...

By the way, its free. Use whatever routine you like, a great pit.
A good job Matthias did there - no not Trute, is Koch this time. :-)

Good luck!
Michael









Am 07.06.2013 um 10:11 schrieb Rafael Gonzalez:

> One of the criteria that you should use is that the pure assembly  
> implementation should not exceed
> in size to the VM assembly implementation +10% (let's give a  
> margin, ok?)
> Speed, yes but not sacrifying compactness
> Rafael
>
>
> 
>  De: Enoch 
> Para: amforth-devel@lists.sourceforge.net
> Enviado: Jueves 6 de junio de 2013 21:37
> Asunto: [Amforth] Waking up a dormant forum :-)
>
>
> Hello AmForth-ers,
>
> Can somebody give me good reasons why we should not convert words/ 
> *.asm
> implementations (as much as possible) from VM assembly to AVR
> assembly.
>
> For example:
>
> ; ( a-addr1 -- a-addr2 )
> ; Arithmetics
> ; add the size of an address-unit to a-addr1
> VE_CELLPLUS:
> .dw $ff05
> .db "cell+",0
> .dw VE_HEAD
> .set VE_HEAD = VE_CELLPLUS
>
> Current implementation:
> ===
>
> XT_CELLPLUS:
> .dw DO_COLON
> PFA_CELLPLUS:
> .if CELLSIZE == 2 ;
> .dw XT_1PLUS
> .dw XT_1PLUS
> .else
> .dw XT_DOLITERAL
> .dw CELLSIZE
> .dw XT_PLUS
> .endif
> .dw XT_EXIT
>
>
> Suggested implementation:
> =
>
> XT_CELLPLUS: .dw pc + 1
>   adiw tosl, CELLSIZE
>   jmp_ DO_NEXT
>
>
> There are two good reasons to prefer the AVR implementation:
>
> 1. Speed (10x faster?)
> 2. Ease of debugging through the Studio.
>
> Comments? [flames :-)]
>
> Thanks, Enoch.
>
>
>
>
>
> -- 
> 
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
> -- 
> 
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] MARKER

2013-05-05 Thread Michael Kalus
Hi Enoch.

Here it is. I have no idea if it works with current amforth.
Some hints which amforth words have changed in versions >3.6 are  
given in the srouce, there may be more since.

I factored ,EE to copy eeprom to flash and POPEE to out it back to  
eeprom - not that elegant notation.

; : ,ee ( -- )
;   here , heap , edp ,  edp 8 do i e@ ,  2 +loop ;
; : popee ( adr n -- )
;0 do dup i + i@  i 2* 2 + e! loop drop ;
; : marker ( -- )
;   edp >r here >r
;   ,ee create r> , r> ,
;   does> >r r@ i@ r> 1+ i@ popee ;


Regards, Michael


-- next part --





Am 05.05.2013 um 09:23 schrieb Enoch:

> Hello Michael Kalus,
>
> IIRC Matthias mentioned that you have once written a MARKER version  
> that
> backs up the entire EEPROM to the Flash memory.
> IMHO that's the correct
> approach. Can you post this code again. On GMANE I found a broken
> dropbox link from 2010.
>
> If I have to write from scratch all MARKER words would be on a  
> wordlist of
> their own. The first MARKER should be produced during compile of the
> kernel. The following MARKERs would be successive deltas...
>
> Thanks, Enoch.
>
>
> -- 
> 
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel

--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] CVARIABLE

2013-03-21 Thread Michael Kalus
Hi.

What about mnemonic conventions like

   .s  .r  .line  ." xxx"

or

key?  ?DO

and such? Don't we already use such "unwritten laws"?

Michael




Am 21.03.2013 um 21:24 schrieb Enoch:

> Matthias Trute  writes:
>
>> Hi Wis,
>>
>>> It may be a good practice to prefix any "cvariable" name with a
>>> mnemonic string (e.g., "c_") to help avoid the troublesome behavior
>>
>> IIRC it is called Hungarian Notation. I'll add a link
>> to the wikipedia article to the recipe.
>
> But Leo Brodie is defintely not Hungarian :-)
> He writes about Choosing Names: The Art
> Choose names according to “what,” not “how”
>
> "But good names are essential for readability. Moreover, the mental
> exercise of summoning a one-word description bears a synergistic  
> effect
> on your perceptions of what the entity should or should not do."
>
> Let's leave the Hungarian method to Microsoft, where it was  
> invented. It
> is an essential evil when managing large projects though.
>
> Regards, Enoch.
>
>
> -- 
> 
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Variations on .S

2013-03-05 Thread Michael Kalus
Hi.
Lets take a look at some common Forths, Revision appended.
They do it in the typed order left to right.
Only VFX does it top down linewise, like amforth in its older days.
Though not a "standard", typed order is "Normative Kraft des  
Faktischen".
(google: "normative power of the factual")

Brodies I like best. Unfortunately he does not tell us how the  
negative numbers are treated.

Regards, Michael
:-)

-
Revision of Examples

gforth:
11 -22 33 .s <3> 11 -22 33  ok


win32forth:
11 -22 33 .s [3] 11 -22 33  ok...
(with a dot for each item, none if empty stack)


VFX Forth for Windows IA32:
11 -22 33 .s
DATA STACK
  top
  33 :0021
 -22 :FFEA
  11 :000B
  ok-3


SwiftX MSP430 EVALUATION 3.5.9 12-Apr-2011:
11 -22 33 .s
11 -22 33 <-Top  ok


And last but not least, the Masters Voice:
Starting Forth by Leo Brodie - Chapter 2
http://www.forth.com/starting-forth/sf2/sf2.html


A Handy Hint
A Non-destructive Stack Print

Beginners who are just learning to manipulate numbers on the stack in  
useful ways very often find themselves typing a series of dots to see  
what's on the stack after their manipulations. The problem with dots,  
though, is that they don't leave the numbers on the stack for future  
manipulation.

The Forth word .S prints out all the values that happen to be on the  
stack "non-destructively"; that is, without removing them. Let's test  
it, first with nothing on the stack:

.S <0>  ok

As you can see, in this version of .S, we see at least one number.  
This is the number of items actually on the stack.

Now let's try with numbers on the stack:

1 2 3 .S <3> 1 2 3  ok

ROT .S <3> 2 3 1  ok



--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] .S “dot-s”

2013-03-03 Thread Michael Kalus
Oh, sorry. Forgot that the list strips attachments.
Michael


; Enochs .S
VE_DOTS:
 .dw $FF02
 .db ".s"
 .dw VE_HEAD
 .set VE_HEAD = VE_DOTS
XT_DOTS:
 .dw DO_COLON
PFA_DOTS:
; ( -- )
; stack picture listing order
 .dw XT_DEPTH
PFA_DOTS0:
 .dw XT_DUP
 .dw XT_DOCONDBRANCH
 .dw PFA_DOTS1
 .dw XT_DUP
 .dw XT_PICK
 .dw XT_DOT
 .dw XT_1MINUS
 .dw XT_DOBRANCH
 .dw PFA_DOTS0
PFA_DOTS1:
 .dw XT_DROP
 .dw XT_EXIT




; old form giving index#, address and value of stack items.
; ( -- ) Tools
; R( -- )
; stack dump
VE_DOTSS:
 .dw $ff02
 .db ".s"
 .dw VE_HEAD
 .set VE_HEAD = VE_DOTSS
XT_DOTSS:
 .dw DO_COLON
PFA_DOTSS:
 .dw XT_CR
 .dw XT_DEPTH, XT_1PLUS
 .dw XT_GREATERZERO
 .dw XT_DOCONDBRANCH
 .dw PFA_DOTSS0
; 
 .dw XT_SP_FETCH
 .dw XT_DEPTH
 .dw XT_1MINUS
 .dw XT_ZERO
 .dw XT_DOQDO
 .dw PFA_DOTSS2
PFA_DOTSS1:
 .dw XT_SLITERAL
 .dw 2
 .db "[]"
 .dw XT_ITYPE
 .dw XT_DUP
 .dw XT_I
 .dw XT_DUP
 .dw XT_UDOT ; index of cell
 .dw XT_2STAR
 .dw XT_PLUS
 .dw XT_DUP
 .dw XT_DOLITERAL
 .dw 4
 .dw XT_UZERODOTR ; address of cell
 .dw XT_DOLITERAL
 .dw 0x3A
 .dw XT_EMIT, XT_SPACE
 .dw XT_FETCH
 .dw XT_UDOT ; content of cell
 .dw XT_CR
 .dw XT_DOLOOP
 .dw PFA_DOTSS1
PFA_DOTSS2:
 .dw XT_DROP
 .dw XT_EXIT
; 
PFA_DOTSS0:
 .dw XT_SLITERAL
 .dw 3
 .db "suf",0
 .dw XT_ITYPE
 .dw XT_EXIT



Am 03.03.2013 um 13:17 schrieb Erich Waelde:

> Michael,
>
> On 03/03/2013 01:00 AM, Michael Kalus wrote:
>
>> Here is the old form for your collection. It is "Stack UnderFlow"
>> save, telling "SUF" if you do one.
>> Maybe you have it already. Michael
>>
>>
>> -- next part --
>
> If you, too, want me to look at your code, you better
> add it to the message text. At least I do not see
> an attachment.
>
> Erich
>
> -- 
> 
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] .S “dot-s”

2013-03-02 Thread Michael Kalus
Hi.

Am 02.03.2013 um 21:27 schrieb Enoch:

> : .s  ( -- )  \ stack picture listing order
> depth
> begin dup while dup pick . 1- repeat
> drop
> ;

Maybe you want to have that in assembler. mk


-- next part --


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] .S “dot-s”

2013-03-02 Thread Michael Kalus
Hi.
..
> Should I mention, that I collect good tools and ideas? ;)
>>

Here is the old form for your collection. It is "Stack UnderFlow"  
save, telling "SUF" if you do one.
Maybe you have it already. Michael


-- next part --


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Development request

2013-02-20 Thread Michael Kalus
Hi.


Am 20.02.2013 um 10:16 schrieb Enoch:

>> So, do I see this right?
>> WIPE restores a known state. This state needs to be calculated at
>> assembly time.

Yes.


>> It includes the initial state of eeprom, wordlist and
>> other pointers, user area, disabling tasks ... where do you stop?
>> Does wipe call COLD as well? Do you need to clear any interrupts,  
>> too?
>> Does it restore the default interrupt handlers? No, I did not look
>> at the code of WIPE.

WIPE is simple in 4e4th, since it it taylored for the MSP430G2553 on  
LaunchPad.
It just erases user flash and executes FACTORY then.
FACTORY moves a ROM tabel to RAM user area, clears variable area in  
RAM to zero, and does a SAVE on it so that 'factory settings' is the  
new app, and runs into ABORT.

There is no eeprom, and we do not have to take care of other MCUs.
Michael




>>
>>
>> Well, I'm using marker a lot. And I don't see, how wipe would get me
>> any further. The only time I need to reflash is when I screwed up
>> something in the dictionary before the first marker or som flash
>> based data structures.
>
> MARKER is great for development, and I use it as well, but it is not
> good enough in production situation:
>
> Let's say we are consultants and ship an Amforth based "blackbox" to a
> client whose firmware we loaded before shipping via JTAG. When this
> firmware needs a bug fix or an upgrade we must provide the client  
> with a
> serial port based method of new firmware install (compiling/uploading
> new Forth) without the client having to open the box.
>
> 4e4th is targetting educational applications. There too there's a need
> for rapid "factory reset" between one student application to the next
> one.

Exactly. This is what we had in mind.

And a recovery mechanism if a student gets locked in forth some how,  
has no terminal access any more, and reset does not help.
Press switch S2+reset to WIPE and start over.

But you have to chose 4e4thpro (pro for production) to strip S2  
booting capability and use that pin for apps too.

Michael


>
> Regards, Enoch.
>
>
>
>
>
>
>
>
>
>
>
>
>
>>
>> Cheers,
>> Erich
>>
>> - 
>> -
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_feb
>
>
> -- 
> 
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Development request

2013-02-20 Thread Michael Kalus
Hi Enoch.


Am 20.02.2013 um 04:35 schrieb Enoch:
..
> Honored to meet you, the "4e4th" guy :-)

To tell the truth, most of 4e4th is Camelforth, so Brad deserves the  
honor.
Dirk Brühl is the guy with most of the ideas that brought it onto  
MSP430 LaunchPad.
And Ulrich Hoffmann contributed as well, such as caps and crc.
So I'm the code monkey.




>
> To become current with Forth I review code by other OSS Forth  
> projects.
> Another that deserves attention, IMHO, is the Open Firmware
> .
>
> In any case, we here should focus on Forth code that utilizes Atmel's
> AVR special features and quirks. In this connection I patiently  
> wait for
> Matthias to recognize/decline my SBI/CBI utilization macros ;-)

I like it.

Regards, Michael


>
> Regards, Enoch.
>
>
>>
>>
>>
>>
>> Am 19.02.2013 um 22:36 schrieb Enoch:
>>
>>> G'day to you to you all,
>>>
>>> I found something that seems to me useful on http://www.4e4th.eu/
>>>
>>> WIPE ( -- )  Back to original status. Stacks unchanged. uarea  
>>> back to
>>> original.
>>>
>>> Having an asm based word which restores the system into its original
>>> Amforth state, both Flash & EEPROM content, means that on-site code
>>> replacement can be done without a JTAG, etc.
>>>
>>> Comments?
>>>
>>> Thank you, Enoch.
>>>
>>> P/S Marker is not good enough: It does not restore the EEPROM. It
>>> removes itself after application.
>>>
>>>
>>>
>>>
>>>
>>>  
>>> --
>>> 
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_d2d_feb
>>> ___
>>> Amforth-devel mailing list for http://amforth.sf.net/
>>> Amforth-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/amforth-devel
>>
>>
>> - 
>> -
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_feb
>
>
> -- 
> 
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Development request

2013-02-19 Thread Michael Kalus
Hi.

> Comments?


:-)



Michael





Am 19.02.2013 um 22:36 schrieb Enoch:

> G'day to you to you all,
>
> I found something that seems to me useful on http://www.4e4th.eu/
>
> WIPE ( -- )  Back to original status. Stacks unchanged. uarea back to
> original.
>
> Having an asm based word which restores the system into its original
> Amforth state, both Flash & EEPROM content, means that on-site code
> replacement can be done without a JTAG, etc.
>
> Comments?
>
> Thank you, Enoch.
>
> P/S Marker is not good enough: It does not restore the EEPROM. It
> removes itself after application.
>
>
>
>
>
> -- 
> 
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Useful?

2013-02-14 Thread Michael Kalus
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 
(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/
> Amforth-devel@lists.sourceforge.net
> 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/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] inner interpreter operation.

2013-02-02 Thread Michael Kalus
Hi Wis.

Since Matthias is bussy, maybe I can help out.

Am 31.01.2013 um 21:37 schrieb Macomson, Wis:

> I'm new to this and I'm trying to understand the amForth inner  
> interpreter. There are a couple of clarifications in the "amforth  
> Documentation, Release 5.1-wip,January 26, 2013" that would help a  
> lot.
>
> To wit:
>
> (p. 9)EXECUTE
>
> Q: When is EXECUTE, um, executed? I'm not clear on what this is  
> used for.

( xt -- ) EXECUTE

If you put an execution token xt on the stack, you may EXECUTE that.

It is used in the interpreter: Parse input stream for a forth word  
(word means "string of ascii characters delimited by blanks", find  
that word in dictionary, get its xt on stack and then execute it.

Investigate ACCEPT and INTERPRET in the source code.



> (p. 9)NEXT
> [ . . . ]
> This last step finally jumps to the machine code pointed to by the  
> X scratch pad register.
>
> Q: To be clear, the machine code jumps to NEXT when it has  
> completed.  Correct?

That is correct.

'Low level' forth machine code continues execution of forth on 'high  
level' that way.



> (p. 9)EXIT
> The code for EXIT (aka UNNEST) is the forth word EXIT in the  
> dictionary. It reads the IP from the return stack and jumps to  
> NEXT. The return stack pointer is incremented by 2 (1 flash cell).
>
> Q: I think EXIT pops the top of the return stack into the IP.  That  
> way, the second step of NEXT gets the correct value. Correct?

So it is.

If stack grows 'down' an increment by 2 drops one item - on a 8Bit  
machine with a 16Bit virtual forth machine on it.


>
> (p. 9)DO_DOES
> This code is the runtime part of the forth word DOES> . It pushes  
> the current address of the MCU IP register onto the returnstack and  
> jumps to DO_DOES. DO_DOES gets that address back, saves the current  
> IP and sets the forth IP to the address it got from the stack.  
> Finally it continues with NEXT.
>
> Q.  Is this effectively a subroutine call?

Yes. (I think so.)

It is used to define words, that create words of the same class.

For exeample VARIABLE is such a word. You may create variables that  
all work the same.

VARIABLE Y0
VARIABLE X12
VARIABLE MOON

Such words are also called "defining words".

VARIABLE defines a new forth word, that has one cell of ram to hold  
an item. When this word is executed, it puts the address of its ram  
cell on stack - that is the 'subroutine' part of it.

Michael

>
> Thanks for any light you can shed.
>
> -- 
> 
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] From frt to asm

2012-10-27 Thread Michael Kalus
Hi Hannu.


Am 27.10.2012 um 21:57 schrieb Hannu Vuolasaho:
..
> Am I right if I say it doesn't know my own assembler words?

You are right.

It knows a lot of amforth words which are ANS forth.
As g4 is written in gforth adding more simple words is quite easy.
Take a look at their syntax in those examples at the end of g4 source.
And append more there.

Michael





>
> Maybe there should be link on amforth web page to this tool.
>
> And if amforth-shell maintainer want to catch feature request I'd  
> like to see this as part of it. Then it would be nice to save some  
> words when shell would convert registers to addresses without  
> including device.frt.
>
> Best regards,
> Hannu Vuolasaho
>   
> -- 
> 
> WINDOWS 8 is here.
> Millions of people.  Your app in 30 days.
> Visit The Windows 8 Center at Sourceforge for all your go to  
> resources.
> http://windows8center.sourceforge.net/
> join-generation-app-and-make-money-coding-fast/
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] From frt to asm

2012-10-27 Thread Michael Kalus
Hi,

if you need any help with g4 just ask me.

Michael


Am 27.10.2012 um 20:13 schrieb Erich Waelde:

> Hi,
>
> On 10/27/2012 08:06 PM, Enoch wrote:
>> Is there an automated method to compile frt to asm to skip  
>> uploading of
>> debugged words?
>
> Have a look at
> http://www.forth-ev.de/repos/g4/
> This is a gforth program to konvert forth source code
> to amforth-look-alike assembly.
>
> Cheers,
> Erich
>
> -- 
> 
> WINDOWS 8 is here.
> Millions of people.  Your app in 30 days.
> Visit The Windows 8 Center at Sourceforge for all your go to  
> resources.
> http://windows8center.sourceforge.net/
> join-generation-app-and-make-money-coding-fast/
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


--
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Bug

2012-09-12 Thread Michael Kalus
Hi.

gforth:
0 0 10 within . -1  ok
-1 0 10 within . 0  ok
9 0 10 within . -1  ok
10 0 10 within . 0  ok

Michael

Am 12.09.2012 um 14:43 schrieb Hannu Vuolasaho:

>
> Hello!
>
> I had standard :
> Secretariat
>
> Computer and Business Equipment Manufacturers Association
> Approved:  March 24, 1994
> American National Standards Institute, Inc.
>
> open in my browser and it says:
>
> 6.2.2440 WITHIN
> CORE EXT
> ( n1|u1 n2|u2 n3|u3 -- flag )
>
> Perform a comparison of a test value n1|u1 with a lower limit n2|u2  
> and
> an upper limit n3|u3, returning true if either (n2|u2 < n3|u3 and
> (n2|u2 <= n1|u1 and n1|u1 < n3|u3)) or (n2|u2 > n3|u3 and
> (n2|u2 <= n1|u1 or n1|u1 < n3|u3)) is true, returning false
> otherwise. An ambiguous condition exists if n1|u1, n2|u2, and n3|u3  
> are
> not all the same type.
>
> See:
> A.6.2.2440 WITHIN
>
>
> Just for the record.
>
> Best regards,
> Hannu Vuolasaho
>
>> Date: Wed, 12 Sep 2012 08:08:01 +0200
>> From: ew.fo...@nassur.net
>> To: amforth-devel@lists.sourceforge.net
>> Subject: Re: [Amforth] Bug
>>
>> Hello Artur,
>>
>> I think you are pointing to "within" not working as you expect.
>>
>>> ver
>> amforth 4.6 ATmega328P ok
>>> 0 0 10 within .
>> -1  ok
>>> -1 0 10 within .
>> 0  ok
>>> 9 0 10 within .
>> -1  ok
>>> 10 0 10 within .
>> -1  ok
>>
>> Looking into Conklin, Rather -- Forth Programmer's Handbook
>> (3rd. Edition) p.59:
>>
>> WITHIN ( x1 x2 x3 -- flag )
>> return true if x1 is greater than or equal to x2 AND less than
>> x3. ...
>>
>> So x3 is excluded in the "true" case. As you can see above,
>> "within" in amforth includes x3. Now, someone needs to check
>> "The Standard". :-)
>>
>> Thanks for pointing this out.
>>
>> Cheers,
>> Erich
>>
>> On 09/10/2012 04:31 PM, Arthur Ivanov wrote:
>>> Hi !
>>>
>>> I think I see a bug in your AmForth v4.9.
>>> In file ..\core\words\to-lower.asm I see
>>>
>>> ; ( C --  c) ; String
>>> ; if C is an uppercase letter convert it to lowercase
>>> VE_TOLOWER:
>>>   .dw $ff07
>>>   .db "tolower",0
>>>   .dw VE_HEAD
>>>   .set VE_HEAD = VE_TOLOWER
>>> XT_TOLOWER:
>>>   .dw DO_COLON
>>> PFA_TOLOWER:
>>>   .dw XT_DUP
>>>   .dw XT_DOLITERAL
>>>   .dw 'A'
>>>   .dw XT_DOLITERAL
>>>   .dw 'Z'
>>>   .dw XT_WITHIN
>>>   .dw XT_DOCONDBRANCH
>>>   .dw PFA_TOLOWER0
>>>   .dw XT_DOLITERAL
>>>   .dw $20
>>>   .dw XT_OR PFA_TOLOWER0:
>>>   .dw XT_EXIT
>>>
>>> This will not convert Z chat to lower case.
>>> To fix you have to replace the string
>>>   .dw 'Z'
>>> by the string
>>>   .dw 'Z'+1
>>>
>>> Ethereal
>>>
>>>  
>>> --
>>> 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


--
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/

Re: [Amforth] Where to store my word? ..bitnames

2012-06-19 Thread Michael Kalus
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  pulse( turn portD pin #7 for  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 m

Re: [Amforth] Where to store my word?

2012-06-17 Thread MIchael Kalus
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