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
7 votes
2 answers
713 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 ...
Geo...'s user avatar
  • 9,313
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 ...
Maury Markowitz's user avatar
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 ...
Mayor of the Plattenbaus's user avatar
5 votes
1 answer
643 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), ...
dcruze's user avatar
  • 53
5 votes
2 answers
383 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 ...
Gavin Williams's user avatar
3 votes
0 answers
193 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 ...
Tronman's user avatar
  • 139
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,131
3 votes
2 answers
316 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" ...
Maury Markowitz's user avatar
13 votes
2 answers
698 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 ...
Psychonaut's user avatar
  • 7,013
2 votes
2 answers
580 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 ...
philipp_b's user avatar
15 votes
1 answer
283 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 ...
Maury Markowitz's user avatar
4 votes
2 answers
264 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 ...
hippietrail's user avatar
  • 6,323
14 votes
1 answer
875 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 ...
hippietrail's user avatar
  • 6,323
9 votes
3 answers
692 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 ...
Nimloth's user avatar
  • 2,038
3 votes
1 answer
281 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 ...
hippietrail's user avatar
  • 6,323
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 ...
scruss's user avatar
  • 20k
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 ...
Mark Reed's user avatar
  • 391
8 votes
1 answer
558 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 ...
wperko's user avatar
  • 141
5 votes
2 answers
636 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 ...
Maury Markowitz's user avatar
2 votes
1 answer
106 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 ...
jonk's user avatar
  • 170
2 votes
3 answers
255 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 ...
jonk's user avatar
  • 170
9 votes
1 answer
271 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 ...
Maury Markowitz's user avatar
12 votes
1 answer
516 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 ...
Maury Markowitz's user avatar
29 votes
2 answers
4k 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
11 votes
1 answer
488 views

Any way to simulate HP TS BASIC as seen on the 2000?

An interesting question has come up about how HP Time-Share BASIC handles this code: 10 PRINT "HOW MANY STARS DO YOU WANT"; 20 INPUT N 30 FOR J = 1 TO N 40 PRINT "* "; 50 NEXT J 60 ...
Maury Markowitz's user avatar
16 votes
3 answers
2k views

Is there any significant difference in Sinclair BASIC of ZX80, ZX81 and ZX Spectrum?

I'm trying to write some programs from an old magazine that were specified to run on an ZX80/ZX81 but I'm using a Sinclair BASIC interpreter for the Spectrum. Is there any significant changes in BASIC ...
d'Arby's user avatar
  • 161
32 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 ...
Psychonaut's user avatar
  • 7,013
3 votes
1 answer
205 views

MECC basic standards document?

As I understand the history, much of the original Minnesota Educational Computing Consortium (MECC) catalog was written on their own timeshare platforms, which appear to be mostly the GE (and thus ...
Maury Markowitz's user avatar
16 votes
2 answers
3k views

Can someone make a photograph of the original Apple 1 Integer BASIC cassette?

I'm wondering if anyone here has an original Integer BASIC cassette and might be willing to upload an image of it to the wiki commons? There's a serious lack of imagery in the article in en.wiki, and ...
Maury Markowitz's user avatar
9 votes
1 answer
617 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 ...
Maury Markowitz's user avatar
5 votes
0 answers
156 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 ...
Maury Markowitz's user avatar
12 votes
1 answer
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,...
Maury Markowitz's user avatar
15 votes
2 answers
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 ...
Kingsley's user avatar
  • 353
4 votes
1 answer
466 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 ...
user avatar
26 votes
7 answers
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 ...
Willis Blackburn's user avatar
10 votes
2 answers
918 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 ...
Maury Markowitz's user avatar
9 votes
2 answers
1k 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 ...
K. Gero's user avatar
  • 93
18 votes
10 answers
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 ...
natevw's user avatar
  • 2,867
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
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 ...
forest's user avatar
  • 1,959
18 votes
3 answers
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 / ...
Grant's user avatar
  • 189
4 votes
2 answers
303 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:...
Charles's user avatar
  • 381
24 votes
6 answers
5k 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(...
phuclv's user avatar
  • 3,522
24 votes
1 answer
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 ...
Psychonaut's user avatar
  • 7,013
2 votes
2 answers
257 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?
Pierre's user avatar
  • 23
16 votes
3 answers
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 ...
Brian Knoblauch's user avatar
36 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....
user3840170's user avatar
7 votes
1 answer
705 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 ...
Azathoth's user avatar
  • 125
42 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.7k
9 votes
4 answers
1k 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 ...
JvH's user avatar
  • 93