AppleLink APPLE II DEVELOPMENT FORUM CONFERENCE LOG September 12, 1989 10:00 pm Eastern Time Topic: BASIC Programming Forum Leader: Gary Jacobson (AFA Gary J) AFA Gary J Welcome to the Apple II Development Forum. AFA Gary J Tonight's topic is BASIC programming. We'll be using Forum protocol starting AFA Gary J NOW, so if you have a question, type a "?" on a line by itself, or if you have AFA Gary J a comment on the current topic, type a "!" on a line by itself. AFA Gary J So, does anyone have any questions to start the night out with? AFA Gary J (We can get off the topic if there are no other questions, but lets let the AFA Gary J people with BASIC programming questions take precidence) AFA Gary J Ok, Danny, you're up first. GA AFA DannyH with all the other compiled languages, do you feel Basic has a future? AFA Gary J GA, Coach. Coach101 I think BASIC.SYSTEM is bad since it is 8-bit and denies a lot of Coach101 things to the user. But GS-Basic or some other 16-bit Basic probably Coach101 has a futuer as a K-12 introdunction to programming language. GA AFA Gary J Do you have something you want to add, Cornman? GA Cornman GS True, but BASIC.SYSTEM is also made for older 8-bit machines. If Cornman GS Apple were to totally "drop" (they never will, I think) the old 8 Cornman GS bitters, then I think they should develop a IIGS.BASIC.SYSTEM. GA AFA DannyH wouldn't it be better to teach Pascal rather than Basic? Basic is kind of AFA DannyH contorted to say nothing of limited Coach101 There is an Apple GSBasic. It is just not a supported product and has not AFA Gary J Q = Danny (Coach), JDavies, Richard LT Coach101 been updated since the days of ProDos-16. I would just like to see Cornman GS You mean GS/OS Coach101 people learn the GS on a language that is appropriate to the power of Coach101 the GS. GSBasic is more powerful than BASIC.SYSTEM. ga AFA Gary J I think that BASIC won't die out for a while, at least, simply because AFA Gary J there are still MANY machines that are shipped with BASIC with them (IBM's, AFA DannyH what about Pacal instead of Basic? everyone I tallk to says get out of Basic AFA DannyH and get into Pascal AFA Gary J and IBM clones, even, as well as AppleSoft BASIC right in ROM on Apple II's) Coach101 awk Cornman GS No! Get into Assembly! Cornman GS hehehe AFA Gary J GA, Marty AFL Marty The recommendation of Pascal is probably because Pascal is a more AFL Marty structured language than traditional BASIC. There are versions of BASIC AFL Marty however that come very close to this same kind of structure. ZBasic and AFL Marty Micol Advanced BASIC (both 8 and 16 bit versions) are very structured AFL Marty in comparison to AppleSoft. AFL Marty done AFA Gary J GA, Cornman Cornman GS One thing I would like to point out, even though this is not on the Cornman GS subject, it's about how Programmers and Developers choose to use Cornman GS high order language instead of Assembly which would GREATLY Cornman GS increase speed & efficincy (I can't spell!). For example, Cornman GS If you have Rocket Ranger, type Control-Reset when it's loaded Cornman GS and you'll see the Pascal. You'll also notice Rocket Ranger Cornman GS is SLOW in animation. GA AFA Gary J GA Doctor Doctor Why Basic will always be around because it is...basic. It allows people who are not Doctor Why interested in programming write simple programs. For those people who have Cornman GS Hiya A2GS Doctor Why an interest in programming, then languages like Pascal become attractive. Doctor Why GA AFA Gary J GA, Marty AFL Marty The implication in Cornman's statement is that the code produced by AFL Marty a compiled BASIC is inherently slow and inefficient. This is not necessarily A2GS Hi Cornman GS! AFL Marty the case. AFL Marty I know that ZBasic, for instance, is capable of producing very fast AFL Marty code that is suitable for the production of commercial software. As a matter AFL Marty of fact, RepairWorks was written entirely in ZBasic. AFL Marty done AFA Gary J GA with your rebuttle, Cornman :) Cornman GS Do ya remember Nucleus? That was written in Assembly by the Cornman GS french team. Anyway, there would be NO WAY that that could Cornman GS be written in anything other than assembly. I'm just saddened Cornman GS that a lot of programmers and publishers don't WANT to use Cornman GS assembly and rather use esier languages. Yea, high order Cornman GS languages are great but for those tasks that need high speed Cornman GS processing, you have to program in Assembly or it will be Cornman GS UNBEARIBLY slow. Unless apple gets out of the gutter and Cornman GS produces a faster IIgs. GA AFA Gary J GA, Marty AFA Gary J (Leave it to Danny to stir things up :) AFL Marty The point I was trying to make was that a compiled language isn't... Cornman GS hehehe AFL Marty necessarily slower or inefficient. As for the programmers, it has been AFL Marty my experience that most of them prefer programming in assembly AFL Marty language (a task which I loathe). AFL Marty done A2GS ! (I'll put in my 2 cents) AFA Gary J GA, JDavies A GibberFC (Retract my comment please) JDavies1 The high level languages get compiled to assembly anyways... It's just the JDavies1 translation is slopy.. the complier has its' ways of doing things..and JDavies1 you could surely write faster and more efficent code in assembly..if you have JDavies1 the time. JDavies1 but alot of people like to have it easy that's why the toolbox is big and JDavies1 languages like pascal and c are so popular..so why not write in a high level JDavies1 language and use assembly as a resource if it's too slow...ga AFA Gary J GA Coach Coach101 As a programmer, my job is to translate an algorithm into a sequence Coach101 of bytes that the machine can execute to accomplish the algorith. Coach101 A higher level leanguage lets me spend more time concentrating on the Coach101 algorithm and less time being concerned about the translattion. This Coach101 has the effect of DRAMATICALLY reducing the number of errors in the Coach101 resulting code, since the number of translation errors is reduced. As to Coach101 the speed situation, in 20+ years of programming I have learned that Coach101 most of the code (in terms of lines of code) has little bearing on the Coach101 actual speed of execution. Consequently, if the speed of a program Coach101 is not what it needs to be for the program's intended prupose, I will go Coach101 back and find the hot spots to convert them to assembler. A programmer Coach101 gets more alogorithm per hour coded in high level languages so, if I am Coach101 paid for algorithms coded, I get more money for using higher level Coach101 languages... done, and out of breath :) AFA Gary J :) GA, A2GS A2GS Basically JDavies took most of my words right out of my mouth... A2GS But I think we should look at this 2 ways...1 if the program is not in A2GS absolute need of speed (ex. text based programs (word processors)) then I A2GS don't have any real problem with having it written in a High level langauge A2GS AS LONG AS the program is reasonably useful at the resulting speed. A2GS 2 Personally, I think professionally written programs SHOULD be written in A2GS assembly language, we're going for quality! and if the public is supposed A2GS to use it make it useful, I believe we can see in some of the programs, a good A2GS example are some games, which are inexcusably slow, how can anyone enjoy them A2GS if you have to wait for the character to be redrawn on the screen before you A2GS can go on plaing the game, and then have to wait for the character to be A2GS drawn again! GA AFA DannyH But Coach, you speak of C and Pascal, how about Basic itself, does it have Cornman GS FINALLY! AFA DannyH merit or is it passe? Cornman GS (gasp!) AFA Gary J (I don't think anyone will argue the point that Arcade style games should AFA Gary J probably be written in assembly) AFA Gary J GA, Cornman A2GS (gulping AIR!) Cornman GS I totally agree with A2GS, just one comment Cornman GS Programs that use the Toolbox and windows and such SHOULD Cornman GS be written in C or Pascal (maybe Assemby but that's a Cornman GS little too hard). As for games, it should be law that games Cornman GS should be written in assembly. Most games do a fairly A2GS (I can't resist) Cornman GS good job at game speed, some are super (Zany Golf, Alien Mind Cornman GS Arkanoid, etc.) and a lot of WAY too slow (like Rocket A2GS ARRRGHHH! (the game) Cornman GS Ranger, Chestmaster 2100, etc.) Cornman GS GA Coach101 Nurse, bring two more bottles of oxygen :) AFA Gary J GA, Coach (then let's move on after A2GS's comment) Cornman GS :) coach Coach101 As to quality, many studies have shown that higher level languages Coach101 produce higher quality (less bugs, not more speed) programs. Parik, Coach101 The future of BASIC (where this whole thing started). I coached 9-11 Coach101 year olds in tackle footbal for 8 years. I think that we should start Coach101 teaching our children programming in primary school and I think BASIC Coach101 is the appropriate tool for that. I like it over PASCAL because it is Coach101 constrained enough to keep the inquisitive mind under control and Cornman GS (Real Short one) Cornman GS :) Coach101 channeled to the task at hand. ga AFA Gary J (Sure, Cornman :) GA, Scott Cornman GS Just going to say that I remember taking that language... AFL Scott As to speed. It is entirely possible to write very slow assembly code, too. Cornman GS What's that called? Oh yea! LOGO! Damn I hated that stupid Cornman GS language. What kind of useful purpose does that language AFL Scott Never mind. Someone doesn't know what protocol is. Cornman GS have for kids? Beyond me. AFL Scott GA AFA Gary J Ok, GA, Marty AFL Marty pass AFA DannyH done AFA Gary J It's up to you, A2GS :) Cornman GS :) A2GS Pass (let's drop the whole thing, I'm out of breath anyways) :) Cornman GS :) Cornman GS hehehe Cornman GS Hey! Cornman GS I got it! Cornman GS Let's rag on Sculley...hehehe :) AFA Gary J Ok... :) AFA Gary J JDavies has the next question. GA J. JDavies1 This one is real quick, Has anyone had trouble with athe toolbox tool Desktop? AFA Gary J GA, Dave. JDavies1 Mainly the set desktop color, under 5.0. I get an error when there are no Dave Lyons (Yes, *you* have. Right? :-) What's the trouble? (Which sub-function?) AFA Gary J (First time I had to say THAT tonight :) JDavies1 errors posiable. Dave Lyons What error do you get? JDavies1 I don't know, I don't check since there are no error possiable Cornman GS Welp Dave Lyons Well...*check*! You could be setting up the call wrong, and getting error Cornman GS Since this chat is comming to a halt, I'll be off... JDavies1 Unless that's not true under the new system AFL Marty PROTOCOL Dave Lyons $0001 or $0002 from the Tool Dispatcher. Cornman GS Goodbye all. Dave Lyons If you pass a bad region to Dave Lyons Desktop (on an operation that takes one), you might be able to get AFA Gary J (thanks, Marty :) Dave Lyons an error...don't have revised 5.0 docs here at home yet to check. ga JDavies1 Also did I do something wrong If it takes me 30 seconds longer to boot under AFL Marty (kids :) JDavies1 5.0 insted of 4.0. Dave Lyons Boot *what*? 3.5"? Hard disk? JDavies1 Dave could you let me know, I can't get the new docs (or so I think)..No 20SC JDavies1 hard drive AFA Gary J Do you have some information on this, A2GS? A2GS Not off the top of my head, but you should, if anything be booting FASTER then AFA DannyH goota run, bye all A2GS (slightly (at least)) 4.0! Did you put all the drivers in the folder or AFA Gary J Goodnight, Danny. Dave Lyons JD, I'll check whether Desktop returns any errors, if you A2GS something? Dave Lyons check to see what error you're getting. :) Which operation did you say Dave Lyons you were using? JDavies1 the set desktopp color. Dave Lyons Okay. ga A2GS The toolbox more or less always returns some kind of error when it can't A2GS perform a tool call, do you have an error checker (check if carry is SET) on A2GS returning from the tool call. JDavies1 The Drivers are as the the new versions of the same old tools..Installed with A2GS Did you use the Installer to install everything off the 2nd disk of GS/OS.. JDavies1 the installer..On the error when debugging I didn't notice a carry set, but I JDavies1 will check. A2GS because there really shouldn't be any reason why 5.0 is booting so slowly, A2GS did you format your HD with a 2:1 or 1:1 interleave? JDavies1 1 minute and 20 seconds not just to get the menu bar, not to get total control JDavies1 2:1 interleave I think. JDavies1 the default A2GS Don't know. Can't think of anything else right now. Sorry :( A2GS GA AFA Gary J Ok, did you have a question too, A2GS? AFA Gary J (GA, if you do) A2GS Yep... A2GS about the System Input and Output hooks, I disassembled a ROM routine A2GS $FC58 (HOME) and all I found in the end is that it set a couple of hooks A2GS but never actually went to a routine to clear the screen (one does exist) AFA Gary J GA, Dave A2GS are the hooks supposed to point to the routine in the end? What's up? (lost) Dave Lyons You "found" wrong...a lot of those old Monitor ROM routines go through Major Dave Lyons Acrobatics to get their job done, but they *do* get it done before they Dave Lyons return. Dave Lyons (Was there a question? I guess that answers it. ga) A2GS (could be I branched wrong while disassembling, but I don't think so) what are Dave Lyons (Be sure to start looking in bank $FF, by the way...if you look in bank 0, A2GS the hooks for then? Dave Lyons you'll see language card stuff.) Dave Lyons What "hooks"...speak in Hex. :-) A2GS I looked in $FF A2GS Input/output hooks used by the monitor (as briefly described in Bond's Inside A2GS the GS) Dave Lyons Zero page $36-$39, you mean? A2GS In certain cases that part of the Z-page is used. A2GS by certain ROM routines :) Dave Lyons As far as I know, HOME doesn't use those locations at all. I hypothesize you Dave Lyons took a wrong turn once you got into the "bottleneck" routine that a bunch A2GS never said they did :) Dave Lyons of Monitor ROM entries wind up going through. A2GS could be will check...and come back to haunt, if I come out with the same A2GS results :) GA Dave Lyons Are you trying to find out anything in Dave Lyons particular, or just browsing around? A2GS For the moment I browsing around, assembling ROM so as to get familiar with Dave Lyons (ga) A2GS it so I can eventually disassemble more complex stuff like the Floating AFA Gary J Z-page locations $22, $23, $24, and $25 are used in HOME A2GS point routines as well as the disk I/O routines. AFA Gary J GA, JDavies A2GS I believe that's true GARY (those seem to be the results I got) JDavies1 The locations spoken of are for the text window locations..but as far as the AFA Gary J Those are just the window top and window bottom storage addresses A2GS Don't have notes in front of me....I believe $29 was also used..possibly also JDavies1 ROM routines, IF you can find the book Bell &Howell Reference Manual it A2GS $27, $28. JDavies1 gives the entire commented II ROM listing. Dave Lyons Yes--those are the text window bounds, *not* the I/O hooks...although it would AFA Gary J $27, $28 is the BASE address for screen memory...used in Dave Lyons be easy to get misled by a table that didn't mark hex/decimal carefully: $36- AFA Gary J calculating the line to where the text will be "spaced out" Dave Lyons $39 are I/O hooks, which look like $24-$27 if you read them as decimal and Dave Lyons "convert" to hex! AFA Gary J :) JDavies1 What are hooks? Coach101 Pointed, barbed curved objects :) JDavies1 ah a fisherman AFA Gary J ...used mainly for fishing. Dave Lyons A hook in this context is a place to store an address--for example, the AFL Marty You catch fish with them. Dave Lyons "character output hook" at $36 and $37 is the address the 8-bit world calls Dave Lyons to print a single character to the screen. When you type PR#1 it gets Dave Lyons changed to point to your printer card, and when you type PR#0 it goes back Dave Lyons to pointing to a ROM routine to send the character to the screen. Dave Lyons (With DOS 3.3 or BASIC.SYSTEM, Real Life is more complicated than that, but Dave Lyons that's the idea of a hook.) JDavies1 so they are more like pointers? A2GS Very often used in the form JMP (0036) by the monitor (Absolute Indirect A2GS addressing) Dave Lyons A "hook" can be a pointer, as in this case. Sometimes places to put Dave Lyons JMP instructions are also called hooks. "Vector" means the same thing as Dave Lyons "hook" to me, although there's probably supposed to be a difference. (?) AFA Gary J A2GS, if you can get a hold of a copy of the //c or IIe Technical Reference JDavies1 gotcha AFA Gary J manuals, you'll find that the monitor ROM is listed and commented, and is Coach101 Hook ----> colloquial term for vector? AFA Gary J very interesting to study. JDavies1 gary didn't I jsut say that? A2GS does it cover the FP routines? AFA Gary J Sorry, I must have missed that :) JDavies1 It even gives addresses for the routines by name or address A2GS that's mainly what I'm looking for, would like to adapt them for 16-bit code Coach101 Why not use the SANE tools? A2GS GA A2GS PLEASE! AFA Gary J (You said Bell & Howell, that would be much harder to find nowdays :) A2GS I'm looking for speed, not for a coffee break :) A2GS the IN-SANE tools are not the answer. JDavies1 I'm sorry you'r right, Damn I was caught lying. AFA Gary J If you're looking for documented AppleSoft stuff, you will need something AFA Gary J else, though. A good place to start looking for AppleSoft entry points is AFL Scott Night, all! Must go check my forum. Take care! AFA Gary J right here on AppleLink in the Reference Library (keyword REFERENCE). Coach101 Night Scott.... AFA Gary J Use the keyword "AppleSoft and Internals", and you'll find a wealth of AFA Gary J knowledge A2GS I've got a whole list of entry points, that really isn't my problem, I wish it A2GS were JUST that. :( AFA Gary J What assembler do you own? A2GS I did already, basically got the same INFO I already had to start out with. A2GS ORCA/MERLIN A2GS Use mainly Merlin. AFA Gary J Older versions of Merlin have an AppleSoft lable file to go along with AFA Gary J SOURCEROR. JDavies1 good night all AFA Gary J (It'll let you disassemble AppleSoft with comments) AFA Gary J Goodnight. AFA Gary J (Thanks for coming) AFA Gary J Are you using SOURCEROR? A2GS Yes, But unfortunately I can't Source(rer) the whole ROM. I got 3.41 and now A2GS (version that is) and recently 16+.