Questions tagged [basic]

BASIC: a high-level programming language favored in retro systems. For dialect-specific questions, use a tag such as [microsoft-basic], [applesoft-basic], etc.

Filter by
Sorted by
Tagged with
9 votes
1 answer
241 views

Weird example code for CALL/360:BASIC

The CALL/360:BASIC manual has a couple of simple examples of file I/O. This one has me scratching my head: 10 OPEN 10, 'ITEMFILE', INPUT 20 GET 10: A$,A,B,C,D 30 LET Al = (A+B+C+D)/4 40 PRINT USING ...
user avatar
11 votes
1 answer
479 views

Critiques of ANSI/Standard/Full BASIC?

I am preparing an article on the ANSI "full BASIC" effort. I know it was heavily criticized at the time, but Google is turning up a surprising paucity of information. I can only find a ...
user avatar
29 votes
2 answers
4k views

What exactly is/was threaded p-code?

Quickbasic 4.0 added threaded p-code which at the time I remember thinking was magical. But I have no idea what it means. What exactly is/was threaded p-code (and is the p actually the Greek letter ...
user avatar
  • 393
11 votes
1 answer
467 views

Any way to simulate HP TS BASIC as seen on the 2000?

An interesting question has come up about how HP Time-Share BASIC handles this code: 10 PRINT "HOW MANY STARS DO YOU WANT"; 20 INPUT N 30 FOR J = 1 TO N 40 PRINT "* "; 50 NEXT J 60 ...
user avatar
15 votes
3 answers
2k views

Is there any significant difference in Sinclair BASIC of ZX80, ZX81 and ZX Spectrum?

I'm trying to write some programs from an old magazine that were specified to run on an ZX80/ZX81 but I'm using a Sinclair BASIC interpreter for the Spectrum. Is there any significant changes in BASIC ...
user avatar
  • 151
27 votes
1 answer
3k views

When and why was the question mark chosen to abbreviate PRINT?

In many dialects of BASIC, the PRINT statement can be abbreviated with a single question mark when entering programs or direct-mode commands. So instead of typing PRINT "HELLO, WORLD" you ...
user avatar
  • 5,694
3 votes
1 answer
184 views

MECC basic standards document?

As I understand the history, much of the original Minnesota Educational Computing Consortium (MECC) catalog was written on their own timeshare platforms, which appear to be mostly the GE (and thus ...
user avatar
16 votes
2 answers
3k views

Can someone make a photograph of the original Apple 1 Integer BASIC cassette?

I'm wondering if anyone here has an original Integer BASIC cassette and might be willing to upload an image of it to the wiki commons? There's a serious lack of imagery in the article in en.wiki, and ...
user avatar
9 votes
1 answer
586 views

Does anyone have a DG Business BASIC manual?

archive.org's DG collection has Single User BASIC and Extended BASIC manuals, but no BB manual. Does anyone have a PDF? The underlying question... the earliest mention of BB I can find is from a 1977 ...
user avatar
5 votes
0 answers
151 views

First use of MID/LEFT/RIGHT string functions

I know that BASIC-PLUS definitely used MID/LEFT/RIGHT functions, as one can see on page 5-13 of the manual. It is worth pointing out that these did not exist in the original PDP-11 basic. BASIC-PLUS ...
user avatar
12 votes
1 answer
1k views

What machine used POKE for printing?

I was looking through the Super Star Trek code when I noticed this for the first time: 7540 REM INPUT"DO YOU WANT A HARDCOPY? IS THE TTY ON (Y/N)";A$ 7542 REM IFA$="Y"THENPOKE1229,...
user avatar
15 votes
2 answers
2k views

Porting use of BASIC to-the-power ^ operator

So I was porting one of the old BASIC games from the book "BASIC Computer Games", Ref: https://github.com/coding-horror/basic-computer-games to Python, just for fun. I came across the ...
user avatar
  • 303
4 votes
1 answer
448 views

What was the origin of sigils as an alternative to explicit type declarations?

Dartmouth BASIC seems to have gotten strings around 1968, and BASIC uses the $ on variable names to indicate that they're strings. This is a strategy for avoiding the need for explicit type ...
user avatar
26 votes
7 answers
5k views

Why do variable names in BASIC need type suffixes?

The BASIC I'm most familiar with is Atari BASIC since I had an Atari 800 way back when. The Atari BASIC Source Book includes details about how Atari BASIC maintains variables. There is a Variable Name ...
user avatar
9 votes
2 answers
855 views

BASIC on the Vectrex?

I was sprucing up the Ahl Benchmark article when I noticed that one of the machines listed is the Vectrex console. It is near the top of the list, at 33 seconds, which is surprising all on its own as ...
user avatar
9 votes
2 answers
834 views

How to repeat a string in C64 BASIC V2?

I would like to achieve the following: I ask for a number from the user, run a loop number times, and in each loop run, output the string like this: -STR$ --STR$ ---STR$ ----STR$ -----STR$ I tried to ...
user avatar
  • 93
18 votes
10 answers
4k views

Why did BASIC programs tend to READ a redundant copy of DATA?

Take for example this BASIC version of ELIZA which starts out (in lines 50–170) by a number of READ loops which copy DATA (lines 1340 and following) into a handful of arrays. Isn't this rather ...
user avatar
  • 2,591
36 votes
17 answers
8k views

How fast were BASIC interpreters in the 80s? (Is this optimization for speed really necessary?)

I have a client who wants me to analyze a BASIC program from Umberto Eco's Foucault's Pendulum. I have never written a line of BASIC in my life as I was born in 1995 and started programming around ...
user avatar
19 votes
3 answers
2k views

Is there a list of space-saving techniques for representing constants?

Since numbers in ZX BASIC are always floating point and take up 5 bytes, it's often possible to save space when representing integers by using several tokens, which take up 1 byte each. I know of COS ...
user avatar
  • 1,770
18 votes
3 answers
2k views

What does this line: `T=C/2=INT(C/2)` do? Why is it valid syntax?

I do not understand line 80 of the short Applesoft BASIC program below. Didn't even know it was possible to have a single instruction be T=C/2=INT(C/2). Naturally, I tried breaking this line up / ...
user avatar
  • 189
4 votes
2 answers
268 views

Cannot assemble BASIC with high memory workspace (Z80)

This is a homebrew Z80 computer, using Z80, 64K RAM, EEPROM as well as SIO/0. I am trying to run BASIC, however I need to set the workspace at 0xC000 or higher. The code I am using is similar to https:...
user avatar
  • 351
24 votes
6 answers
4k views

Why did Visual Basic use parentheses for both function call and array access?

In VB both array access and function calls are done with () which makes it difficult to differentiate between those with a quick look. It also makes more nested levels of parentheses like MyArray(...
user avatar
  • 3,304
24 votes
1 answer
2k views

How did Commodore drives produce program listings from disk directories?

CBM BASIC 2.0 has no built-in command for listing the contents of a floppy disk. Instead, the usual way is to LOAD a pseudo-file named $ from the disk into memory. The file can then be LISTed like a ...
user avatar
  • 5,694
2 votes
2 answers
250 views

Basic09 to Windows7

I want to open a Basic 09 code under windows 7. I just want to read the code. I do not want to execute it. Is there a way to do that?
user avatar
  • 23
16 votes
3 answers
2k views

How do I save Commodore BASIC programs in ASCII?

On the Commodore 128, the built-in BASIC saves programs tokenized. How can I save (and then later load) the programs as ASCII instead? For example, like the ",A" option in GW-BASIC or the ...
user avatar
36 votes
3 answers
3k views

How can I play QBasic Nibbles on a modern machine?

MS-DOS versions 5 and 6 come bundled with the QBasic interpreter and a handful of example programs written in that BASIC dialect. One of the programs is Nibbles, a variant of the well-known Snake game....
user avatar
  • 16.6k
7 votes
1 answer
666 views

How can I detect mouse wheel movement in QuickBasic?

I am using the following code to trap left/right/middle mouse button and mouse row/column in Microsoft QuickBasic 4.5 and I need a way to detect the mouse wheel. I have looked at Ralf Brown's ...
user avatar
  • 125
40 votes
4 answers
6k views

How did Woz write the Apple 1 BASIC before building the computer?

According to his 1984 interview with Byte magazine, Steve Wozniak created the BASIC for the Apple 1 computer before he actually built the computer: I sat down and wrote the BASIC first, and that took ...
user avatar
  • 13.9k
9 votes
4 answers
940 views

Delay loop in BASIC

Yesterday I was looking for a way to implement a delay loop on the C64. I came across this page: https://www.c64-wiki.com/wiki/TIME At the bottom of the page there is a code fragment that waits for a ...
user avatar
  • 93
5 votes
3 answers
1k views

How can I read COM port addresses from BIOS in QuickBasic 4.5?

I have been using the following code to get comm port addresses from BIOS in QuickBasic 4.5: PRINT "Hex addresses for ports 0 to 3 from BIOS." DEF SEG = 0 FOR x = 0 TO 3 z = &H400 + ...
user avatar
  • 125
12 votes
4 answers
835 views

Commodore BASIC: why was the PET's GOTO so slow?

Received wisdom has it that Commodore didn't want to pay Microsoft extra for updated BASIC interpreters, and thus very little changed in Commodore BASIC v2 from the PETs to the C64. But consider the ...
user avatar
  • 17.2k
15 votes
8 answers
4k views

GOTO (etc) to a non-existent line?

Writing a BASIC interpreter has revealed a number of interesting bits of information that tend not to be mentioned in the documentation. For instance: 10 PRINT"ONE";:IF 1=2 THEN PRINT"...
user avatar
24 votes
8 answers
5k views

Why did 8-bit Basic use 40-bit floating point?

Nowadays floating point is usually either 32 or 64 bits, sometimes 16, occasionally 128. But of course, the Basic interpreters on the 8-bit machines, having to implement floating point in software ...
user avatar
  • 49.3k
5 votes
2 answers
469 views

Is there a way to make self-modifying programs in pure GW-BASIC? [closed]

I wonder if GW-BASIC may have had a method for allowing the creation of self-modifying programs just using BASIC, without needing to use PEEKs or POKEs, and not accessing disk-drives or similar memory....
user avatar
  • 450
0 votes
2 answers
267 views

Behaviour of commas in PRINT at a line-end

Does anyone have actual documentation on how MS/Commodore BASIC handles line wrapping in PRINT statements? I tried this in an online emulator: PRINT 1,2,3,4,5,6,7,8,9,0 In this case it wraps at the ...
user avatar
8 votes
4 answers
1k views

Did any 8-bit versions of MS BASIC allow user-defined string functions?

My BASIC is almost working, the almost being the DEF FN. Just so I don't paint myself into a corner, is there any "mainstream" BASIC from the 8-bit era that allowed user-defined string ...
user avatar
2 votes
1 answer
210 views

Peripherals needed to run Tiny BASIC interactively on an Intel 8080

I have an Intel 8080 core and would like to build the minimal computer system around it to run Tiny BASIC interactively. I am building this computer on an FPGA, so I am not asking about actual ...
user avatar
  • 2,533
10 votes
4 answers
1k views

What were the first BASIC interpreters to be programmed in high-level languages?

I've been continuing to revise and expand the Wikipedia article that I started on BASIC interpreters. One of the criticisms was that it was too focused on the microcomputer era (which interested me ...
user avatar
20 votes
17 answers
5k views

8-bit home computers without BASIC

All the 8 bit home computers I'm aware of, had BASIC in their ROMs. A notable exception was Jupiter Ace, a british home computer, which used Forth. Were there any other 8 bit home computers that came ...
user avatar
  • 1,083
17 votes
2 answers
2k views

What is the oldest reference to PEEK, POKE, and USR?

I've been reading manuals for BASIC implementations and the earliest reference I can find to PEEK, POKE, and USR is in the Altair BASIC 3.2 manual, published in 1975. This morning I came across this ...
user avatar
3 votes
2 answers
757 views

Was it possible to win the "Lunar Lander" game with less fuel than the default?

A while ago I asked about the possible origin of a Russian version of the "Lunar Lander" game. No definitive answers were given. Meanwhile, I was able to decompile the binary into a semi-...
user avatar
  • 15.8k
5 votes
4 answers
699 views

Would some BASIC interpreters for microcomputers be considered operating systems?

As software for micros developed, you could use the BASIC interpreter just to CLOAD and RUN assembly language programs. Those might call BASIC ROM routines (say, for converting ASCII input to binary ...
user avatar
13 votes
4 answers
3k views

Could you create a loop in direct-mode with BASIC?

Were there any home computers before 1985, on which you could create a loop (finite or infinite) in direct-mode? And if it was possible on some machines, what may it have been useful for? For example, ...
user avatar
  • 450
8 votes
1 answer
306 views

BASIC on the Nova?

The first widely documented BASIC on the Data General Nova platform appears to be Data General Extended BASIC. I can date it to at least 1978 due to copyrights in the manual, but I suspect it was ...
user avatar
3 votes
5 answers
476 views

How to determine where in RAM the current Basic program resides on Amstrad microcomputers?

How can I find where in memory to locate the current Basic program in an Amstrad CPC/PCW family Zilog Z80-based microcomputer? Is it always the same address? A different well-known address depending ...
user avatar
  • 4,350
7 votes
5 answers
2k views

Positive/negative 16-bit integer formats in 8-bit systems?

While considering the recent question on Integer BASIC, a thought arises: Most systems using/supporting integer math used a 16-bit signed format. In the case of Integer BASIC, this leads to odd-...
user avatar
5 votes
2 answers
753 views

Does Sinclair Spectrum BASIC have a maximum length for one line?

I was just writing some junk Speccy Basic programs, more to see how they take up space on the +3's disk layout than to do any actual programming. But I noticed that after editing a program line to ...
user avatar
  • 4,350
11 votes
1 answer
707 views

What additional hardware was required for BASIC on an Altair 8800?

I remember being aware of the Altair 8800 when it made it's mark, but only vaguely. Lately I found myself wondering what hardware was required for the Altair to get BASIC up and running. According ...
user avatar
  • 8,436
1 vote
1 answer
622 views

How can I link a BASIC program with BASIC 3.5 for C64?

In the magazine 64er from June 1990 a BASIC extension for running Commodore Basic V3.5 on the C64 was presented. The extension is available at csdb. However, to run a BASIC 3.5 program, it is ...
user avatar
  • 4,080
28 votes
10 answers
7k views

Why did 8-bit computers choose BASIC dialects as "de facto" command-line interface, instead of contemporary Shell/Lisp dialects?

While all three clans of languages predated 8-bit computers, they shares features like 1) imperative programming, 2) English-alike keywords, 3) Prompt-Command-Parameters pattern interface. Why was ...
user avatar
  • 2,438