Questions tagged [basic]

For questions about BASIC, a lightweight, high-level programming language favored in retro computer systems.

Filter by
Sorted by
Tagged with
107
votes
2answers
18k views

How did Commodore's anti-Microsoft Easter Egg work?

A couple years ago the Toronto PET Users Group published an article (The Great Commodore/Microsoft Easter Egg War, on p. 7) about a newly discovered anti-Microsoft Easter Egg that Commodore hid in the ...
80
votes
18answers
17k 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 ...
47
votes
3answers
7k views

Strange math syntax in old basic listing

I'm browsing through an old book "Basic Computer Simulation" from 1983. It contains a line of BASIC code that reads: LET Z1 = M * D1 * (PQ / A) [ 3 I understand all of the code except the "[ 3" I ...
44
votes
5answers
6k 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 ...
40
votes
1answer
4k views

What computer system is this from 1984 Doctor Who?

In the 1980s, the popular BBC science fiction series Doctor Who used some real computer system(s) to display impressive (for the time, OK, maybe not!) graphics. They actually ran the software real-...
31
votes
4answers
2k views

Why were early versions of BASIC different?

Most major computer manufacturers/distributors in the 70's and 80's included BASIC with their computers. Some (as answers to this great question have detailed: Why was BASIC built into so many ...
29
votes
4answers
2k 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 ...
29
votes
2answers
3k 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 ...
28
votes
20answers
7k 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 ...
25
votes
5answers
4k 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-...
25
votes
2answers
2k 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 ...
22
votes
6answers
3k 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 ...
21
votes
7answers
1k 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 ...
21
votes
3answers
1k 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 ...
20
votes
4answers
1k 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 ...
19
votes
2answers
2k 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 ...
19
votes
8answers
2k 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 ...
18
votes
2answers
1k 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 ...
17
votes
9answers
3k 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 ...
17
votes
4answers
2k views

Understanding INKEY$ in ZX BASIC

The ZX BASIC Manual gives the following little program to demonstrate how INKEY$ works: 10 IF INKEY$ <> "" THEN GO TO 10 20 IF INKEY$ = "" THEN GO TO 20 30 PRINT INKEY$; 40 GO TO 10 While I ...
17
votes
3answers
3k views

Was Locomotive BASIC significantly better than Sinclair BASIC?

The Amstrad CPC range of Z80 machines shipped with a ROM BASIC, designed and implemented by Locomotive Software. The most well known competitor was the Sinclair ZX Spectrum, also a Z80 machine, with ...
17
votes
5answers
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 ...
17
votes
4answers
1k 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 ...
16
votes
2answers
2k views

How to decode an audio file which contains an MSX BASIC program? [closed]

I have an audio file in WAV format, which supposedly comes from a cassette sound file. Moreover, it contains a BASIC program, but I don't know how to decode it. I have tried to convert the wav file to ...
14
votes
6answers
5k views

How slow was the 6502 BASIC compared to Assembly

Imagine a modern computer, where let's say Python is a high level programming language and needs to be interpreted in order to execute a piece of code. You could write some code in C, compile it, ...
14
votes
4answers
1k views

How to use BASIC after “LOAD ”$",8 on the C64

After loading a file list from a floppy disk it is hard to program in BASIC because the file list is interpreted as BASIC lines. For example there can be 20 lines with the number 1, because 20 files ...
14
votes
1answer
550 views

Origin/source of “One Line” one-key game

Circa 1985 in our school BBC Micro lab, we wasted much time playing a tiny type-in game that looked a bit like this: The playfield was filled with a random arrangement of asterisks, and the player ...
13
votes
7answers
1k views

New 6502 BASICs?

I sort of "have a thing for BASIC" right now, which has led to a couple of great exchanges here in RSE about the variations "back in the day". I'm wondering if anyone is aware of other modern BASICs ...
13
votes
3answers
5k views

MSX Assembly/Basic programming documentation

I'd like to try to create software (and maybe simple games) for the MSX standard. I know I have two ways to do so, either I use MSX Basic or Z80 assembly. I think that Z80 assembly is more powerful ...
12
votes
4answers
1k 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?
12
votes
2answers
703 views

Why was BASIC on the Commodore 64 one byte shy of 38KiB?

When you power up a Commodore 64 you are greeted with a friendly message telling the user it has 38911 BASIC bytes free. 38,911 is one byte shy of a 38 KiB (1,024 * 38 = 38,912). What was the reason ...
12
votes
1answer
450 views

How to use virtual cassettes with Matthew Reed's TRS-80 Model III emulator? (TRS32)

I'm fooling around with Matthew Reed's TRS-80 Model 1/III/4 emulator for Windows (TRS32) and am have trouble using virtual cassettes. I am using it to emulate a Model III with Level II BASIC. I have ...
12
votes
0answers
774 views

In search of… SeaWar — NOT Battleship!

Hopefully, sufficient background Many years ago (40-45), I used to play "Sea War" on a good sized time-share system. It was a text/adventure war game between a couple remote players, played over a ...
10
votes
4answers
2k views

What are the rules for Applesoft BASIC formatting for code?

What are the rules for Applesoft BASIC formatting for code? I've been doing some BASIC coding and noticed that: 10 input "some question?"; name$ Will be reformatted as: 10 INPUT "some question?";...
10
votes
3answers
789 views

Is it possible to crash the Apple II using only the Apple II Basic REPL?

Prerequisites: 1) Apple II 2) Basic Prompt Using only the instructions provided, can you crash the Apple II? I'm curious if this is even possible because I have only ever programmed the ...
10
votes
4answers
3k views

Was Family BASIC for the NES/Famicom powerful enough to create full games and applications?

"Family BASIC or Famicom BASIC is the consumer product for programming Nintendo's Family Computer video game console of Japan." wikipedia I can't seem to find much info about Family BASIC ...
10
votes
2answers
592 views

Why does this BASIC program keep restarting?

Here is a BASIC program for the Commodore 64, which should load the LIB file from the disk, and then stop. Yes? 5 PRINT "LOADING..." 10 LOAD "LIB",8,1 20 STOP the LIB file is 102 bytes long and is ...
10
votes
1answer
332 views

What is the format of the syntax tables in Apple II Integer BASIC?

In Paul Santa-Maria's disassembly of Integer BASIC (text version), you can see the syntax table split into two parts, SYNTABL and SYNTABL2. I've seen references to the tokens being stored in reverse ...
9
votes
2answers
2k views

Did Microsoft BASIC ever use Z80 only instructions?

Did Microsoft BASIC (or any of the OEM versions) ever use Z80 only instructions? For the purposes of this question I'm ignoring the equivalent of BIOS I/O layers which OEMs would have provided.
9
votes
4answers
750 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. ...
9
votes
3answers
3k views

What “Write your own RPG/Adventure game” books were available for 8-bit computers? [closed]

During the 70s and 80s there were a number of books about how to write your own games for 8-bit computers, usually in BASIC. Three examples of these books are How to Create Adventure Games by ...
9
votes
1answer
2k views

Sources for some old BASIC games

Poking about in early issues of Dr Dobbs' Journal (the journal of the People's Computer Company, or PCC) I came across a listing for BASIC games available on tape. Many of these are widespread, but a ...
9
votes
1answer
359 views

Purpose of using REM when running TR-DOS commands in BASIC

When running TR-DOS commands from within BASIC, it's necessary to prefix the command with RANDOMIZE USR 15619: REM: first. I understand the former command, but not the latter. For example, to load a ...
9
votes
1answer
528 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 ...
8
votes
3answers
395 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 ...
8
votes
2answers
599 views

ZX BASIC REM statement overhead

Since my other question has been answered and has given me a way to do high-precision timing, I've been experimenting with it a bit. The first thing I did was write a simple benchmark using the FRAMES ...
8
votes
1answer
223 views

String libraries for BASIC

Looking over old BASICs I find two general approaches to handling string variables. HP/Wang/Atari/et al used C-like array-of-char whose memory size is specified with a DIM statement, with the upside ...
8
votes
1answer
134 views

cbm prg studio for the Amstrad

CBM prg studio is brilliant. I have searched Google for a version (or something similar) for the Amstrad CPC 464, to no avail. Does anyone know of one?
8
votes
1answer
653 views

Looking for a specific BASIC music program from the 80s

When I was a kid, we had a PC-XT with a lot of GW-Basic programs on it. I am trying to track down one in particular -- it was a music player of sorts. A menu (all monochrome text as I recall) and you ...
7
votes
2answers
1k views

C64: Strange Behaviour on Control Port 1

I wrote this little Basic program to get Joystick input from Control Port 1. I know that this method is very strange and is better for keyboard input. 20 get a$ 30 if a$="" then 20 32 b=asc(a$) 33 ...