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
21 votes
10 answers
5k 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 ...
14 votes
2 answers
2k views

What is the bug in Creative Computing's version of "Amazing"?

I am reading about the history of the "game" Amazing that was converted to MS BASIC in BASIC Computer Games. These articles often note that the game has a bug in it, but I cannot find anyone ...
2 votes
3 answers
541 views

What binary format did QuickBasic use for BAS files?

I found some very old floppy disks. I sent them to a company to restore the files and they were still retrievable! Next to old games and simcity save games I found some .BAS files. Some of the names I ...
10 votes
1 answer
524 views

Problem using Commodore 64 BASIC TAB() command in abbreviated form

I’ve encountered a bug on the Commodore 64. When I write out the full TAB command, i.e., TAB(…), everything works as expected. However, when I use the abbreviated form, tA, an extra parenthesis is ...
6 votes
1 answer
189 views

How to run MOUSSUBS.BAS in QuickBasic? Looking for MIXED.QLB and MOUSE.ASM?

I retrieved some 30 year old basic files from old floppy disks. Now I am trying to run some games I made back then. Some of them are actually dependent on this file called MOUSSUBS.BAS. That file ...
16 votes
1 answer
3k views

Why was BASIC's INT() a floor, and not a truncate?

Reading over some older bits I've collected over the years, it appears that some early BASICs used a truncate for their INT function, but this was standardized on floor. Any ideas why? Poking about I ...
7 votes
6 answers
1k 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 ...
33 votes
2 answers
3k views

Which BASIC-like language has "ENDIF", "DIM ... OF" to declare arrays, and a double slash for comments?

My mom found some old source code that she wrote for a course around the year 1983. I've tried to identify the language that is used, but have come up empty-handed. It seemed to be BASIC at first, but ...
12 votes
2 answers
2k views

What is this unusual syntax for the Commodore SYS command?

I was recently interested in how to 'bload' some data on my commodore 64. For the sake of discussion the data isn't really relevant (it could be any blob of bytes). Generally you can load a file into ...
6 votes
3 answers
1k 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 ...
14 votes
4 answers
3k views

Why does Sinclair BASIC have all of the characters twice in the token table?

I'm looking over the table of tokens for Sinclair BASIC and I'm struck by two things. One is that it's not ASCII. Some parts are in the same order, but others are not, so it would seem conversion is ...
19 votes
10 answers
4k views

What caused the demise of BASIC/BASICA in the late 1980's?

While not strictly adhered to, this is somewhat of a generalization of computer listings found in the more popular magazines of the time - BYTE, Kilobaud, PC Computing, etc. This explains the ...
8 votes
4 answers
1k views

Is it possible in Commodore BASIC V2.0 to configure the system so that the PRINT command does not update color?

The PRINTcommand in Commodore BASIC V2.0 (the one that runs on the Commodore 64) prints each character to the screen address (which is set by the byte in address 648) as well as putting the current ...
33 votes
2 answers
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 ...
9 votes
1 answer
869 views

Restore a BASIC program after reset or "NEW" command on a Commodore 128

A BASIC program that was deleted with NEW or after a reset can be restored on Commodore computers as long as no new programs are entered or loaded (or the computer is powered off). For the C64, the ...
34 votes
6 answers
5k views

What type of interpreter were most 8-bit BASIC implementations?

I’m a big fan of early/mid 1980s personal computers like the Amstrad CPC, Commodore 64 and the Sinclair Spectrum. One thing these computers all had was a version of BASIC. Well known ones being MS-...
5 votes
2 answers
1k views

Is it possible to write unit tests in Applesoft BASIC?

It's been decades since I wrote anything in BASIC. But I'm curious: If I were to go back and start playing around with it, would my test coverage be essentially zero percent by necessity? Or is there ...
23 votes
21 answers
6k 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 ...
7 votes
4 answers
882 views

What books did schools use to teach BASIC?

What books would have been used to teach school aged kids BASIC in a classroom setting back when BASIC was in common use? 8-Bit computers commonly came with tutorials to learn BASIC, like A Touch of ...
14 votes
2 answers
762 views

Why did Extended BASIC on the TI-99/4A only allow 28 of the 32 sprites?

The Video Display Processor (VDP) of the TI-99/4A was capable of displaying 32 hardware sprites. These sprites were unusable with the default, built-in BASIC that TI provided. However, an enhanced ...
5 votes
1 answer
649 views

WIDTH command in MSX BASIC

I'm thinking of doing a project in MSX BASIC. I've seen some books where they discourage setting the width of SCREEN 0 to 40 characters wide with the WIDTH command (or 32 characters wide in SCREEN 1), ...
2 votes
2 answers
663 views

Software to generate C64 BASIC code printing PETSCII art

I am looking for a good toolkit to auto-generate C64 basic code, which eventually prints different PETSCII graphics. I am wondering, if there is a good workflow for this, e.g. using a graphical ...
34 votes
8 answers
4k views

What made some 8-bit BASIC interpreters especially slow?

Most 8-bit systems had a BASIC interpreter that ran at a rate roughly commensurate with the CPU type, speed, memory bandwidth and interrupt status. Some systems, however, had interpreters that ran at ...
5 votes
2 answers
421 views

Printing characters not at expected position

Simple program... 10 print chr$(147);chr$(5) 20 poke 53280,4: poke 53281,0 30 y=0 : for x = 1 to 35 40 poke 214,y : print : poke 211,x 50 print chr$(171);chr$(177);chr$(179); 60 next x : print : print ...
3 votes
0 answers
198 views

What did the 32K RAM Memory Expansion Cartridge do for V-Tech PreComputers?

As a youngster in 1994, I was the happy recipient of a V-Tech PreComputer ThinkBook. The device had many built in games and activities, including a version of BASIC programming. It also had an ...
12 votes
1 answer
2k views

Which version of BASIC uses RANDOM for seeding the random number generator (RNG)?

Which version of BASIC uses RANDOM as the pseudo-random seed command? I believe that the following is correct, given the linked-to articles: Atari BASIC uses RANDOMIZE C64 BASIC uses RND(-<n>) ...
3 votes
2 answers
324 views

Atom BASIC, anyone here used it or can emulate it?

I'm reading over "Atomic Theory and Applications" (best name EVAR) but having never used the Atom a couple of things are confusing me. For one, did the Atom have a "full screen" ...
20 votes
6 answers
3k views

C64 BASIC: How to suppress the '?' sign when using the INPUT command?

When you are getting INPUT in Commodore BASIC it always adds a question mark at the end of the string you want to show. Is there a way to suppress the question mark when using the INPUT command?
13 votes
2 answers
718 views

Why does the FRE() function in CBM BASIC v2 return negative values?

On Commodore machines featuring CBM BASIC v2, the FRE() function to query the amount of memory available to BASIC returns a negative number when the result exceeds 32767 bytes: This quirk does not ...
14 votes
1 answer
1k views

Why is the original Altair BASIC (for the 8080 CPU) source code not available on-line?

As described by The Register in 2001, around 1987 journalists and others started asking Bill Gates for a copy of the source code for the original version of Altair (eventually Micro-Soft) BASIC, ...
15 votes
1 answer
289 views

Which BASICs used a backslash, \, as a statement separator?

Most dialects of BASIC allow multiple statements on a line, typically separated by colons. However, I've come across two programs that use '\' as the separator instead. One is Chase, and the version ...
35 votes
6 answers
3k views

Did the LET statement actually do anything in 8-bit Microsoft BASICs?

I know the LET statement was available in AppleSoft and other Microsoft 8-bit BASICs back in the day, but I can't think of a time where I actually used it. Frankly, I get the impression that it was ...
9 votes
3 answers
705 views

BASIC : POKE and PEEK prohibited on the same line?

Having been raised on an 8-bit Commodore, I was never afraid of PEEKs and POKEs. I remember trying to accomplish something on a computer, in BASIC, using PEEKs and POKEs, and discovering that this ...
4 votes
2 answers
277 views

How do I use the extra commands in the Spanish version of the 128k Spectrum ROM?

The Spanish Inves/Investronica version of the 128k Sinclair Spectrum had a rather different ROM from the English 128k Speccy. Error messages were in Spanish, there were extra letters and punctuation ...
14 votes
1 answer
884 views

How are the extra BASIC keywords of the Timex Sinclair 2068 that the ZX Spectrum didn't have encoded?

I've read that the BASIC of the Timex Sinclair 2068 is a superset of the BASIC of the Sinclair ZX Spectrum with a few extra keywords. The extra keywords are: DELETE delete BASIC program lines, FREE ...
11 votes
3 answers
2k views

Is it possible to PRINT AT 23,0 in ZX Spectrum BASIC?

The ZX Spectrum BASIC doesn't (ordinarily) let you print on lines 23 and 24 to allow for user input. Is there a way around this? I found a fairly recent post that suggested I could POKE 16418,0 but ...
18 votes
2 answers
3k 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 ...
23 votes
8 answers
3k views

Which BASIC interpreters support techniques for hybrid programming in Assembly?

It was common with Commodore BASIC (and others, I'm sure) to have machine language encoded in BASIC programs using POKEs or READ/DATA. This was needed for both performance and to access certain ...
3 votes
1 answer
312 views

How to change graphics modes from BASIC on a Timex/Sinclair 2068?

I've got the Timex/Sinclair 2068 emulation working under MAME and wanted to play with its extra graphics modes the original version of the Sinclair ZX Spectrum didn't have. But despite an hour of ...
14 votes
3 answers
1k views

How can one do bitwise Boolean operations in later versions of Applesoft BASICs?

According to this answer, Apple changed the AND, OR, NOT operators in later versions of BASIC to perform Boolean instead of bitwise logic, so for example (1 AND 2) = 1. Which raises the question, how ...
8 votes
1 answer
597 views

BASIC Output to RS-232 with Tandy Model 100

I want to use a program like this on a Tandy Model 100: 10 REM COM Port SetUp 9600 8N1??? 20 PRINT "TRS-80 Model-100 is sending this out!" 30 GOTO 20 I need to know what line(s) to replace ...
5 votes
2 answers
649 views

Dartmouth BASIC array dimensions question

I'm trying to implement the CHANGE command from Dartmouth BASIC v4 and later. It allows you to convert a string into an array of numbers and back again. One key bit of the concept is that the length ...
20 votes
3 answers
3k 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 ...
2 votes
1 answer
107 views

Floating point for HP 2000F TSB port to MSP430FR5994

The HP 2000F TSB system doesn't (could not, as it didn't yet exist) support IEEE 754 formats. HP's early design extends from the range of 2−(255−127)−1 to 2+(255−127)−1. The (−1) shown there is ...
26 votes
8 answers
6k 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 ...
2 votes
3 answers
262 views

HP 2000F TSB ported to MSP430FR5994

Preface I'm considering the idea of porting the time-shared BASIC (TSB) that was developed by Hewlett-Packard for the HP 2000F TSB system, which used two processors at the time (one for the I/O and ...
37 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....
9 votes
1 answer
282 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 ...
12 votes
1 answer
518 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 ...
29 votes
2 answers
5k 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 ...