Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.apple2.programmer > #6288 > unrolled thread
| Started by | Bill Chatfield <bill_chatfield@yahoo.com> |
|---|---|
| First post | 2023-12-26 11:49 -0500 |
| Last post | 2024-01-01 13:07 -0800 |
| Articles | 8 — 4 participants |
Back to article view | Back to comp.sys.apple2.programmer
Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha Bill Chatfield <bill_chatfield@yahoo.com> - 2023-12-26 11:49 -0500
Re: Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha Brian Patrie <bpatrie@bellsouth.spamisicky.net> - 2023-12-27 05:35 -0600
Re: Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha Bill Chatfield <bill_chatfield@yahoo.com> - 2023-12-27 11:24 -0500
Re: Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha I am Rob <gids.rs@sasktel.net> - 2023-12-30 11:15 -0800
Re: Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha Bill Chatfield <bill_chatfield@yahoo.com> - 2023-12-31 11:37 -0500
Re: Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha I am Rob <gids.rs@sasktel.net> - 2023-12-31 13:17 -0800
Re: Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha fadden <fadden@fadden.com> - 2024-01-01 07:42 -0800
Re: Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha I am Rob <gids.rs@sasktel.net> - 2024-01-01 13:07 -0800
| From | Bill Chatfield <bill_chatfield@yahoo.com> |
|---|---|
| Date | 2023-12-26 11:49 -0500 |
| Subject | Compiler Brain Dump - Your Chance to Tell Me How Wrong I am - Haha |
| Message-ID | <20231226114951.65d00993@smilodon-gracilis> |
I found ZBASIC. I've been looking at different structured BASICs and compilers. ZBASIC seems pretty awesome. It can even do DHGR. Does anyone have any experience or comments about it? It builds BIN programs. I've eliminated other BASIC compilers because they don't have "structured" statements like WHILE/WEND, REPEAT/UNTIL, IF/ELSE/ENDIF, optional line numbers & Functions with parameters. If you don't have those, you're still just writing a bunch of GOTOs that are very hard to read. I love ApppleSoft BASIC, but for large programs, it gets pretty hard to manage. My main problem with Kyan Pascal is that the programs have to run in it's special environment. You can also build a .SYSTEM file but it also needs the runtime library to work. It's not really building a stand-alone executable (BIN) file. That annoys me. And it takes a LONG.... time to load that runtime library, for every program you want to run. This kind of eliminates it for small programs. And it exits BASIC.SYSTEM when it's done. I know cc65 is the ultimate, but you're not actually using the Apple II when you develop the program. It's more efficient that way. But, the goal of retro is to use the retro computer. I do use cc65 and I love it, but it would be nice to also have an Apple II hosted development system. I know Aztec C exists. But I haven't tried it. I love C but I find that other people have a harder time reading the code because it is cryptic. If you've done AppleSoft BASIC, something like ZBASIC is going to be easier for you to read than C code. Pascal is easier to read than C, unless you have a lot of experience with C or Java/C++/C#/etc. For example, a young person learning to program who learns AppleSoft BASIC could transition to ZBASIC and build compiled BIN programs every easily. Kyan Pascal would be better, but it has the runtime library that takes forever to load. I can write Assembly "Language" but it is so slow to write simple things. And most people can't even read it. I want other people to be able to read and understand my code. I feel like it is a means of communicating how to accomplish tasks and how the machine works.
[toc] | [next] | [standalone]
| From | Brian Patrie <bpatrie@bellsouth.spamisicky.net> |
|---|---|
| Date | 2023-12-27 05:35 -0600 |
| Message-ID | <umh26n$3td7g$1@dont-email.me> |
| In reply to | #6288 |
Bill Chatfield wrote: > And it exits BASIC.SYSTEM when it's done. It's more apropos to say that a SYS program exits BASIC.system at launch. A ProDOS Quit call (or a reboot) is the only kosher way to exit a SYS app--especially since a large program is likely to step on BASIC.system in memory. BIN files are great for little things that are going to be called from AppleSoft; but for a major project SYS makes more sense (at least to me).
[toc] | [prev] | [next] | [standalone]
| From | Bill Chatfield <bill_chatfield@yahoo.com> |
|---|---|
| Date | 2023-12-27 11:24 -0500 |
| Message-ID | <20231227112447.5c6c6c12@smilodon-gracilis> |
| In reply to | #6292 |
On Wed, 27 Dec 2023 05:35:50 -0600 Brian Patrie <bpatrie@bellsouth.spamisicky.net> wrote: > Bill Chatfield wrote: > > And it exits BASIC.SYSTEM when it's done. > > It's more apropos to say that a SYS program exits BASIC.system at > launch. A ProDOS Quit call (or a reboot) is the only kosher way to > exit a SYS app--especially since a large program is likely to step on > BASIC.system in memory. > > BIN files are great for little things that are going to be called > from AppleSoft; but for a major project SYS makes more sense (at > least to me). Yeah, that makes sense. It is more correct to say it that way. Most of the time I want to write little things for functionality that is missing in the AppleSoft "shell". I can never get through a major project before I lose interest. Ha ha.
[toc] | [prev] | [next] | [standalone]
| From | I am Rob <gids.rs@sasktel.net> |
|---|---|
| Date | 2023-12-30 11:15 -0800 |
| Message-ID | <6563cfc4-a4d3-43ab-b468-ee9d98dc3f4fn@googlegroups.com> |
| In reply to | #6288 |
> I found ZBASIC. I've been looking at different structured BASICs and > compilers. ZBASIC seems pretty awesome. It can even do DHGR. Does > anyone have any experience or comments about it? It builds BIN > programs. > > I've eliminated other BASIC compilers because they don't have > "structured" statements like WHILE/WEND, REPEAT/UNTIL, > IF/ELSE/ENDIF, optional line numbers & Functions with parameters. > If you don't have those, you're still just writing a bunch of GOTOs that > are very hard to read. I love ApppleSoft BASIC, but for large programs, > it gets pretty hard to manage. > I can write Assembly "Language" but it is so slow to write simple > things. And most people can't even read it. > I want other people to be able to read and understand my code. I feel > like it is a means of communicating how to accomplish tasks and how the > machine works. There are add-ons for Applesoft Basic. There is an IF/ELSE/THEN and REPEAT/UNTIL add-on. The REPEAT/UNTIL is actually quite a bit faster than a FOR/NEXT loop. For the most part, most people just don't know how to program Applesoft Basic efficiently. If you are using too many GOTO's in your programs, then should consider using more ON/GOTO's or better yet ON/GOSUB. instead of: 10 GET CHOICE 15 IF CHOICE=1 THEN GOT0 xxyy 20 IF CHOICE=2 THEN GOTO yyxx you would use 10 GET CHOICE 15 ON CHOICE GOSUB 100,200,300 20 GOTO 10 100 DOTHIS : RETURN 200 DOTHAT : RETURN 300 DOMORE : RETURN There is even an add-on that reduces line #15 to 15 GOSUB 100*CHOICE Another add-on allows for GOTO/GOSUB "label" to identify your subroutines. As for Machine Language, once you start collecting or creating sub-routines, it becomes very efficient down the road as the subroutines can then be imported into larger programs. You will see a lot of source code that has INCLUDE "subroutine". But higher languages are difficult to program to use imported sub-routines.
[toc] | [prev] | [next] | [standalone]
| From | Bill Chatfield <bill_chatfield@yahoo.com> |
|---|---|
| Date | 2023-12-31 11:37 -0500 |
| Message-ID | <20231231113749.59aed3d3@smilodon-gracilis> |
| In reply to | #6295 |
On Sat, 30 Dec 2023 11:15:01 -0800 (PST) I am Rob <gids.rs@sasktel.net> wrote: > 10 GET CHOICE > 15 ON CHOICE GOSUB 100,200,300 > 20 GOTO 10 > > 100 DOTHIS : RETURN > 200 DOTHAT : RETURN > 300 DOMORE : RETURN I like this. But it limits you to menus like this: 1. New 2. Open 3. Save Instead of N)ew O)pen S)ave Because ON/GOSUB only takes an integer for "CHOICE". But I suppose that is not terrible.
[toc] | [prev] | [next] | [standalone]
| From | I am Rob <gids.rs@sasktel.net> |
|---|---|
| Date | 2023-12-31 13:17 -0800 |
| Message-ID | <868c8f68-3860-4ed8-9619-c894c6133b85n@googlegroups.com> |
| In reply to | #6296 |
> > 10 GET CHOICE > > 15 ON CHOICE GOSUB 100,200,300 > > 20 GOTO 10 > > > > 100 DOTHIS : RETURN > > 200 DOTHAT : RETURN > > 300 DOMORE : RETURN > I like this. But it limits you to menus like this: > > 1. New > 2. Open > 3. Save > > Instead of > > N)ew > O)pen > S)ave Applesoft is a very capable language, albeit somewhat slow, and it can do that as well. Just do a simple string comparison. Here's a simple little input string to help you on your way. 10 CMD$="NOS"+CHR$(27) 15 ?"Command: N)ew O)pen S)ave <ESC> exits: "; 20 GET CHOICE$: FOR X=1 TO LEN (CMD$): IF CHOICE$ = MID$(CMD$,X,1) THEN ON X GOSUB 100,200,300,400: X=0 30 NEXT : END 100 ? "N was pressed": RETURN 200 ? "O was pressed": RETURN 300 ? "S was pressed": RETURN 400 POP : TEXT : END Once you get into Machine Language programming you can significantly speed up lines 20 & 30 with & GET CHOICE$,CMD$,X : ON X GOSUB ... Just be aware that Applesoft only recognizes the first 2 characters of a variable. Meaning CHOICE$ = CH$, or any word that starts with CH and that is a string variable. CHANCE$=CHOICE$=CHARACTER$=CHEAP$, but CHR$ is a reserved token and cannot be used as a variable. Get to know the Tokens that Applesoft uses so you don't accidently try to use them as variables. One of the better Applesoft Technical manuals I have actually seen is the Laser 128 Technical Reference Manual and explains every Applesoft Token in detail. It is on Asimov. https://mirrors.apple2.org.za/ftp.apple.asimov.net/documentation/hardware/machines/Laser%20128%20Series%20Technical%20Reference%20Manual.pdf
[toc] | [prev] | [next] | [standalone]
| From | fadden <fadden@fadden.com> |
|---|---|
| Date | 2024-01-01 07:42 -0800 |
| Message-ID | <umumgs$28gv5$1@dont-email.me> |
| In reply to | #6298 |
On 12/31/2023 1:17 PM, I am Rob wrote: > One of the better Applesoft Technical manuals I have actually seen is the Laser 128 Technical Reference Manual and explains every Applesoft Token in detail. It is on Asimov. > > https://mirrors.apple2.org.za/ftp.apple.asimov.net/documentation/hardware/machines/Laser%20128%20Series%20Technical%20Reference%20Manual.pdf I think you meant the User's Guide and BASIC Manual: https://mirrors.apple2.org.za/ftp.apple.asimov.net/documentation/hardware/machines/Laser%20128%20User%27s%20Guide%20%26%20Basic%20Manual.pdf
[toc] | [prev] | [next] | [standalone]
| From | I am Rob <gids.rs@sasktel.net> |
|---|---|
| Date | 2024-01-01 13:07 -0800 |
| Message-ID | <583d3e3e-fa1f-40ca-bf35-9d6b09f78ab2n@googlegroups.com> |
| In reply to | #6299 |
> > One of the better Applesoft Technical manuals I have actually seen is the Laser 128 Technical Reference Manual and explains every Applesoft Token in detail. It is on Asimov. > > > > https://mirrors.apple2.org.za/ftp.apple.asimov.net/documentation/hardware/machines/Laser%20128%20Series%20Technical%20Reference%20Manual.pdf > I think you meant the User's Guide and BASIC Manual: > > > https://mirrors.apple2.org.za/ftp.apple.asimov.net/documentation/hardware/machines/Laser%20128%20User%27s%20Guide%20%26%20Basic%20Manual.pdf Thanks. I was in a bit of a rush and didn't have time to verify which Manual.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.sys.apple2.programmer
csiph-web