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
16
votes
3answers
1k 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 ...
30
votes
3answers
2k 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....
7
votes
1answer
611 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 ...
37
votes
3answers
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 ...
9
votes
4answers
609 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 ...
5
votes
3answers
935 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 + ...
10
votes
4answers
506 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 ...
13
votes
8answers
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"...
23
votes
7answers
4k 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 ...
0
votes
2answers
246 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 ...
6
votes
3answers
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 ...
2
votes
1answer
167 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 ...
10
votes
4answers
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 ...
20
votes
17answers
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 ...
15
votes
2answers
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 ...
3
votes
2answers
494 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-...
4
votes
4answers
555 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 ...
13
votes
4answers
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, ...
8
votes
1answer
279 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 ...
1
vote
3answers
192 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 ...
7
votes
5answers
1k 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-...
5
votes
2answers
590 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 ...
11
votes
1answer
577 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 ...
1
vote
1answer
478 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 ...
23
votes
9answers
6k 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 ...
23
votes
3answers
4k views

Could you manually eject a floppy quick enough to prevent data loss?

I have the vague recollection of "Panic Ejecting" floppy disks by lifting the latch on the drive after immediately regretting a command I had typed. At the time, I was young, impulsive, and blessed ...
2
votes
1answer
119 views

Printing on the graphics screen with lowercase/uppercase letters using CHAR command in Commodore BASIC 7.0

The CHAR command in Commodore BASIC 7.0 on the Commodore 128 allows printing a text at a given position on the screen. Other than the PRINT command, CHAR also works in Hires graphics mode. Since the ...
9
votes
1answer
620 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 ...
10
votes
2answers
1k 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 ...
19
votes
4answers
3k 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 ...
14
votes
2answers
3k 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 $...
3
votes
2answers
205 views

Are there Commodore BASIC 7.0 music demos?

Commodore BASIC 7.0 that came with the Commodore 128 provided commands for playing music notes and setting different instruments. The play function even had a feature that played a note in the ...
5
votes
4answers
879 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 ...
26
votes
4answers
4k views

Why was it common to reference memory locations using negative numbers on some BASICs?

If you had an Apple II, it was common in BASIC to reference memory locations above the 32K point by using a negative number. For example, if you wanted to click the speaker you would PEEK/POKE -16336 ...
15
votes
1answer
1k views

What are the “ports” used via IN/OUT, vs. the PEEK/POKE address space?

This is something of a followup to How much control of TRS-80 Model III disk drives was possible from its Cassette (ROM) BASIC? but on a more general topic: I know that PEEK and POKE enable direct ...
8
votes
2answers
222 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 ...
9
votes
8answers
2k views

Variances in Basic highest line numbers

I used to wonder why different versions of Basic on 8bit machines would impose different limits on the highest line number permitted. I should point out this excludes any trickery to manually change ...
4
votes
3answers
283 views

Looking for a BASIC decruncher: inserting spaces between keywords

Many dialects of 8-bit BASIC allow ‘crunched’ source; that is, most spaces can be ignored between keywords: 10 FORX=1TO10 20 PRINTX,X^2 30 NEXTX After Microsoft BASIC-80 Rev. 5.x, however, spaces ...
21
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 ...
4
votes
3answers
523 views

What was stored in memory that was “unavailable to BASIC”?

On home / personal computers (such as before 1984), a machine might be described as having 24k RAM, but only 18k of that available to BASIC. If the machine had BASIC and the OS (or BIOS) stored in ROM,...
27
votes
5answers
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-...
17
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 ...
12
votes
4answers
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 ...
7
votes
1answer
538 views

Why is ZX80 much faster than Spectrum on Rugg/Feldman benchmarks?

If you look at the results of the Rugg/Feldman benchmarks, shown in this Wiki entry, you'll see that Sinclair ZX80 is much faster than Sinclair Spectrum on all tests despite the fact that both ...
8
votes
1answer
316 views

Any historical references to links between JOSS and BASIC?

I only recently learned of the JOSS language, and then only through a roundabout fashion from an interview with David Ahl where he mentions FOCAL. This led me to read the available manuals for all ...
17
votes
6answers
6k 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, ...
6
votes
7answers
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 ...
8
votes
2answers
547 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 ...
3
votes
2answers
495 views

Anyone heard of 'something like' EDITLN or EDITLINE or LINEDIT statement in BASIC?

Anyone heard of 'something like' EDITLN or EDITLINE or LINEDIT statement in BASIC for editing lines of a program's own code while executing ? I seem to remember a statement that was spelled 'something ...
9
votes
1answer
288 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 ...