• Please review our updated Terms and Rules here

How do you enter basic if there is DOS installed in XT

offensive_Jerk

Veteran Member
Joined
Jul 13, 2009
Messages
1,226
Location
Wisconsin
On an XT, is there anyway to enter the BASIC ROM without changing dip switches? DOS 5 is installed, I know there is QBASIC but just wanna play around with the BASIC in ROM.
 
You can allways use Casette basic, but you problably don't want that since the XT don't got a casette port.

If you have an older version of PC-DOS availble, there is some files called BASIC.COM and BASICA.COM. You will have to use those to enter Basic. Since you got more than 64Kb, you woud prefere to use BASICA.COM.

In those programs, the command "system" will return you to DOS.
 
If you have ROM BASIC installed, you can enter it with an INT 18H instruction.

Using any convenient hex (not ASCII) editor, create a .COM file containing only the following 4 bytes:

CD 18 CD 20

call it whatever you want. It'll execute ROM BASIC. If ROM BASIC isn't present, it'll do nothing.
 
Depending on what you already have natively you can do this in debug also. You could either do it interactively or even make the .com file yourself:

edit source.txt (or echo the following line(s) >> source.txt
Code:
e 100
cd 18 cd 20
rcx
5
n rombas.com
w
q

Then in dos assuming you have debug.com
Code:
debug < source.txt

Now you should have a file called rombas.com that has the code to run that interrupt and quit after when you exit basic.

- John
 
If you have ROM BASIC installed, you can enter it with an INT 18H instruction.

I somehow don't think that executing an INT 18h like that is a very good idea. Cassette BASIC is designed with the assumption that the first 64k of memory is empty. You'll end up running into DOS and whatever else is loaded there, and possibly lock the machine up. It's the same reason you shouldn't execute an INT 19h from DOS.

call it whatever you want. It'll execute ROM BASIC. If ROM BASIC isn't present, it'll do nothing.

Actually, all different things could happen when INT 18h is executed, depending on the BIOS. My Pentium (for example) displays a message asking whether you want to retry the boot or go into the BIOS setup.
 
I somehow don't think that executing an INT 18h like that is a very good idea. Cassette BASIC is designed with the assumption that the first 64k of memory is empty. You'll end up running into DOS and whatever else is loaded there, and possibly lock the machine up. It's the same reason you shouldn't execute an INT 19h from DOS.

That's if you want to return to what you was previously doing without restarting the machine. When executing a Int 18h/Int 19h from DOS, the computer will totally forget all it was doing and either enter BASIC (if present and Int 18h is executed) or attempt to warm-boot (if Int 19h is executed).

The only risk in this is if you run some kind of shell that handle files in an unstable way, say a pseudo-multitasking envroniment, if a file on a disk is being altered and the Int 18h/19h instruction executes before the altering of the disk file is complete, you will most likely end up with a corrupted file, or in the worst cause a corrupted file system (the same risk is if you just drag out the power cord of your desktop when writing loads of data to a disk, or disconecting a USB memory stick when it is being written to). As I know, DOS doesn't write data to the disk when executing a command that doesn't ask it to write data to the disk, so from DOS, this method should be safe.

One note, the DS register must be set to zero (0000h) before entering Int 18h. Register ES is also zeroed in the BIOS routine that calls BASIC, but it doesn't seems like a requirement. I don't know if BASIC sets up it's own stack or not, but it most likely do since I have gotten it to work without setting the stack registers.
 
These documents don't give you an answer but may contain some interesting info:
http://ohlandl.ipv7.net/config/ROM_Basic.html...

Sometimes I kind of hate it when Louis quotes me, and I look at it later to find I was prattling on. It's hard even for me to read. Since I'm somewhat is control of the hosting (at another address, although I give quite a bit of artistic license to Louis) I should go in and clean it up a little.

Does the OP have the PC-DOS product?...

If so, can't he type "BASIC" or "BASICA" to enter ROM BASIC, then "SYSTEM" when through?...

Or the GWBASIC/QBASIC as appropriate otherwise?...
 
I don't know if BASIC sets up it's own stack or not, but it most likely do since I have gotten it to work without setting the stack registers.

It does; in fact the PAINT statement in BASICA 1.x can overflow the stack when filling complex areas (use the CLEAR statement to allocate more stack space). All later versions of BASIC don't use the stack with PAINT, and thus don't have this problem.
 
It does; in fact the PAINT statement in BASICA 1.x can overflow the stack when filling complex areas (use the CLEAR statement to allocate more stack space). All later versions of BASIC don't use the stack with PAINT, and thus don't have this problem.

ROM BASIC doesn't rely on anything in particular when entered through INT 18H. As the OP asked "How to you enter BASIC if there is a DOS installed in XT?"

Nothing was said about how to get back to DOS. If you want the door to swing both ways, use PC-DOS BASIC or BASICA. :)

Interestingly, even GWBASIC relies on some settings (in segment 50H) that the BIOS leaves behind however. That may also be true for ROM BASIC A special "patch" program is required with Compaq Deskpros to run GWBASIC.
 
ROM BASIC doesn't rely on anything in particular when entered through INT 18H.

except for register DS=0000h
Entering with any other value in DS will lock up the machine; I've tried.

Interestingly, even GWBASIC relies on some settings (in segment 50H) that the BIOS leaves behind however.

Segment 50h is the DOS communication area, and is altered by DOS only (not the BIOS). The BIOS communication area is at Segment 40h.
 
Last edited:
Sometimes I kind of hate it when Louis quotes me, and I look at it later to find I was prattling on. It's hard even for me to read. Since I'm somewhat is control of the hosting (at another address, although I give quite a bit of artistic license to Louis) I should go in and clean it up a little.

Does the OP have the PC-DOS product?...

If so, can't he type "BASIC" or "BASICA" to enter ROM BASIC, then "SYSTEM" when through?...

Or the GWBASIC/QBASIC as appropriate otherwise?...

EDIT: Ok, I missed that it is (most likely the MS version) DOS 5 installed. And it did get a good conversation started where I am learning something (and pages I can revise). I'll just be quiet now.
 
Okay, so let's amend the sequence to make sure that DS=ES=0:

31 C0 8E D8 8E C0 CD 18 CD 20

Segment 50H may be the DOS comm area, but Deskpros treat it differently from everyone else. You'll never get GWBASIC to run on a Deskpro, even under XP on P3 Deskpro without the patch. There's a flag that says "GWBASIC is already resident" that the Deskpros set during initialization for whatever reason.
 
Segment 50H may be the DOS comm area, but Deskpros treat it differently from everyone else. You'll never get GWBASIC to run on a Deskpro, even under XP on P3 Deskpro without the patch. There's a flag that says "GWBASIC is already resident" that the Deskpros set during initialization for whatever reason.

Does that go for the Compaq portables too?

Maybe I could dump the whole segment on both my Compaq portable any my XT and see if there is any differences (when using the same version of DOS)...
 
Okay, so let's amend the sequence to make sure that DS=ES=0:

31 C0 8E D8 8E C0 CD 18 CD 20

...

Or building on the method John provided, an edit of his post would instead be:

Code:
e 100
31 C0 8E D8 8E C0 cd 18 cd 20
rcx
B
n rombas.com
w
q
 
Or, suppose that you didn't have DEBUG (or any other program around), you could do it this way:

echo stuff>gobas.com

Where stuff is created by pressing the Alt-key and keying three digits at a time, then releasing the Alt key, the following numbers on the numeric keypad:

049
192
142
216
142
192
205
024
205
032

An extra 0D 0A will be appended by echo, but it doesn't matter as it's not executed.

Just skinnin' the cat a different way... :)
 
It appeared to have Debug on it, but didn't know how to use it. These commands will be helpful since I don't have any convenient ways of copying files over currently.

Will try when I get home.

Also, it's possible the ROM BASIC is not installed? I thought XT's always came with it installed from the factory?

Forgive my ignorance, new to the old IBMs.
 
It appeared to have Debug on it, but didn't know how to use it. These commands will be helpful since I don't have any convenient ways of copying files over currently.

Will try when I get home.

Also, it's possible the ROM BASIC is not installed? I thought XT's always came with it installed from the factory?

Forgive my ignorance, new to the old IBMs.

You can be safe that ALL of the IBM machines made up to 1991 has ROM BASIC. IBM had to include it because of a license agreement they made with Microsoft when IBM created the PC in 1981 (I guess it was a 10-year contract).

Microsoft got royalities from IBM, and IBM got to incliude Microsoft's BASIC in their PC's. In the 70's, the fact that a well known and easy-to-learn programming language like BASIC was included had been vital to the sucess of any microcomputer. It was more or less like that when IBM entered the field in 1981, so that's why it was strategic of them to include it. Why the agreement lasted for 10 years was because IBM got a discount in price then, so that's why they included it so long even after it went obsolete in the early-mid 80's.
 
You can be safe that ALL of the IBM machines made up to 1991 has ROM BASIC. IBM had to include it because of a license agreement they made with Microsoft when IBM created the PC in 1981 (I guess it was a 10-year contract).

Microsoft got royalities from IBM, and IBM got to incliude Microsoft's BASIC in their PC's. In the 70's, the fact that a well known and easy-to-learn programming language like BASIC was included had been vital to the sucess of any microcomputer. It was more or less like that when IBM entered the field in 1981, so that's why it was strategic of them to include it. Why the agreement lasted for 10 years was because IBM got a discount in price then, so that's why they included it so long even after it went obsolete in the early-mid 80's.

I had it from an IBM insider that the royalty rumors were untrue. For my part, it sounds rational, but I really don´t know. Just what he said.
 
Back
Top