6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri May 10, 2024 6:11 pm

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun Feb 01, 2015 2:05 pm 
Offline

Joined: Tue Jan 07, 2014 8:40 am
Posts: 91
cr1901 wrote:
Something I just realized (Brad or someone else, correct me if I'm wrong): Forth primitives which are coded in ASM can use W as they wish, as NEXT will reload it based on the current Forth IP.

Correct. Actually, W is not a required part of the Forth virtual machine. It's just that a temporary address register turns out to be necessary in many Forth threading implementations, and it has become common to call this register W. (DTC NEXT on the 6809, for example, does not require a W register.)

Quote:
The only primitive snippet of code that actually relies on W being a certain value on input (pointing to the address of the Code Field of the currently entered word) is DOCOL.

Well, no. Many "defined word" actions, such as DOVAR and DOCON, may also make use of W to find the address of the Parameter Field. (Take heed - this becomes important when implementing the primitive EXECUTE; it must leave W in the "expected" state.)

_________________
Because there are never enough Forth implementations: http://www.camelforth.com


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: