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
28 votes
2 answers
4k views

Why does this BASIC program declare variables for the numbers 0 to 4?

On pages 150 to 154 of William Tang's (1982) Spectrum Machine Language for the Absolute Beginner, there are these lines of code. (Note GOTO 9000 is the first non-REM statement in the program). 9000 ...
harlandski's user avatar
  • 2,903
20 votes
4 answers
4k views

How did integer multiplication work in 8-bit BASIC without CPU support

I've recently been teaching my 11 year old binary multiplication, which is on the UK maths syllabus at secondary school. We have used long multiplication, eg shift and add. This has made me wonder ...
Mark Williams's user avatar
84 votes
18 answers
19k views

Why was BASIC built into so many operating systems?

There are a lot of retro-computers with BASIC as an integral part of the operating system. The IBM 5100 was one of the first computers with a separate memory space for BASIC, followed by the Commodore ...
wizzwizz4's user avatar
  • 18.5k
43 votes
4 answers
7k 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 ...
DrSheldon's user avatar
  • 15.8k
35 votes
22 answers
8k views

Was self-modifying code possible using BASIC?

Was self-modifying-code possible using BASIC? Parameters: On commonly affordable home-computers before 1984 Code that changes its own instructions while it is executing Using BASIC only Not using ...
questiontype's user avatar
  • 1,011
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 ...
rwallace's user avatar
  • 58.4k
23 votes
6 answers
4k views

ZX Spectrum tokenisation

The BASIC used in the early ZX Spectrum (and also its ZX predecessors) had this weird thing where every single BASIC token was printed onto the keyboard, and for example PRINT or LOAD were entered by ...
Omar and Lorraine's user avatar
11 votes
4 answers
988 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 ...
scruss's user avatar
  • 20.6k
49 votes
6 answers
7k views

Can a PET 2001 be physically damaged from BASIC?

In the early 1980s my primary school was the proud owner of a Commodore PET 2001. There was a commonly held belief among the young geek fraternity that there existed a BASIC command—perhaps a ...
Flup's user avatar
  • 651
38 votes
2 answers
12k views

Can a USR command damage a ZX Spectrum?

I recently came across this magazine snippet; specifically this section: Aprovechamos para avisar a los usuarios del Inves, que nos ha Ilegado el rumor de que haciendo: BORDER 5 RANDOMIZE USR 4665 ...
wizzwizz4's user avatar
  • 18.5k
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 ...
Gellweiler's user avatar
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 ...
tacecapS's user avatar
  • 433
32 votes
4 answers
4k views

BBC/Acorn BASIC, what made it so fast?

As I look over old versions of BASIC trying to piece together their history, I come across repeated indications that BBC Basic was really fast. One list puts it running the Ahl benchmark (for all its ...
Maury Markowitz's user avatar
30 votes
2 answers
4k views

C64: Why is POS(π) faster than POS(0)?

According to this article: german C64 Wiki article about the POS() command POS(π) is 20 % faster. Although in my experience it is ...
user avatar
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 ...
Simd's user avatar
  • 393
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 ...
Schezuk's user avatar
  • 3,742
26 votes
9 answers
3k views

What implementations of BASIC had a robust flood fill operator?

When I learned BASIC on Elektronika BK, I got fascinated with the flood fill (PAINT) operator: how does it know to get to all nooks and crannies of the shape to fill? I've devised an algorithm, tried ...
Leo B.'s user avatar
  • 18.3k
26 votes
2 answers
3k views

Was the first ARM "processor" a BBC BASIC program?

The best background I have found so far on the early development of the ARM processor at Acorn comes from this interview with Steve Furber. The interview does not mention the development of the first ...
Brian H's user avatar
  • 60.1k
22 votes
6 answers
2k views

Commodore BASIC and binary floating point precision

I am mildly curious that though the 6502 provides BCD arithmetic which would be useful for implementing decimal floating point, Commodore BASIC uses, like all (?) Micro-Soft BASIC, binary floating ...
rwallace's user avatar
  • 58.4k
22 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 ...
natevw's user avatar
  • 2,927
22 votes
4 answers
2k views

Was the design of MS-BASIC for 6502 based on MS-BASIC for 8080?

Looking through the source code of the 6502 MS-BASIC, certain parts of it seem more reminiscent of how things would be done on the 8080, then on how they should be done on the 6502. Code to find a ...
supercat's user avatar
  • 34.7k
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?
user avatar
19 votes
5 answers
2k views

Uptime in ZX BASIC

How can I obtain the uptime of a Sinclair ZX Spectrum machine (ZX48, ZX128, or Pentagon clone) via their BASIC interpreter? Specifically, the same value used by RANDOMIZE 0 to seed its PRNG. I would ...
forest's user avatar
  • 1,999
15 votes
3 answers
966 views

Origins of the "array like" strings in BASIC

A number of early microcomputer BASICs had 'array like strings' that were unlike MS's system and instead behaved like arrays of char. Substrings were accessed using a syntax like: A$ = B$(1,5) as ...
Maury Markowitz's user avatar
15 votes
2 answers
4k views

How was a line of Commodore 64 BASIC code stored in its memory?

I am reading up on old C64 stuff and I am using the Vice emulator to play with it. Currently I am studying about how the C64 stored BASIC programs in RAM. This is quite clear (it starts on address $...
Bart Friederichs's user avatar
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, ...
cjs's user avatar
  • 24.7k
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>) ...
Greenonline's user avatar
  • 3,349
10 votes
2 answers
458 views

How much control of TRS-80 Model III disk drives was possible from its Cassette (ROM) BASIC?

How much control over the TRS-80 Model III's floppy drive controller can be effected via relatively simple commands, typed into its built-in Cassette BASIC? My understanding is that general usage of ...
natevw's user avatar
  • 2,927
9 votes
4 answers
995 views

Early BASIC memory management

Can anyone verify or correct my memory here? Long ago, I had access to a Commodore PET which I think had 8kB of memory. Also slightly less long ago, I had a Commodore 64 with its "elephatine" 64kB. ...
badjohn's user avatar
  • 2,014
9 votes
3 answers
674 views

Copying disk image from HP 9122D drive

I have a HP 9122D (EDIT: its actually a 9133) combo disk drive connected to an HP 9000 model 310 computer running Basic 4.0. This setup is used to control a few machines. The hard drive is getting ...
AMiller's user avatar
  • 315
8 votes
2 answers
667 views

Saving screen pixels to string in ZX Basic

I remember programming a ZX spectrum in 128 basic (about 20 years ago). I remember I was able to save a third of the screen into a variable. Something like this: 10 LET A$ = [16384 BYTES starting at ...
zooby's user avatar
  • 183
8 votes
3 answers
502 views

BASIC09 and I-Code

I only learned of BASIC09 today, and I'm trying to wrap my head around it. The manual talks about it being a compiler, but I'm not sure I see significant differences between its I-code and tokenized ...
Maury Markowitz's user avatar
6 votes
1 answer
199 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 ...
Dirk Boer's user avatar
  • 311
6 votes
7 answers
2k views

What ways are there to "PEEK" of memory sections in (different) BASIC(s)?

Question Was there any BASIC or extension or toolbox for BASIC allowing to PEEK multiple bytes from memory in one instruction - besides the often-used DPEEK (or alike) to read a word? I'm asking ...
Raffzahn's user avatar
  • 213k
4 votes
3 answers
2k views

How can I view BASIC code hidden by SYS?

I ran a validation of an old disk, and it turns out this ruined a game (won't load) and deleted my old high score list on David's Midnight Magic. I would like to edit the code to get the high score ...
Canned Man's user avatar