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

Re: [colorforth] PCI soundcard (was How is colorForth different from other Forths?)


On Saturday 24 January 2004 02:04 pm, Nick Maroudas wrote:
> 4@ 4! do the io; note that 4@ has a  dup   and 4! has a  drop (I guess
> because pci regs swallow and regurgitate) and that reads seem to first

No.  It's because any fetch must move teh contents of EAX (the current 
top of stack) to the second top of stack, which is pointed to by ESI.  
It of course needs to adjust the ESI pointer accordingly.  DUP does this 
already, so instead of re-coding that functionality, it just inlines a 
dup before loading EAX with the desired word.

Likewise, storing data to memory does not destroy the original contents 
of a register.  To get proper stack behavior, one must DROP the value 
after the storage takes place.

--
Samuel A. Falvo II


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