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
0answers
509 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 ...
5
votes
0answers
145 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 ...
12
votes
1answer
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,...
15
votes
2answers
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 ...
4
votes
1answer
432 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 ...
25
votes
7answers
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 ...
9
votes
2answers
839 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 ...
9
votes
2answers
755 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 ...
18
votes
10answers
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 ...
35
votes
17answers
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 ...
19
votes
3answers
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 ...
17
votes
3answers
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 / ...
4
votes
2answers
260 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:...
24
votes
6answers
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(...
24
votes
1answer
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 ...
2
votes
2answers
243 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?
16
votes
3answers
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 ...
31
votes
3answers
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....
7
votes
1answer
650 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 ...
40
votes
4answers
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
804 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
983 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 + ...
11
votes
4answers
689 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 ...
14
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"...
24
votes
8answers
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 ...
5
votes
2answers
466 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....
0
votes
2answers
253 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 ...
7
votes
4answers
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
196 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 ...
17
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
632 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-...
5
votes
4answers
672 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
301 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 ...
2
votes
5answers
421 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
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-...
5
votes
2answers
712 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
658 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
581 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 ...
28
votes
10answers
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 ...
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
152 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
653 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 ...
11
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
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 ...
15
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
231 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
898 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 ...