6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 12:57 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: EXPECT confusion
PostPosted: Thu Jun 04, 2020 9:29 pm 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
My understanding as I read EXPECT is, it is supposed to copy "n" characters of the text entered from the keyboard, to any specified memory address in the form ( addr n --- ).

Where "n" is the maximum number of characters to be expected and "addr" is the address where the text is moved to.

My question is that when the text is moved to the specified address, is the actual length of the text entered also stored at the address by EXPECT or is there a word used to calculate the length of the copied text and store that length at the beginning of the text?

To recap the destination memory should have a length byte followed by the entered text so that COUNT can put the "addr" and the "length byte" on the data stack ready for TYPE to use.

I should be able to do this, right?

PAD 80 EXPECT
PAD COUNT TYPE


Top
 Profile  
Reply with quote  
 Post subject: Re: EXPECT confusion
PostPosted: Thu Jun 04, 2020 9:46 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
The variable SPAN holds the number of characters received by EXPECT.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: EXPECT confusion
PostPosted: Fri Jun 05, 2020 2:20 pm 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
I don't have a variable SPAN, so I wrote temp word SPAN for now until I fix the code.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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: