Jump to content
IGNORED

are we sure this BASIC program will work within IBM PC Jr's memory?


Recommended Posts

                                                                                                                                 

Where we left off on my last related post above, one member kindly posted a lengthy program called PC-CALC.BAS, a spreadsheet program that I could type in BASICA and run on my IBM PC Jr with 128K. Before I go through typing in the miles and miles of code of that program, I noticed that though the BAS file has roughly 32 K, when the remainder of those files with the same or similar name but different file extensions are all considered, that total far exceeds JR's 128 K limit; 2 of these files could be called upon, but 3 wouldn't as listed, and I'm not totally sure that all 3 files would be necessary to render the program operable. (This assumes that all these files are indeed needed to make it work on an actual, not virtual, PC JR.)  So from referring to the screenshot related to the PC-CALC.BAS program in the last thread, we see:

 

PC-CALC  DOC    65280
PC-CALC BAS      32085
PC-CACL EXE      50944           

 

Thus my question... before I waste hours in dribs and drabs typing the PC-CALC.BAS program into JR, how do we know for sure which of those related PC-CALC files to that main PC-CALC.BAS program will be called upon/needed/used?

 

In other words... will the PC-CALC.BAS program listed in that thread definitely work with an actual, not simulated, PC Jr.

 

If anyone can confirm this, it would be much appreciated. Otherwise, my hunt for a basic spreadsheet on a 5.25" floppy for JR (sigh) would need to continue.  I am trusting/counting on someone who really knows his/her stuff here!

See what you can come up for me please?

Thanks!

  

Link to comment
Share on other sites

You can look at the file contents and see for yourself, but I think the exe is a compiled version of the basic program and isn't the doc file some sort of reference guide to using the program.  Since you're not transferring these files and only retyping the contents of the bas file the other files wouldn't be used.

Link to comment
Share on other sites

Verifying that PC-CALC will fit in the PCJr memory space is simple. Start the PCJr, go into BASIC, read the amount of available memory. It should be close to 64K which will be more than the roughly 32K PC-Calc will occupy. PC-Calc is a huge program by the standards of line number BASIC but the Jr has more than enough memory. 

 

The DOC is a simple text file. The PCJr lacks a text editor and can't run a text editor at the same time as BASIC. The Jr is a very limited computer. It will be necessary to read the DOC file on a different computer to access the manual to figure out how to use the spreadsheet unless a lot of paper is wasted printing the document. 

 

Ignore the EXE. 

  • Like 1
Link to comment
Share on other sites

Thanks to both of you for expounding here. So sounds like from what you're both are saying, I should be fine just typing and running the BAS file. That was helpful, very.

 

Upon turning on the PC Jr. computer & monitor, I see it reaches to 128K on the initial blue screen.  Now that I know that the other files won't cause any memory issues, I guess I'll type the program straight into JR then, not the 5150 as I thought I had to.  Referring back to my linked post, I now also see it turns out that the member also had included the program's documentation too, so now I can ignore the DOC file... even more good news!

 

But just to clarify these last 2 things:

 

1) You last mentioned to ignore the EXE. But from glancing over the manual, I found:

  2.1 Lesson 1. To run the compiled version of PC-Calc (file PC-CALC.EXE) type in PC-CALC. To run the interpreted BASIC version (PC-CALC.BAS) enter BASIC PC-CALC. The compiled version will run faster but may require more memory. With the interpreted version you can adjust the number of rows and columns to fit you memory size.

 

...Thus, let's say after I type the long listed original program called "PC-CALC.BAS" program while in BASICA and save it there, on another day, I come back, and at the DOS 2.1 A> prompt, isn't it better actually to type in "PC-CALC" to run this compiled version, and not type "BASIC PC-CALC" as above?  (I wasn't sure if the EXE file somehow gets created within/from typing in the original BAS program.)

 

So to use the program, which do I type at the DOS 2.1 A> prompt, "PC-CALC" or "BASIC PC-CALC" ?  (Confused, because I don't even see that last file name even listed in the directory below!)

 

2) So in summary, I just want to make sure this is everything: 

  • while in BASICA, I just type in and save there the long program from the link called "PC-CALC.BAS"  and I only need to save the file in BASICA as "PC-CALC" since the computer will add the .BAS file extension automatically, correct?
  • at the DOS 2.1 A>  prompt, type in "PC-CALC" or "BASIC PC-CALC"   (depending on your answer in #1) 
  • Just ignore the rest of the files in the directory below, so that when it comes time to use the program, at the DOS A:> prompt, all I have to do is type in whatever name from that last bullet and the program should work fine?

Directory of PC-SIG Library Disk #0224

 Volume in drive A has no label
 Directory of A:\

README            1126   1-01-80   2:12a
PC-CALC  DOC     65280   3-20-84   6:38p
PC-CALC  BAS     32085   7-15-84   6:41a
PC-CALC  EXE     50944   7-15-84   6:50a
SCRNSAVE COM       688   4-20-84   3:16a
SCRNSAVE DOC      2397   4-23-84   9:09a
SCRNSAVE ASM     13312   3-20-84   6:20p
KBUFF    DOC      3015   5-27-84   9:28a
KBUFF    COM        50   4-04-84  10:12a
SDIR1    COM      1555  11-12-83   1:05a
SDIR1    DOC      1004  11-15-83   1:18p
CRC      TXT      1076  11-16-84   6:47a
CRCK4    COM      1536  10-21-82   7:54p
       13 file(s)     174068 bytes
                      142336 bytes free
Edited by newTIboyRob
Link to comment
Share on other sites

The EXE version is what would result if the BASIC code was run through a BASIC compiler. The result was often faster but needed more memory. However, without the ability to copy files to disks, it is nearly impossible* to send the exe file to the PCJr. Compiled programs aren't something that can be simply typed. 

 

* Technically, some utilities were distributed as BASIC code with the instructions of the compiled program stored as DATA lines. Run the BASIC program and the compiled program would be reconstituted on disk. If you have the skills needed to convert a compiled program into the matching lines of DATA, you have so much skill that you should not be listening to me. 

 

You might need to be using Cartridge BASIC. BASICA would be the right version on the 5150. I don't recall what the command was needed to enter Cartridge BASIC on the Junior. It has been many years and nothing turned up in a quick search. 

 

Use PC-CALC.BAS and start with BASICA PC-CALC or simply BASICA followed by LOAD "PC-CALC" The .BAS is filled in automatically. 

Edited by Krebizfan
Link to comment
Share on other sites

Ok, I understand the EXE explanation.

 

Responding to your *, it is true that I do not have the skills needed to convert a compiled program in to matching lines of DATA. 

 

Continuing... sounds like it is safer to avoid the Jr Cartridge Basic concept completely (though I do have that cartridge somewhere) and just use my 5150 after all, Dos 2.1, get into BASICA, type in this program we're talking about called "PC-CALC.BAS" and save it while still in BASICA.

 

After this point though, I get a little lost, especially within your last line on what I should exactly name the file and how to exactly load it, and from where. 

 

Let me just say that I will be typing this program in BASICA in dribs and drabs and saving it there, but when I am completely finished typing the entire program and I am ready to actually use it, I also know that I will (always) be running it from the DOS A:> prompt, because that is just how I am used to doing it.

 

That said, maybe it's best to just summarize and clarify things for me by answering these 2. 

 

1) Save the file while typing it in BASICA as  .......   (exactly what filename?)                     

2) Type  {exactly what?} at the DOS A:> prompt to get the program to run from there       

 

[With #1 I wasn't sure if it was just plain PC-CALC or what the exact file name should be called]

[With #2, I wasn't sure if at the A>: prompt I should type BASICA PC-CALC or just PC-CALC as all I've ever loaded from th DOS A:>prompt was just BASICA with no filename, so I'm not sure how otherwise]                                                                                                                                            

 

I know it may seem/sound kind of elementary how I just put those 2 above questions, but I wanted to spare you more of how/why I got confused and just be 100% sure I'm on the same page with you to avoid running into any snags. Thanks!   And sorry for the font changes!

 

 

 

 

Edited by newTIboyRob
Link to comment
Share on other sites

To convert a basic program to a compiled executable you'd need a copy of the basic compiler program.

 

It shouldn't matter what filename you give when saving your basic program to file. To run a basic program from the dos prompt, type the basic program command, space, the name of your basic program file, enter.  Here's documentation on using microsoft basic.  Gw-basic is the non ibm version of ibm basic, otherwise the same thing.

http://www.antonis.de/qbebooks/gwbasman/

Edited by mr_me
Link to comment
Share on other sites

Taking a refresher on the BASICA/GWBASIC is a good idea. I remember being tripped up a few times because of differences I had forgotten between the editing mode of BASICA and more modern editors. 

 

One command within BASICA to remember is FILES which is similar to DIR in DOS so if a typo is made in a filename, tracking down the file will be possible. 

 

Cartridge BASIC is BASICA with a few additional functions to handle the Jr's better video modes. Loading the software from cartridge stretches out the limited RAM supply of the Jr. IBM went out of its way to make it difficult to use 5150 BASICA on the Jr. 

 

Entering the program would involve starting BASICA and then SAVE the file every time a reasonable amount of text was added. When resuming work, use LOAD to get the previous draft and resume work. Both SAVE and LOAD require the file name enclosed in quotes. One slight wrinkle is that closing quote does not need to be entered unless a command switch is added after the file name. For example, SAVE "PC-CALC",A would save the PC-CALC.BAS file in ASCII mode so it could be opened by a standard text editor. 

Link to comment
Share on other sites

Oh yes, I actually do remember most of the commands though, DOS or BASICA, everything in your last post I was aware of, Kreb, but thank you. FILES in BASICA, key off, cls, LOAD"  even TIME$ and DATE$ and some of the more fancy ones there I still remember and when in dos you have the dir/p  and dir/w, etc.  Functioning in Basic won't be the issue for me.

 

I remember reading about what you said about the Cartridge Basic and what IBM did with the JR to make it more difficult. But if it was more difficult to use the 5150 BASICA on the Jr, yet loading the software from cartridge stretches out Jr's limited RAM supply, I still don't know if it is better to type and keep saving this program in BASICA on the 5150 and then just run it and use it on JR, or if I should instead move over to JR and type it and save it in BASICA using the DOS 2.1 floppy on JR?   Which computer would you choose to type and save on?

 

What I find the most confusing of all is all these compiler programs, emulators, etc... all the technology that needs to come into play and how they affect file names, what's needed to do, etc as you can see by my above confusion, in general. You probably know or can recall how BITD, you just had your DOS floppy, switched out the disk at the A>: prompt and simply typed, for example, "write" for the PFS WRITE word processor which, at the time, was quite amazing.  Thus I am just trying to adapt now with how the old meshes with the new, hence the fog. (In ironic terms, my mind functions more in the BASICA format rather than the emulator concept, so I am stumbling, but still trying to learn here as I go.)

 

So just to reiterate on your post mr_me... looks like then whichever computer I do wind up typing out and saving the program on, if I just save it as "PC-CALC" in either computer BASICA, all I would need to type at the DOS prompt is what I thought:  BASICA PC-CALC and I should be off and running fine, correct?

 

 

Link to comment
Share on other sites

Having checked references, it seems that typing BASICA would launch Cartridge BASIC on the Jr. How the Cartridge helps memory is that the 32K of ROM on the cartridge does not have to be loaded into memory. The 128K of RAM on an expanded Jr. was equivalent to 144K on a 5150 or 176K on an XT clone which didn't have Cassette BASIC in ROM. If the math seems off, remember 16K of RAM is used for video memory on the Jr.  

 

I would type the program on a 5150 instead of the Jr because the Jr is more likely to lose keystrokes. 5150 has a proper keyboard controller with buffer while the Jr tries to grab every character using the CPU. Debugging a long program can be a challenge even without the computer throwing in bonus errors. 

 

I went through a similar set of confusion when I resumed writing line number BASIC programs after a 25 years hiatus. 

Link to comment
Share on other sites

BASICA doesn't run on a PCjr unless you have Cartridge BASIC plugged in.  It does work if you rename it to BASICB or something else, but IBM DOS on the PCjr will insist on calling Cartridge BASIC if you run BASIC or BASICA.  Keep that in mind.  Also the PCjr specific features are not available if BASICA is renamed to something else.

 

IBM BASIC will automatically append the .BAS extension to the filename with the SAVE command unless you supply one yourself.  It will also autoload a .BAS file without needing the extension if you supply a filename after the BASIC command.

 

If you want to run the compiled version, you'll type PC-CALC.  If you want to run the BASIC version, you'll need to copy PC-CALC.BAS to a disk that also has BASIC on it, or load it from within BASIC after you start BASIC up and switch disks...

 

You could try it out first to see if it does what you want by putting DOSBox on your modern computer, putting the PC-CALC files in a directory on your computer's hard drive, setting DOSBox to emulate a PCjr, and then running it there first before you go to all the trouble of typing in a huge program listing.

Link to comment
Share on other sites

Casey, thanks so much for that info!  Excellent points from you as usual and everyone. Luckily, I found I have the Cartridge basic so I put it in JR's slot, where it will remain. I tested my DOS 2.1 disk which loads and runs perfectly in the drive and got me to BASICA, where I typed some simple sample programs and saved them to another prior formatted disk I decided to label "PC-CALC", thinking of it as what we often call a "PROGRAM" or "MAIN" disk and kept the .BAS file. [I killed all those sample files after testing to get back some room, (what a command, right?  KILL"filename")... ] and deleted everything but the original .BAS file, just is case.] I've also formatted an auxiliary disk in DOS 2.1 called "CALCDATA" to keep the files I {hopefully} make with the program on a separate data disk, just to keep the 2 concepts separate in my mind, so I have a PROGRAM and DATA disk all ready.

 

So, in short, everything is working perfectly, and I am ready to tackle that humongous program. I will post back the results of this saga, in case anyone reading this is actually interested, and hopefully I won't encounter the dreaded error messages.  Thanks again!

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...