Syntax Err GET on an Apple II, AppleDOS 3.3 using Applesoft

229 views Asked by At

I am using the AppleWin emulator, setup as an Apple IIe, Apple DOS 3.3 with Applesoft. My goal is to make a simple game.

This simple GET program works fine at the ] prompt (I am not sure, but I think it's called the monitor).

10 GET V$
20 PRINT V$

It prints the pressed key as expected

Then I start Applesoft using LOAD APPLESOFT. I tried writing the same simple program than at the ] prompt. But this time when I type the first line 10 GET V$ I get as output *** SYNTAX ERR.

I think it's not a supported feature, but in the ApplesoftII Basic Programming Reference Manual they list get a reserved keyword.

I could update to a higher version of Applesoft, then which version of Applebasic would support it? I can also use another method of getting a key press without the user needing to press enter afterwards.

3

There are 3 answers

0
Tomas Daniel On BEST ANSWER

After continuing to research my issue, I have found the location of memory for the keyboard buffer.

The keyboard buffer is -16384 and the way to reset that value of that address is to access -16368.

If the value in -16384 is larger than 128 then a key has been pressed. So, I can use PEEK -16384 to read the value. To get an ASCII code you need to subtract 128 to that value. Example code:

KEY= PEEK(-16384)
IF KEY>=128 THEN PRINT KEY-128

To tell the system you dealt with the key press and reset the value, you need to access the value in -16368. By using PEEK or POKE. Example code:

POKE -16368,0

Or can also be PEEKed
PRINT PEEK -16368
1
Chris Dodd On

Applesoft on the Apple ][e (the first apple version to support lower-case at all) is case sensitive, and all the keywords are UPPERCASE only -- so get will not match the keyword (or anything) and will give you a syntax error.

Of course, if you're emulating an original Apple ][, there's no lower case at all, and lower case letters show up as flashing uppercase -- and still won't match a keyword.

0
julodnik On

if the error you are getting is *** SYNTAX ERR and not "?SYNTAX ERROR" then you are using integer basic and not applesoft basic. Try to switch to applesoft basic first by using FP