Post Reply 
Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
07-15-2021, 03:43 PM
Post: #16
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
Thank you for your efforts to make these available!

For traders, the "Value of Stocks" program may not work so well (N is the number of stocks):

70 "A":M=N*3+15: IF N>18 PRINT "TOO MANY STOCKS!": GOTO 18

For the rest of us, no problem!!

If I'm not mistaken, the PC-1 (SHARP PC-1211) has 1,920 bytes RAM with 1,424 bytes available.

- The program (ST bin file) takes 1,062 bytes.
- (3*18+15)*7 bytes storage for 18 stocks = 483 bytes. Each variable and array A() entry takes 7 bytes.
- They cleverly start at M=15 meaning that 12 of the internal vars O to Z are used (84 bytes) since array A(M) maps onto them.
- Total max memory usage: 1,062+483-84 = 1,462

Won't this overflow before hitting the error message?

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack - robve - 07-15-2021 03:43 PM



User(s) browsing this thread: 1 Guest(s)