Jump to content



JonnyBritish's Photo

JonnyBritish

Member Since 8 Aug 2005
OFFLINE Last Active Yesterday, 10:52 AM

Topics I've Started

Atari equipment looking for home in Illinois

Sat May 12, 2012 9:06 AM

Saw this on Craigslist if anyone is interested

http://chicago.craig...3005210539.html

Another good learning book for Forth from www.mpeforth.com

Sat Mar 10, 2012 11:19 PM

http://www.mpeforth....rogramForth.pdf

seems like a good read and also these articles

http://www.ddj.com/embedded/210600604

http://www.ddj.com/h...uting/210603608

Learning Forth: Better way to increment variables

Mon Feb 27, 2012 7:40 AM

In my code I am tracking a sprites position as a variable called AY. I wanted to add 1 to the variable so used this TurboForth code which is perfectly valid but is 5 Forth words long

AY @ 1+ AY !

Here is how it works

AY @ - retrieve valiable AY and store on the stack
1+ - retrieve top most cell from stack and add 1 to the value and place back on the stack
AY ! - retrieve the top most value on the stack and place back in variable AY

However there is a better way which is only 3 Forth words long and that is

1 AY +!

From the docs at http://www.turbofort..._reference.html
and specifically

+! value address -- S Read the cell at address, adds value to it and stores the result at address.

You can see it combines all the operations into a 3 word line.

same for subtraction

-! value address -- S Reads the cell at address. Subtracts value from the cell value, and stores the result at address.

You know your Forth app has a bug when..

Sun Feb 26, 2012 1:29 PM

It runs perfectly but at the end your stack still has values left over :-)

PC based sprite editor for TI99 that does not require meto load Java

Sat Feb 25, 2012 7:31 PM

I am workong with TurboForth on a new game and want to design a sprite or actually 4 sprites. Are there any PC based sprite editors that do not require me to load Java?

thanks