Skip to main content
54 votes
Accepted

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

The difference between Applesoft BASIC and the other Microsoft 6502 BASIC derivatives can be explained by the fact that Applesoft BASIC was not the first BASIC for the Apple II; the first was Apple II ...
TeaRex's user avatar
  • 1,255
39 votes
Accepted

Does AppleSoft BASIC really parse "LE THEN" as "LET HEN"?

The AppleSoft BASIC parser ignored white space for anything that was outside of double quotes ("). As well, there were only a few revisions of the Apple II ROMs that affected the BASIC parser, ...
bjb's user avatar
  • 19.1k
31 votes

What does this line: `T=C/2=INT(C/2)` do? Why is it valid syntax?

Explaining what this line does is easy enough: it checks if C is even by dividing it by 2 and comparing the result to its floor, then stores the result of the comparison in the variable T. Comparisons ...
user3840170's user avatar
  • 27.3k
25 votes
Accepted

How are the randomizer values on the Apple II maintained?

It's incremented while waiting for keyboard input. The 16-bit random seed (RNDL and RNDH) is updated by the KEYIN routine as it spins while waiting for a key press. KEYIN is used by the Monitor ROM's ...
Darren's user avatar
  • 1,123
23 votes
Accepted

How did the Apple IIe convert to upper case?

This is actually done as part of the Applesoft tokenizer. Basically when you type a line of code into the Applesoft interpreter, the very first thing that happens is that the line is tokenized -- it ...
Chris Dodd's user avatar
20 votes
Accepted

Why does Applesoft BASIC get confused by a nonzero value at $0800?

The Applesoft RUN command ($d912) begins by calling SETPTRS ($d665), which calls STXTPT ($d697) to initialize TXTPTR ($b8-b9) to the value in TXTTAB ($67-68) minus one. In simple terms, parsing of ...
fadden's user avatar
  • 10k
18 votes
Accepted

What are the rules for Applesoft BASIC formatting for code?

This is an AppleSoft issue where it puts spaces either side of a token. PET/CBM BASIC (based off the same code base) doesn't do this. Tokenising ignores spaces, this means it can be difficult on the ...
PeterI's user avatar
  • 5,377
18 votes

Can you read the character definitions (font) in an Apple II using PEEK in Applesoft BASIC?

No, it's not possible to read the built-in text mode font data from "inside" the machine. (Update: Except perhaps in the Apple IIgs - see below.) In all Apple II models the font data is in a ...
Nick Westgate's user avatar
16 votes
Accepted

Looking for an accurate Apple II(e) character set - in particular, what is CHR$(133)?

The game was originally written for the TRS-80 and ported to the Apple II. In an online TRS-80 emulator PRINT CHR$(133) is a partial vertical line. The TRS-80 character set has other options for &...
Nick Westgate's user avatar
14 votes
Accepted

Extensions to Apple BASIC with ampersands

After a bit of research, it turns out it was Applesoft. The interpreter had a feature where, if it encountered an ampersand during execution of the program, it would unconditionally jump to a ...
paxdiablo's user avatar
  • 5,257
14 votes

Apple IIe SYNTAX ERROR

If an Apple II boots without DOS, then the prompt you get only understands built-in Applesoft commands such as PRINT and LIST. Without DOS, the disk commands such as CATALOG will not be available (and ...
Greg Hewgill's user avatar
  • 7,119
14 votes
Accepted

Help understanding TAIPAN source code for the Apple II

You don't need to follow the listing far to see the problem. Line 10 ends with GOTO 10000, and 10000 starts with CALL 6147, which is $1803, smack in the middle of the Applesoft source code, which ...
Nick Westgate's user avatar
14 votes

Merge two (saved) Apple II BASIC programs in memory

The Applesoft Toolkit provided a number of extensions to Applesoft Basic via the ampersand hook. The renumbering function was probably the most frequently used, but it also provided "hold" ...
dirkt's user avatar
  • 34.3k
14 votes

Can you remove a variable in the 8-bit Microsoft BASICs?

So the question is, does a variable which no longer has a value still have any footprint in RAM, Yes, the table entry for a variable persist for the whole runtime of a program. Those tables are only ...
Raffzahn's user avatar
  • 249k
13 votes
Accepted

Why does the Applesoft BASIC have shapes?

Why did Apple include shapes in Applesoft BASIC? Because they were introduced with the 'Programmers Aid #1 ROM' for Integer BASIC, so it was rather natural for Applesoft to support it as well. ...
Raffzahn's user avatar
  • 249k
13 votes
Accepted

Are there standalone emulators of Applesoft Basic?

Yes, there are at least a couple: LinApple - for Linux/Raspberry Pi. This fork of LinApple is current and maintained, and fixes annoying configuration bugs that others hadn't addressed. AppleWin — for ...
scruss's user avatar
  • 22.6k
12 votes
Accepted

Where can I find the Applesoft line-drawing algorithm?

You can find the hi-res drawing code in an Applesoft disassembly. HPLOT starts at $F6FE. The ROM code is optimized for size, and parts are tricky to sort out. If you want something a bit more ...
fadden's user avatar
  • 10k
12 votes

What are the rules for Applesoft BASIC formatting for code?

Here is a program I wrote several years ago in AppleSoft for the fun of it. What it simply does is disassemble itself from the tokenized storage into a listing. If you run it, it will look the same as ...
bjb's user avatar
  • 19.1k
12 votes

What does this line: `T=C/2=INT(C/2)` do? Why is it valid syntax?

The line in question is T=C/2=INT(C/2) The first '=' is a variable assignment. The second '=' is part of the expression and is an equality test. The expression returns a boolean result, which is ...
TonyM's user avatar
  • 5,313
11 votes

How to use HGR2 (or HGR) on an Apple II

Problem Here is a picture (to scale) of how memory is being used in units of "pages" (256 bytes) on the Apple 2. 000000001111111111111111 2222222222222222 3 ... ... 9 ...
Michaelangel007's user avatar
11 votes

Applesoft (pseudo) Random Numbers - alternatives?

I found an example that plotted on the hi-res screen to evaluate a replacement RNG. The code is based on a Call-A.P.P.L.E. article from 1989, available here. It appears to be a linear congruential ...
fadden's user avatar
  • 10k
11 votes

How did the Apple IIe convert to upper case?

This post has a brief history of Applesoft. You'll note it was modified in 1984 to allow entry of lower-case keywords. If you look at the PARSE routine (at $d56c) in the ][+ version of Applesoft in ...
fadden's user avatar
  • 10k
10 votes
Accepted

Turn off Apple IIe sound

In this case, to "toggle" the speaker means to move it from one position to the other. To make a sound, you repeatedly toggle the speaker (by poking that address) at a particular speed to make a sound ...
Greg Hewgill's user avatar
  • 7,119
10 votes

How can I run a machine language program off the disk drive on an Apple II?

In Apple DOS simply BRUN nameoffile if it is an executable binary (type B in CATALOG) it will load and call the machine language at the address that was used to save the binary. If it is just a blob ...
Patrick Schlüter's user avatar
9 votes

Extensions to Apple BASIC with ampersands

While paxdiablo answered the question confirming that it was AppleSoft, I can point out three things related to it as an extension: When you load your extension, it should attempt to relocate itself ...
bjb's user avatar
  • 19.1k
9 votes

How did the Apple IIe convert to upper case?

[Oioioi, this is one of the darkest corner of the II line :))] How did the Apple IIe convert to upper case? The Apple IIe did not convert at all. That's why the IIe Programmers Reference mentions: .....
Raffzahn's user avatar
  • 249k
8 votes

In Applesoft BASIC, does combining statements into a single line speed up execution?

Yes. Replacing NEXT I with NEXT will also help. One way to evaluate this is to throw a speaker click (PEEK -16336) into the loop and listen. The faster the loop, the higher the pitch. (Then try it ...
fadden's user avatar
  • 10k
8 votes

Merge two (saved) Apple II BASIC programs in memory

There is no built-in facility for merging BASIC programs. They're stored in tokenized form and can't simply be stuffed together. @scruss identified a simple approach in a comment: save one of the ...
fadden's user avatar
  • 10k
8 votes

Does AppleSoft BASIC really parse "LE THEN" as "LET HEN"?

This is not specific to AppleSoft BASIC. Whitespace was generally not significant when recognizing keywords in the original Dartmouth BASIC, either. This allows you to write something like LETA=100 ...
Barmar's user avatar
  • 2,691
8 votes

Does AppleSoft BASIC really parse "LE THEN" as "LET HEN"?

Possible explanation I think I have found a possible reason why the code was submitted with such a dubious variable name, without the issue being caught. The information section under the video, What ...
Greenonline's user avatar
  • 5,001

Only top scored, non community-wiki answers of a minimum length are eligible