home .. forth .. colorforth mail list archive ..

Re: [colorforth] @+


On Tue, 2006-01-31 at 21:27 -0800, John Drake wrote:
> 
> --- Charles Shattuck <cshattuck@xxxxxxxxxxxx> wrote:
> 
> > I've figured out what was wrong with my @+.  The a
> > register (EDX) gets
> > clobbered in quite a few places in the kernel,
> > including jump and swap.
> > I decided to use EBX and call it b instead.
> 
> Hello all,
> 
> I missed this post the first time by so bear with
> me. :) I'm just now starting to REALLY understand
> ColorForth (working on a game demo now) so I 
> guess I'm late are realizing this, but it seems
> that @+ isn't part of (many) Pentium ColorForth
> implementations?  It's on Chuck Moore's website:
> 
> http://www.colorforth.com/forth.html
> 
> But it's not listed in the (unofficial) ColorForth
> glossary.
> 
> http://kristopherjohnson.net/cgi-bin/twiki/view/Main/ColorForthWord
> 
> More importantly I needed it for my demo and I
> noticed that it's not defined in either version
> of ColorForth I'm using these days.  (ColorForth
> for Windows and Terry Loveall's qemu implementation).
> 
> Is there an @+ definition I can grab somewhere?
> And why is it missing?  (Or am I just missing
> something?)  I'm not sure what the point of an
> A register is with out @+ and !+.
> 
> Regards,
> 
> John M. Drake
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
> Main web page - http://www.colorforth.com
> 
I put up a version of @+ using the B (EBX) register instead of Chuck's A
(EDX) register at:

 http://home.surewest.net/cshattuck/editor_additions_2.html

Too many words in the kernel clobber the A register so its value can't
be relied upon unless you know exactly what your words, including
primitives, are doing.  It might be safer and simpler to use push, pop,
swap, and over to let the address ride on one of the stacks in my
opinion.  Even if you use the B register, which apparently is unused by
the kernel, you need to push and pop its value if you call another word
of your own that uses @+.

Charley.


---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com