Pascal Apple Pascal 1.3 Compiler Error

Relating to Pascal programming.

Eric's Edge

Tinkerer
Oct 31, 2021
122
87
28
I'm attempting to work with Apple Pascal 1.3 on my Apple IIe. Aside from the Pascal OS being strange, and the lack of assessable books and tutorials, I'm running into a compiler error on a very simple Hello World type program. I wonder if anyone can recognize the, probably obvious, error in the code.

The {$S+} is a compiler directive to allow swapping. Without it the compiler runs out of space. Very curious.
Screen shots included.
 

Attachments

  • Compiler Error for Hello World - source code.PNG
    Compiler Error for Hello World - source code.PNG
    1.7 KB · Views: 81
  • Compiler Error for Hello World.PNG
    Compiler Error for Hello World.PNG
    1.9 KB · Views: 83

VicNor

Tinkerer
Apr 13, 2022
41
25
18
Sweden
Pascal is amazing! Unfortunately I've only experienced Borland's Turbo Pascal on CP/M and DOS systems.

That said... The code looks fine, but I would like to see a semicolon after the WriteLn statement - but I recall that ISO dialects of Pascal is OK to skip it before an End.

Are there maybe some compiler options in a menu for memory management that has been switched by accident?

Maybe the compiler directives differ from dialect to dialect, but isn't {S+} for stack checking?
 

Eric's Edge

Tinkerer
Oct 31, 2021
122
87
28
Pascal is amazing! Unfortunately I've only experienced Borland's Turbo Pascal on CP/M and DOS systems.

That said... The code looks fine, but I would like to see a semicolon after the WriteLn statement - but I recall that ISO dialects of Pascal is OK to skip it before an End.

Are there maybe some compiler options in a menu for memory management that has been switched by accident?

Maybe the compiler directives differ from dialect to dialect, but isn't {S+} for stack checking?
I did try the WRITELN statement with a ";" at the end with the same result.
The only compiler options available are the directives you add to the code. It's all very privative - which is why I love/hate this stuff. :cool:

From the Apple II Pascal 1.3 Workbook
Handling Stack Overflow If a compilation is too large for the system's memory, there are several things you can try. See the section "Compiling Large Programs" in Chapter 15 of Part III for detailed information. You are more likely to have stack overflow with the 64K Pascal system. If you are using the 64K Pascal system, you can o Put the {$S+} or {$S++} "swapping" Compiler option into your program; o Use the Swap command from the Command level of the Pascal operating system.
 

Eric's Edge

Tinkerer
Oct 31, 2021
122
87
28
I tried out Pascal 1.1 and the code worked fine. Also, I contacted the person who created this video and he offered to send my his copy of his disks.
 
  • Like
Reactions: VicNor

dCubed

New Tinkerer
Nov 20, 2024
3
1
3
Hello, Eric. It looks like I am a couple years late in finding your question, but I may have some information (if not a solution) in the event that you're still interested.

First of all, your program is correct, as best I can tell, and it runs fine in Apple Pascal v1.3 on my Apple IIc (with or without the swapping directive). According to the Apple Pascal Language Reference Manual, the error 58 you are getting is "Error in factor (bad expression)" for whatever that is worth.

I don't have an Apple IIe, but if I run the same program in the linapple emulator, then I also have to turn swapping on to compile the program, and it also fails. When swapping is on, it errors on the END statement as well, but with an error 20 ('.' expected) even though the program does end with a period. If I turn on super-swapping with {$S++}, then I get error 168 (Undefined label) on the same line.

The truth is that I have had problems with v1.3 on the linapple emulator in my own experience with small and relatively large Pascal programs. Until I saw the issue you were having, I thought that the problem was likely a bug in the emulator. Now, I am not so sure.

If you're up for trying again, I'd suggest you try Apple Pascal v1.2 on your machine. I have had much better luck with this version on linapple. For my own code, I test as I go on v1.2 on linapple, and then when I am happy with the program, I transfer it to a floppy and compile it on v1.3 on my IIc.

Best of luck,
den
 

dCubed

New Tinkerer
Nov 20, 2024
3
1
3
I tried out Pascal 1.1 and the code worked fine. Also, I contacted the person who created this video and he offered to send my his copy of his disks.
Also, I notice in this video that he is set up for 128KB, the same as what a IIc has. A stock IIe comes with 64KB, if I'm not mistaken. Apple Pascal v1.3 is supposed to support 64KB. It's actually the default, and you have to swap a couple of files if you want the 128KB Pascal environment. Still, that might be what's making the difference.
a2_pascal_128KB.png

Eric, how much memory does your IIe have?
 
Last edited:

Eric's Edge

Tinkerer
Oct 31, 2021
122
87
28
Hey! Never too late for a response. I’d still like to work on this. At this point, I may have to type it in again. Either way, I’m expecting an Apple IIc soon so I may give it a go there. I don’t recall how much RAM is installed. I haven’t messed around with it in a year or more.
 

dCubed

New Tinkerer
Nov 20, 2024
3
1
3
I'll be interested to see how you fare. Your original post mentioned a "lack of accessible books and tutorials." A lot of books are available in PDF format online, including the Language Reference Manual I mentioned above. If you prefer real books, like I do, you can usually find them pretty cheap on eBay. People are paying high prices these days for old computers, but not always so much the books for those computers. If you're patient, you can usually find something for $10-15.

Also, if you're interested, I'm slowing going through the book Apple Pascal Games (which, incidentally, I got on eBay). I've got a GitHub repo where I'm putting the author's original programs as well as my own versions with a few enhancements. I'm just finishing up Chapter 2 at present, but by the time you've gotten back into Apple Pascal, there should be a bit more.
apple_pascal_games.jpg
 
  • Like
Reactions: Eric's Edge