Questions tagged [microsoft-basic]

Microsoft’s Altair BASIC interpreter, its later ports, expansions and dialects (like PC BASIC, Commodore BASIC). Use [applesoft-basic] for the Applesoft dialect specifically.

Microsoft BASIC is the foundational product of the Microsoft company. It first appeared in 1975 as Altair BASIC, which was the first BASIC by Microsoft and the first high level programming language available for the Altair 8800 microcomputer.

34 questions
15
votes
2 answers

Is integer arithmetic really slower than float with (early) MS-BASIC?

This question is based on a comment by Neil on another question regarding integer-multiplication: Do you have any citations for your claim that most MS-BASIC integer multiplication was done by turning into floats? Seeing as how the majority of…
Raffzahn
  • 222,541
  • 22
  • 631
  • 918
11
votes
1 answer

How were Microsoft GW-BASIC "protected" files encoded?

Microsoft GW-BASIC on IBM compatibles allowed flags to the SAVE command, to indicate the manner in which a file should be written out. As I recall, it allowed for no flag to write a standard tokenized format, ,A to write a plain-text ASCII BASIC…
user
  • 5,286
  • 2
  • 26
  • 43
8
votes
5 answers

BASIC-PLUS inline operators, do they actually make sense?

Of the features that were not copied from BASIC-PLUS to MS BASIC only one seems to be a good idea, and I'm not sure it really is. I'd like to hear from people that have opened the guts of MS BASIC to comment. For those of you who have not heard of…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
8
votes
2 answers

In MS BASIC, why is NEXT faster than NEXT I?

I was reading over a thread on BASIC speeds on various home computers and noticed an interesting point that was not explained. Apparently, in MS BASICs, a loop using FOR I= ... NEXT will run faster than FOR I= ... NEXT I. Does anyone know why? I…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
8
votes
4 answers

MS BASIC, access a DIMed variable with no index?

I'm working my way through my retrobasic interpreter, feeding it an expanding diet of 101 BASIC Games. Here's an odd one... 40 DIM F(6,6),H(6,6),A(4),B(4),C(6),L(3) ... 90 A=INT(6*RND(1)+1) This kills my interpreter because the DIM says this is an…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
4
votes
0 answers

Oddity in MS BASIC line lookup code on the 6502

Does anyone know for sure why MS BASICs on the 6502 compared only the page number when deciding where to look for line numbers on branches? IIRC, it would only "start looking from here" if the target was at least a page higher. This seems odd, as it…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
4
votes
1 answer

Why did MS BASIC use the line number for FOR loops?

I was always under the impression that MS BASIC implemented NEXT by pushing the address of the FOR on the stack. So convinced that when I read the source code I assumed CURLIN had to be referring to the address. Quelle surprise! So does anyone know…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
3
votes
0 answers

Why did the byte before TXTTAB have to be zero in MS-BASIC?

As mentioned in this answer about how the C64 stores BASIC program text, MS-BASIC uses a pointer called TXTTAB that points to the start of the program text, which is typically at address 1 in a page. For example, on the Commodore 64 it's at address…
cjs
  • 25,592
  • 2
  • 79
  • 179
3
votes
2 answers

How did early MS BASIC handle "local" variables in DEF FNX(A)?

I'm not conversant enough in Intel assembler to understand what's going on in the early MS interpreters, so maybe someone can help... Generally in MS-derived BASIC an expression would only be semi-"chunked" and in the simple cases would pretty much…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
2
votes
3 answers

Semis and spaces in MS-alike BASIC PRINT commands

With the exception of DEF FN and the handful of direct-mode commands (CONT, LIST, etc), my interpreter is running most programs, but layout remains an issue. Here are three lines from the BASIC Computer Games' "23 Matches"... 270 PRINT "THE NUMBER…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
2
votes
1 answer

Long variable names in MS BASIC

From the Wiki: The final major release of BASIC-80 was version 5.x, which appeared in 1981 and added support for 40-character variable names, WHILE...WEND loops, dynamic string allocation, and several other features. BASIC 5.x removed the…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
2
votes
1 answer

Integer overflows in MS BASIC

I only recently learned that the early MS BASICs had integer variables and do not have a machine that runs it. So perhaps someone with a PET or C64 could answer these questions? For one, were there integer constants as well as variables? I'm not…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138