========================================================================= (C) 1993 by Atari Corporation, GEnie, and the Atari Roundtables. May be reprinted only with this notice intact. The Atari Roundtables on GEnie are *official* information services of Atari Corporation. To sign up for GEnie service, call (with modem) 800-638-8369. Upon connection type HHH (RETURN after that). Wait for the U#= prompt.Type XTX99437,GENIE and press [RETURN]. The system will prompt you for your information. ========================================================================== ************ Topic 22 Sun Jan 24, 1988 SYNERGIST (Forwarded) Sub: >>>Beginner's Corner<<< Who wants to get into programming but doesn't know where to begin? Who wants to program the computer, instead of having the computer program them? This is the area for all you beginners! (*ken*) 201 message(s) total. ************ ------------ Category 3, Topic 22 Message 1 Tue Jan 26, 1988 DARLAH (Forwarded) Reuploaded up for: SYNERGIST (Forwarded) I just recently saw a message from someone who wanted to know where to begin to learn programming. I've seen other messages in the past where beginners have been bold enough to ask how in the heck they could learn to teach their computer what to do, instead of the other way around. It's GOOD to see these questions! Sometimes I wonder how many folks are out there wondering what in the heck is going on, but are afraid to ask because they think they'll appear stupid. Well, the old adage about the stupid question is true: The only stupid question is the one you don't ask. So here's a place for people that don't know the first thing about programming to find out how they can go about making their computer do what they* want it to do, not what some programmer decided it should do for them! ttfn... (*ken*) ------------ Category 3, Topic 22 Message 2 Sun Jan 24, 1988 G.HOWARD [GINA] (Forwarded) WHAT IS THE BEST WAY TO LEARN PROGRAMMING ON THE ST. I'VE DOWNLOADED SEVERAL PROGRAMS FROM THE SOFTWARE LIBRARY'S. ONE THING I HAVE NOTICED IS THE MENTION OF THE SOURCE CODE INCLUDED IN THE PACKAGE, APPARENTLY FOR CUSTOMIZING THE PROGRAM. I WOULD LIKE TO GO IN AND CHANGE THINGS OCCASSIONALLY BUT HAVE NO KNOWLEDGE OF HOW TO GO ABOUT IT. I REALIZE I NEED TO START LEARNING ABOUT LOGO. THE BOOKS I HAVE ARE UNCLEAR. THE TERMINOLOGY IS FOREIGN. HOW DO I GO ABOUT LEARNING ABOUT PROGRAMMING ON THE 520ST? *S ------------ Category 3, Topic 22 Message 3 Tue Jan 26, 1988 DARLAH (Forwarded) Reuploaded for: SYNERGIST (Forwarded) To respond specifically to the message that was left in Category 1, topic 5... Gina, you mentioned wanting to know how to 'customize' the programs that you download from GEnie, and that's great! That is almost exactly how I learned to program in the first place, except it was before I had a modem, and my only source of programs was the type-in kind from the magazines. So I'd type them in, and play around with them until I had them working the way *I* wanted them to. Eventually, I got up enough gumption to go chasing after some other languages than the BASIC that was built into my Atari 800XL. The first thing you need to start programming is a language to program in. The ST comes with BASIC (and used to come with LOGO as well), and even though BASIC isn't the best* language in which to learn to program, it's better than nothing. One thing to keep in mind is that there are several varieties of BASIC out there, from the one Atari packages, to True Basic, to GFA BASIC, to LDW, even a "shareware" type of BASIC (DTACK's D-BASIC). You may or may not want to spend money on a programming language; if you've already got Atari BASIC or LOGO, that's fine to start with. You also mentioned that you had downloaded some programs that included source code so that you could modify them. You must keep in mind that if you have the "source code" (the human-readable version of the program, as opposed to the "object code" which is understood by your ST), it must be in the same language (and most of the time the same "dialect" of that language) which you are using on your ST. As there are many dialects of BASIC avaialable, there are also many different languages you can use to program; C, Modula-2, Pascal, LOGO, LISP, Prolog, and more. When you download a program from GEnie, it may have source code for another language, and if that's the case, you won't be able to modify the program unless you have the same language to work with. So, just what have you got? What would you like to learn? You mentioned wanting to learn LOGO, that is a very good choice for a first language to learn. You can learn much about programming and other things from using LOGO. But what programs do you want to modify? For starters, lets find out what you have to work with... ttfn... (*ken*) ------------ Category 3, Topic 22 Message 4 Tue Jan 26, 1988 DARLAH (Forwarded) Reuploaded for: CAPT.COOK (Forwarded) Also, back in the 8-bit days, I feel I learned a lot about Basic jsut by typing in programs. In this way you become fairly intimate with the program or source code, and you can change different parts and see the results. This is the opinion of a non-programmer. I dabble with Megamax C, but strictly on the "hello world" level. -CC ------------ Category 3, Topic 22 Message 5 Tue Jan 26, 1988 DARLAH (Forwarded) Reuploaded for: G.HOWARD [GINA] (Forwarded) THANK YOU FOR TAKING AN INTEREST. I HOPE THIS TOPIC IS NOT DELETED. I BELIEVE THERE IS A GREAT NEED FOR A "BEGINNERS CORNER". AS FOR WHAT I HAVE TO WORK WITH, I OF COURSE HAVE A 520ST. MOSTLY I RUN PROGRAMS THAT I HAVE PURCHASED OR DOWNLOADED FROM GENIE. SO MANY TIMES I DON'T UNDERSTAND THE TERMINOLOGY. I DO HAVE BASIC AND LOGO WHICH WERE BOTH INCLUDED WITH MY SYSTEM. ONE ITEM I AM INTERESTED IN FOR INSTANCE IS THE GAME LARN, WHICH WE LOVE. I HAVE BEEN ABLE TO CHANGE, DELETE OR EVEN GET THE OPTIONS TO WORK. I HAVE NO IDEA WHAT I AM DOING WRONG. I HAVE THE LOGO SOURCE BOOK, WHICH WAS INCLUDED, ALSO I HAVE A COPY OF THE BOOK "THE ATARI ST USERS GUIDE". BOTH NOTE THAT THEY ARE MEANT FOR THOSE ALREADY FAMILIAR WITH SUCH. WHAT DO I GET FOR A BEGINNER? ANOTHER EXAMPLE - ANTIC MAGAZINE HAS TYPE IN PROGRAMS. I TRIED ONE - A SIMPLE GRAPHICS PROGRAM. I GOT AN ERROR MESSAGE WHEN I RAN THE BUFFER. NOW I TYPED THIS PROGRAM IN EXACTLY AS WRITTEN. IT WAS WRITTEN IN LOGO. I JUST FIGURED OUT HOW TO RECOGNIZE THE DIFFERENCE. THAT'S HOW LITTLE I KNOW. I'VE OPERATED COMPUTERS FOR YEARS BUT HAVE NEVER HAD ANY EXPERIENCE WITH PROGRAMMING OF ANY KIND. THANK YOU FOR YOUR HELP AGAIN. GINA ------------ Category 3, Topic 22 Message 6 Tue Jan 26, 1988 DARLAH (Forwarded) Reuploaded for: SYNERGIST (Forwarded) Welll.... actually, it was just Gina's message that prompted me to start this one up, but I've seen plenty of messages like hers from other folks, and I wanted to try to bring 'em out of the woodwork, and I guess you're right about not having her message in here, and, and Gina, Hmm, I haven't played with LARN, but have heard of it. Maybe someone who's reading this topic who has* played LARN can help ya out there. But be sure to check out CATegory 9, topic 20, that topic is all about LARN, and you might find just the help you need there... Okay, you have a 520ST, and the BASIC and LOGO that came with it. That's a good start. For a beginner programming book, you might want to check Compute! books, they tend to have a good set of beginner oriented books. See if you can't find _The Elementary Atari ST_ or _Kids and the Atari ST_. Even if you don't have any kids, the latter book is full of good examples for beginners. I believe Abacus has a good LOGO book, but I haven't read it, so I can only tell you what's been passed on to me. Definitely be sure if you're typing in a listing from a magazine that you check the article to be sure what language the type-in program is intended for. Some BASIC type-ins in some magazines come along with an error-checking program you can run to make sure you typed in the program correctly. For LOGO programs, you have to be sure that you type in all of the procedures listed in the article, or LOGO will tell you that it doesn't know how to "Snarfle" if you have forgotten to type in the "Snarfle" procedure In any case, after you've had a chance to get your feet wet by typing in and running some programs from the magazines, maybe we could try out a programming project here to help you explore BASIC or LOGO. How does that sound? Anyways, good luck with the type-ins. I know it can be a tedious process, but it's a great way to get a feel for what you can do with a language! And I hope you can find a beginners book to help you on your way. In the meantime, feel free to ask any questions here, and that goes for all you beginners out there! ttfn... (*ken*) ------------ Category 3, Topic 22 Message 7 Wed Jan 27, 1988 D.A.BRUMLEVE (Forwarded) I'd like to second the recommendation of "Kids and the Atari ST" for kids or adults who want to learn STBasic. I started with it and was writing fine programs rapidly. Also, if you are using STBasic, it's worth buying "The Programmer's Kit" from AccuSoft in Ohio. This is a bunch of peek'n'poke subroutines that achieve for STBasic many of the same effects that can be achieved in GFA with a simple one-line command. Speaking of GFA, I think it's a perfect beginner's language. But it won't work with the book mentioned. That book is from Computer Sorry, Compute Publications, easily obtainable. ------------ Category 3, Topic 22 Message 8 Tue Aug 02, 1988 J.SINKIEWICZ (Forwarded) I am having a difficult time trying to get a demo program to run. The demo program is called LCD.PRG and it has a companion file called ERIK.UDO. When I try to run it by Clicking on the Icon I get a TOS ERROR #35 (No Handles Left). What does this mean? How can I get this to run? I have a 1040 ST (Color Monitor). This demo runs on other STs, a 520 ST with 1 Meg is one of them. Please help. *p ------------ Category 3, Topic 22 Message 9 Wed Aug 03, 1988 DANSCOTT [Dan @ Atari] (Forwarded) TOS Error #35 usally happens when the program you are trying to run is either not a program file (an ARC file re-named) or part of the file was lost in a copy/download operation. The usual solution for this is to re-copy or re-download the offending file. There is no way I know of other than that to recover the program. Dan P.S. Try unARCing it just for the hell of it to see if it is an ARC file. ------------ Category 3, Topic 22 Message 10 Wed Aug 03, 1988 J.SINKIEWICZ (Forwarded) Thanks Dan, I'll give it another try. Thanks again. Is there a list of TOS errors somewhere, perhaps on this board that I could get, so that I can use it for reference? ------------ Category 3, Topic 22 Message 11 Thu Aug 04, 1988 DANSCOTT [Dan @ Atari] (Forwarded) I looked around for info on the types of TOS errors you can get and here is what I found. GEMDOS error codes: 32 Invalid function nymber 33 File not found 34 Path not found 35 No file desciptors left 36 Access denied 37 Invalid file descriptor 39 Insuffucuent memory 40 Invalid memory block specified 46 Invalid drive specified 49 No more files 64 Range error 65 Internal error 66 Invalid program load format 67 Setblock failure due to growth restrictions Of those errors, I have only seen #33,#34, and #35. Usually this can be traced back to a problem with the FAT tables on the disk in use at the time. Some other numbers you might be aware of (these will also pop up in a 'TOS error' box). 0 No error 1 General error 2 Device was not ready, was not attached, or has been busy for too long 3 Device didn't understand the command 4 Soft read error 5 Device couldn't handle the command, although it understood it. Check command parameters 6 Drive couldn't perform the seek 7 Attempt to read un-formatted or foreign media. Usually caused by a trashed or zeroed boot block 8 The requested sector could not be found 9 The printer is out of paper 10 A write operation failed 11 A read operation failed 12 Reserved for future errors 13 Attempt to write onto write-protected or read-only media 14 The media has changed since the last write. The operation did not take place 15 The operation specified a device that the BIOS couldn't recognize 16 A format operation detected bad sectors 17 Request to ask user to insert a disk Most of those will be handled internally by the program you are currently running. I've only seen #1 pop up in an TOS error box. Dan ------------ Category 3, Topic 22 Message 12 Thu Aug 04, 1988 TIMPURVES [Turbo_tim] (Forwarded) Hmm wonder were you dug that list up. In _all_ my doc's (error -35) has always been (bad program format) ------------ Category 3, Topic 22 Message 13 Fri Aug 05, 1988 DANSCOTT [Dan @ Atari] (Forwarded) I've seen it called different things by different books. But it all boils down to the fact that the program will not work. Dan ------------ Category 3, Topic 22 Message 14 Fri Aug 05, 1988 GRIBNIF [Dan] (Forwarded) The Mark Williams docs agree with Dan's docs that -35 means "no file handles left." I have never gotten this error myself, and if a program is trashed (like a bad FAT) it usually returns -66, from my experience. Dan ------------ Category 3, Topic 22 Message 15 Tue Aug 30, 1988 J.SINKIEWICZ (Forwarded) I was trying to write a simple line drawing program in ST BASIC and I wanted to look at the screen where the cursor is and get the screen information there, such as the back ground color or what charcter is there . Can anyone help me with this? ------------ Category 3, Topic 22 Message 16 Tue Aug 30, 1988 DAEDWARDS [Don Edwards] (Forwarded) ST Basic... that's a tough one, I doubt if that many people who actually program still have it. (I formatted my last copy more than two years ago.) The best I can do is tell you what's reasonably possible and how to do it in GFA Basic... First, determining what character is present is not feasible. Possible, but a GREAT deal of work. It involves looking at anywhere from a 6*6 to a 32*16 pixel area of the screen and comparing its contents to a table (which you get to build) which contains complete bit images of the entire 256-character set in each of 4 styles at probably at least 3 sizes. The operating system does not store the ASCII code contents of the screen ANYWHERE. It only stores the bitmap screen image. So, reading characters off the screen is a royal pain no matter what language you are working in. Now: to read the color present at a given X,Y coordinate in GFA Basic, the instruction is (where's my manual) Color=Point(X,Y) Don Edwards ------------ Category 3, Topic 22 Message 17 Wed Aug 31, 1988 J.SINKIEWICZ (Forwarded) I'm just going to have to get me a copy of GFA basic. Which should I buy? There are two kinds, interpreter or compiler. I haven't ever done any compiling, although I've seen it done. Can GFA interpreter code be compiled with the compiler? ------------ Category 3, Topic 22 Message 18 Wed Aug 31, 1988 D.N.WHEELER [Doug] (Forwarded) OK, here's the info: currently there is GFA BASIC 2 and GFA BASIC 3, and a compiler for GFA BASIC 2. The compiler requires that you have the interpreter (it compiles everything, not a sub-set). I would highly recommend GFA BASIC 3, as it has *many* new commands, and a compiler for it is promised before Xmas. Even using the interpreter, you are free to distribute the run-time program, and you can prevent your code from being listed. Interpreted is just a little slower than compiled (although both interpreted and compiled are *VERY* fast). Hope this helps. --Doug ------------ Category 3, Topic 22 Message 19 Wed Aug 31, 1988 DAEDWARDS [Don Edwards] (Forwarded) If you don't have the GFA Basic interpreter, then the GFA Basic compiler is useless. It doesn't compile ASCI source, it compiles tokenized stuff and the easy way to create that is to Save the program from within the interpreter. That is not, of course, the ONLY way to create it... but it is certainly easier than working with hex codes and multiple tables stored end to end in a single file... particularly since this latter process is not documented... There are only a small group of commands which the interpreter handles but not the compiler (this is assuming version 2 of each... there are LOTS of commands that version 3 interpreter handles but version 2 compiler does not), and they are real line-by-line type debugging commands. Don Edwards ------------ Category 3, Topic 22 Message 20 Mon Nov 28, 1988 R.DAMIANO (Forwarded) Any Help would be appre... Im trying to write a MIDI Program in Laser c and everything's going fine except... I don't know how to receive MIDI FAST enough. The device I'm dealing with spits out a digitized waveform when my program requests it. Bconin() isn't fast enough to catch it all. I tried using Kbdvbase() to point the midisys vect to my own asm{} routine which would store the recieved byte in a global C var. That helped but it ll isnt fast enough. I think there is too much other crap going on in the OS. (if I wiggle the mouse around while the data is comming in, I miss even more!). Im sure there is a simple answer to all this but I'm not a hot enough C programmmer to figure it out by myself. Thank you!! ------------ Category 3, Topic 22 Message 21 Mon Nov 28, 1988 D.N.WHEELER (Forwarded) Have you tried enlarging the MIDI buffer? --Doug ------------ Category 3, Topic 22 Message 22 Tue Nov 29, 1988 J.EIDSVOOG1 (Forwarded) I have a feeling that it's the bindings used in Laser C that may be taking up the extra time. A relatively simple intermediate step might be to write in- line assembly that calls the bios directly. This plus a large MIDI buffer (maybe 10K, maybe more) will probably solve your problem. If you've just been using the 128 byte default buffer, you're bound to run into some problems. BTW, this is addressed to R.Damiano (I _love_ the Genie message system)! ------------ Category 3, Topic 22 Message 23 Tue Nov 29, 1988 R.DAMIANO (Forwarded) Thank you ver much D.N. Wheeler, and J. Eidsvoog1!!! A) I tried writing an asm routine which would read the MIDI acia directly, but kept getting EXCEPTION 2 IN SHELL! B) I would like to try a larger MIDI buffer but... I dont know how to do it. any ideas? C) My program must accept up to 128K of data. Thanks again very much. I was suprised to hear something so soon!! ------------ Category 3, Topic 22 Message 24 Thu Jan 12, 1989 R.LISOWSKI (Forwarded) Could someone explain adresses and data byte representation? I am a hardware person (low level--1's and 0's) just getting into serious programming in C, and I don't understand what stuff like $FFFOOO means. are these characters directly translated into a bit pattern on the bus? Is there a program that will take such strings and output a 10100001 or whatever for the input string? What do the symbols like the $ mean? Rob ------------ Category 3, Topic 22 Message 25 Sat Jan 14, 1989 M.L.HANSON at 10:03 CST The prefix of $ means that the number following it is expressed in hexadecimal. All personal computers are based on an 8-bit byte and the contents of an 8-bit byte can always be represented by 2 hexadecimal digits. Hex-6 plus decimal-10 = 16 combinations. And 16 times 16 gives 256, the number of combinations that are possible with 8 bits. The symbols for hex are 0,1,..9,A,B,C,D,E,F and they stand for 0,1,...15. The ultimate meaning can only be determined in context. That is $4A6F686E means 'John' in ASCII code or the binary number 1,248,815,214 or the binary number 19,055 followed by 26,734 or something entirely different devised for some ad hoc purpose by the programmer. So there is a one for one translation from $FFFF0000 to a bit pattern on the bus, as you suspected. It is 11111111111111110000000000000000. The C compiler will take care of the translation for you automatically. It will also, for most programs, handle the nitty-gritty of addresses. You will refer to the memory by using variable _names_ and the compiler will convert these names into suitable addresses. The addresses are simply sequential numbers starting at zero, one number for each byte. So a 1040ST has addresses 0,1,..1,048,575. The ST typically reads or writes two bytes at a time. Thus the name ST, Sixteen bits externally (on the bus) and Thirty-two bits internally (on the microprocessor chip). The following table shows decimal representation vs hex vs binary. Decimal Hex Binary 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 8 1000 9 9 1001 10 A 1010 11 B 1011 12 C 1100 13 D 1101 14 E 1110 15 F 1111 The compiler I use mostly is Pascal. If I let the compiler know that x will be used to contain a 16-bit integer, I can then write: Program bit pattern stored at 'x' x := 13 0000000000001101 or: x := $13 0000000000010011 In other words the default representation ,no $, is decimal. - Merlin ------------ Category 3, Topic 22 Message 26 Sat Jan 14, 1989 R.LISOWSKI at 15:19 EST Thanks Merlin! Yeah, I suspected there was order to this chaos. B^) I was interested in what the stuff looks like on the bus, because I design the hardware that reads the bus, but I am dealing with buffers and gates, so I am thinking H or L (1 or 0)-- not $FFFF0000. B^) But, I have to be able to tell the machine how to operate the hardware, so that's why I'm learning C (with Kernighan and Ritchie's second edition of "The C Programming Language"). I suspect I will need some assembly in there too so I can get real particular with the hardware and control timing and adresses directly. I have written some VERY simple, very portable C programs while learning my way around the Mark Williams C compiler (v 3.0.9), and I can't wait to get into the AES of the ST. Rob ------------ Category 3, Topic 22 Message 27 Thu Apr 13, 1989 J.NAVARY at 19:32 EDT The "bug" has finally bitten and I've decided to see if I can get involved in learning how to program. (By the way, I noticed that the last memo in this topic was dated in January so I hope someone is still out there) Anyway, from what folks tell me, the way to go seems to be to learn "C" language. Not knowing anything about it I am pleading for help as to where to begin. I notice that there appear to be a couple of C compilers in the library. Is that a good way to start, along with a generic manual (as can be found at Walden Books, etc)? Although I have high hopes I am also enough of a realist to admit that once I get into it I may discover that programming in C just isn t for me. Would hate to have plopped down $150 or so for nothing. Does anyone have any advice for a "possible 'would-be' C novice"? Thanks in advance ..................... Jim ...................... ------------ Category 3, Topic 22 Message 28 Mon Apr 24, 1989 JLS [John STanley] at 05:31 CDT Jim Navary, Grabing Sozobon C and the librarys that go with it to experiment with writing your own C programs is a fine idea. I'd also recommend that you get the old version of "The C Primer" if you can find it. (Sozobon C and all the related utility and library files are in the RT library. Use the search option to scan for "Sozobon" and/or "dLibs".) ------------ Category 3, Topic 22 Message 30 Mon May 08, 1989 R.DAMIANO at 19:15 EDT Help, I am having trouble trying to write a C program which uses the MFP Timer- A to interupt an vector to one of my routines. I am using an assembly lang "Dispatcher" like the example on pg 530 of the Laser C book but am also saving address and data registers on (A7) and restoring them when I'm through. The problem is that if the function which the dispatcher calls, calls any BIOS or VDI function, I get an exeption 2 or 4 after just a few times. WHY??? If I call a dummy function which makes no use of any OS calls, it works fine, but I have tried calling a routine which uses Dosound(), and v_gtext(), and they both crash! ------------ Category 3, Topic 22 Message 31 Mon May 08, 1989 JLS [John STanley] at 21:27 CDT As Dan (GRIBNIF) said in topic 16: It isn't safe to call VDI, GEMDOS, BIOS, or XBIOS from within a interrupt routine. There's too much of a chance your interrupt will be called while those subsystems are doing one of a couple of things that can't co-exist with another call to the same subsystem. If you give us a better idea of what it is you're trying to do, we may be able to come up with some semi-legal method to do whatever it is without violating the above rule. ------------ Category 3, Topic 22 Message 32 Tue May 09, 1989 R.DAMIANO at 18:44 EDT Thanks JLS... I read Dan's reply and have written back in top 16 explaining what I am trying to do. Thanks VERY Much!!! BOB... ------------ Category 3, Topic 22 Message 33 Thu May 11, 1989 JLS [John STanley] at 23:14 CDT R.DAMIANO, BTW, you might want to consider using the 200hz clock instead of using your own Xbtimer routine. This would save you the code overhead in the program, and make the rest of your code run a bit faster because you won't be interrupting as often. If you just grab the initial value of the system's 200hz counter, you can subtract that from the current value at any time and have a nice accurate clock for the cost of a peek-time function... ------------ Category 3, Topic 22 Message 34 Fri May 19, 1989 D.M.SCHWARTZ at 22:51 PDT Hi all, I just picked up Mark Williams C version 3.0.5. I have done some BASIC programming and Pascal, but nothing too difficult. I'm a little lost getting started with this. I also picked up the book "Programming in ANSI C" by Stephen Kochan. This book explains things well. Am I going to find a lot of differences between the Mark Williams C for the ST and the examples in the ANSI C book? Also, any tips for a beginning C programmer? Anyone seen any good tutorials, other than this book? How about a Computer Based Tutorial or something, like on USENET type service, etc.?? ------------ Category 3, Topic 22 Message 35 Sun Jun 04, 1989 CZEMPEL at 00:37 PDT I am considering purchasing a Mega 2 Real Soon Now. One of the first things I'd like to get my hands on is a good C compiler. I'm an ST beginner -- but not a C beginner, with a fair amount of C programming experience in MS-DOS and CP/M. I have seen several mail order ads in the $100 to $125 range -- Mark Williams, Megamax/Laser, Lightspeed, etc. There also seems to be an Alcyon C available as part of a "ST Developers Kit." Do you really just _buy_ a developer's kit? (Mac developers have to file business plans, etc. -- but that's the only way to get one at a decent price.) What else comes with this kit and developer status? Does anyone use Alcyon? Have I overlooked any other compilers? I'd prefer comparisons and specifics to "oh, gee, I use this compiler and I just LOVE it!" Pointing me towards published reviews, tests, and comparisons would be appreciated, too. I'm looking for information on things like: full ANSI ST-specific extensions ass'y language interface integrated environment compile times, code speed, code size source code for libraries What about supporting utilities like debuggers, profilers and tracers, online help, etc? And external assemblers, linkers, librarians? Are there any excellent ones available from third parties? Also, is there a de facto standard, similar to what Turbo Pascal became in the IBM and CP/M worlds? (I see Laser C mentioned an awful lot in magazines and public domain stuff. Good at any price, or just a good buy?) I am aware that I am probably opening up a real can of worms. We C programmers seem to make up for the terseness of our code with the verbosity of our praises for our favorite compilers. Thanks in advance! ------------ Category 3, Topic 22 Message 36 Mon Jun 05, 1989 M.GAINES at 23:25 EDT I'll give you my two cents ($0.02). I have Laser C and love it a lot! It's quick on a 1040 and is probably even faster w/a hard drive. .PRG files are small and can be made smaller by inserting the #includes you need. All the important .h files are listed in the manual. It is faster than the rest, however I don't know about quality machine code... I never tested it. Good Luck -> Mike <- ------------ Category 3, Topic 22 Message 37 Sun Aug 13, 1989 M.MITTON at 09:46 EDT I have just made a switch from st basic to c, and am having problems with laser c. I just purchased version 2.0 , and when I follow the instructions in chapter 2.6 sample session, when I click on run under the execute menu I get a warning box saying the data in disk A may be damaged, I then click cancel on the warning box and everything appears to work,however the thing tells me that there are errors, in the pro gram.I have triple checked the typing and spacing in the program. I am using 1 single sided disk and after loading the laser.prg I insert the work disk. Any help will be greatly appreciated. Mike *S Michael S ------------ Category 3, Topic 22 Message 38 Sun Aug 13, 1989 K.MCKILLOP at 21:59 CDT Mike -- If you're getting an alert reading "Data on disk A may be damaged" you probably have a problem with your disk rather than your code or installation. I would suggest you format the disk and reconstruct the files on it from backups (I hope you backed up those files). If that fails, throw the disk away and try another. Usually the "data damaged" alert comes from the operating system when it can't read the disk correctly. Are you saying that you're getting compiler errors in the STDIO window? I don't doubt you've typed in the "hello world" program correctly; the only possibility that occurs to me is that the "stdio.h" file is corrupted. When you Run "hello world," Laser C reads the "stdio.h" header from the HEADERS folder supplied on the WORK disk. The header file is a piece of standard code used to support printf() and other UNIX I/O functions, and it is compiled along with your code. If it is corrupted, you could get compiler errors. Try loading "stdio.h" into the editor and comparing it with the listing in Appendix E of the manual. Spacing is not significant in C. You can stick spaces or blank lines just about anywhere you want 'em. -- Ken ------------ Category 3, Topic 22 Message 39 Mon Aug 14, 1989 M.MITTON at 19:57 EDT Thanks for the info Ken. I will give your ideas a try and let you know what happens. Mike ------------ Category 3, Topic 22 Message 40 Sat Aug 19, 1989 M.MITTON at 10:53 EDT Ken you were right about the "stdio.h" file. It was messed up. However when I try to copy it onto another disk it keeps giving me the same warning about the data may be damaged. I loaded the file from the work disk that came with laser c into the editor and tried to save it to my working copy and still no luck. The disk I am using I am sure is ok because I have transfered other programs to it before and after and they work fine. It seems that this file just doesn't want to transfer to another disk. Oh the "stdio.h" file on the original is the same as in Appendix E of the manual. Can anyone explain why this file won't transfer! MIKE ------------ Category 3, Topic 22 Message 41 Sat Aug 19, 1989 K.MCKILLOP at 20:44 CDT Mike -- I, for one, am confused. There is no easy way to be certain your disk is OK, but a persistent problem with one file, if it is being recorded in different places on the disk while showing the same problem, indicates the file is bad not the disk. The copy may be bad on your original disk, but I don't see why it would read correctly in the editor. Try the following: 1. Check the write protect tabs on your disks. This, of course, may be completely useless. 2. Use a disk utility program to check the file attributes on the "stdio.h" file -- it is just possible it has been set to read only instead of read\write, in which case you would not be able to write a new copy over the old one. This also may be useless. I think you are going to have to be more specific about your problem. If you can't get it to work, E-mail me the following: 1. A precise description of your system hardware. 2. A precise listing of the files and folders on all the disks you are using. 3. A *precise* description of the procedure you are following, including a direct and complete quotation of the error messages you are getting. I'm asking you for a lot of information, most of which will be useless. But something trivial is screwing you up, and without the precise details I can't diagnose it. I assure you that Laser C does work -- I use it regularly and have none of these problems. I'm pretty sure you just have a bad disk or corrupted file, but I can't tell exactly what's wrong at the moment. Good luck! -- Ken ------------ Category 3, Topic 22 Message 42 Sun Aug 20, 1989 JLS [John STanley] at 00:59 CDT Mike, a few quick comments... The fact that you've saved other files to a disk, doesn't mean the disk os ok. It just means the areas of the disk that hold those files are ok. The most common cause of the problem you're describing wuld be one bad sector on the disk...something that wouldn't effect any files before or after that one file. Try this... Rename the bad "stdio.h" file to "badfile1". Then try copying stdio.h to the disk again. I strongly suspect you'll find that it works. The important thing is to never delete the badfile1 because that file holds the bad sectors out of the way of other important files. I'd even consider using the "Show Info" from the desktop to make the file read-only so you won't forget and delete it by mistake... If this works, I'd also strongly suggest that you copy the files off that work disk and reformat it or throw it away (depending on how much of a risk taker you are...). Any disk that contains a bad sector may be formatted and the problem goes away forever, or it my pop up again right in the middle of the most important file on the disk. You never know which is whi I tend to deep-6 any floppys that do this even once... ------------ Category 3, Topic 22 Message 43 Mon Aug 21, 1989 DAEDWARDS at 20:54 PDT If the problem occurs on another (different) disk anytime in the next month or so, I recommend that you IMMEDIATELY take anti-virus action. (You probably don't have a virus... but about some things, better a couple hours of paranoia.) There are some decent virus detecting and removing programs in the library here. Don Edwards ------------ Category 3, Topic 22 Message 44 Fri Aug 25, 1989 M.MITTON at 07:33 EDT To Ken and all the others who offered their advice here Many thanks. I have finally managed to get laser c working. You were right Ken it was something simple. The original disk from Megamax is formatted in 10 sectors,while the disk I was trying to copy it to was 9. Well thanks again everyone. mike ------------ Category 3, Topic 22 Message 45 Thu Oct 19, 1989 R.PERRING (Forwarded) I've started writing my first programs in C, I find the language enormously attractive and powerful, and think it would be helpful if if could find anyone out there doing the same. Leave messages for Ron Perring. ------------ Category 3, Topic 22 Message 46 Mon Jan 29, 1990 M.ABREU at 20:46 EST I'm trying to write some simple code to alter the RS232 port characteristics. Baud rate and flow control aren't a problem (yet?), but the parity and character size stuff is hard for me. In the Abacus Atari ST Internals book I see the following: USART Control Register: bits function ---- -------- 0 unused 1 odd/even parity 2 parity check on/off 3,4 start/stop bits 4 3 Start Stop ----- ----- ---- 0 0 0 0 Synchronous 0 1 1 1 Asynchronous 1 0 1 1,5 Asynchronous 1 1 1 2 Asynchronous 5,6 wordlength 7 (TC RC) frequency First, I have no idea what the "1,5" means in the start/stop bit configuration. Second, I have no idea what bit 7 is for. Originally I thought I could somehow get the current UCR mask, OR in my new values, and write the new UCR. Problem is I haven't been able to write any "C" that will get me the current UCR. I read that I need to be in supervisor mode to get to the MFP registers. I'm new to "C" and can't figure out exactly how to write the code to get into Supervisor mode, get the current UCR, and get back safely. Is there an example somewhere I can get access to? My other alternative is to set the entire UCR at once the way I want it. If I could resolve the "1,5" confusion I have and the "bit 7" mystery I'd go that route and bag the supervisor mode stuff. ------------ Category 3, Topic 22 Message 47 Mon Jan 29, 1990 DOUG.W at 21:53 EST M.Abreu, I'd strongly recommend that you take a look at the XBIOS function Rsconf() which allows you to set all this stuff without reading from or writing to the MFP chip. --Doug (BTW, the 1,5 is a typo for 1.5 meaning 1 1/2 stop bits) ------------ Category 3, Topic 22 Message 48 Sun Feb 04, 1990 JLS [John STanley] at 01:17 CST M.ABREU, ditto what Doug said. Several things in your msg imply you haven't taken a good look at the available system functions. Whenever possible, it's best to use what the OS has already made available rather than going in and poking at the hardware level. Check whatever library header files (.H extension) that came with your compiler for one called OSBIND.H and #include it in your program. Once you've done that, you'll have access to lots of useful low-level functions without having to reinvent the wheel... ------------ Category 3, Topic 22 Message 49 Sun Feb 04, 1990 M.ABREU at 16:25 EST I've read about Rsconf, and I planned to use Rsconf, so I guess I need to describe what my problem is a little better. According to what I've read about Rsconf, I have to supply a UCR mask (8 bits) that describe how I want things set up. Ideally I'd like to be able to change only part of the UCR (say, enable or disable parity), while leaving other parts of it unchanged (start/stop bits, or word length). Rsconf doesn't let me do that. I've got to supply all bit settings. So it appeared to me that I had 2 options: 1. Somehow read the current UCR value from the MFP, OR in the bit settings I want to change, then use Rsconf to set the new UCR. 2. Give up on setting part of the UCR and set it all via Rsconf. As I described in my other message, although I'd like to be able to do #1, I'm willing to go the #2 route, but my hardware ignorance prevents me from doing so until I understand what the following UCR bits do: Bit 4 3 Start Stop 0 0 0 0 - Synchronous 0 1 1 1 - Asynchronous 1 0 1 1,5 - Asynchronous (??? What's the 5 for ???) 1 1 1 2 - Asynchronous Bit 7 (??? Don't understand this bit at all ???) 0 - Frequency from TC to RC (used only for synch. transfer) 1 - Frequency in TC and RC internally divided by 16 There's one other reason I'd like to be able to get the current UCR value. I can write code to change the UCR, but I don't have a good way to check to see that I've actually set the port up the way I'd like. It could be that I'm missing some bigger picture since I've never really fooled with the serial port, and I'd appreciate any advice. ------------ Category 3, Topic 22 Message 50 Sun Feb 04, 1990 DOUG.W at 20:02 EST Bits 3&4 determine the number of stop bits: 0 (synchronous communication only), 1, 1.5 (one and one-half), or 2. Bit 7 determines the Clocking. 0 = use the clock directly for transfer frequency (usually synchronous only, but with a high-speed handler might be made to work asynchronously). 1 = Divide clock frequency by 16 (this is the default for the ST, and no current applications change this). In most cases, your application will know the state of the others. If you really need to get the old value, that shouldn't be too difficult, just read a byte from the register (ucr is at $FFFFFA25), change the appropriate bits and write it back out. Remeber, though that this is a byte sized register at an odd address, so attempting to access it with a word-based instruction will result in an Address Error. Also, you must be in Supervisor mode to access hardware registers (or you'll get a Bus Error). --Doug ------------ Category 3, Topic 22 Message 51 Sat Feb 10, 1990 M.ABREU at 19:20 EST Thanks Doug, that's exactly what I wanted to know. Now assuming I'm using C, what I was originally looking for was a description or example of how to get into supervisor mode, get the register value, then get out of supervisor mode. Like you pointed out, I don't need to do it if I just set the entire ucr at one time, but I'd still like to know that my code's doign what I want it to by looking at the ucr. ------------ Category 3, Topic 22 Message 52 Mon Feb 26, 1990 J.KUNCL at 00:23 CST Hello I'm a novice who wants to start to write my own games,since no one else will publish what I want to play.I have no experience but am retired and have lots of time to learn.So here is my question, I would like to develope military simulations with limited graphics, on the order of SSI's war games(Overrun,Warship,etc.).Which would be the best language to use?Ease of learning is important but not overiding.Where can I find imformation on creating the AI for the computer player?Thanks for any help you can give me. I'm glad to see information for beginners in any field,so keep up the good work. Joe Kuncl ------------ Category 3, Topic 22 Message 54 Wed Mar 21, 1990 M.L.HANSON at 03:48 CST I am trying to run a sort program via a shell to minimize the labor and human memory required. I am using REDIRECT.TOS to provide input from a file rather than the keyboard. Using '*' to delimit comments the file contains: MYFILE.IDX * file to sort 2 * nbr lines per record 47 52 * first col, last col to sort * blank line denoting end of sort params (sort takes place here. then a query for output file name) MYFILE.SRT * file to receive sorted output The file is sorted exactly as desired, but the output goes to a file named '47'! Coincidence? It looks like the redirection stuttered. Imperfectly. The whole thing is driven by PCOMMAND.PRG. The sort is SORTER.TOS (immaterial, I think). Before trying this I tried to find intrinsic redirection in PCOMMAND with the aid of an MS-DOS manual, and failed. I have no docs for PCOMMAND. What am I doing wrong? Is there a better way? Yes, I know I can rename '47' to MYFILE.SRT. ------------ Category 3, Topic 22 Message 55 Tue May 08, 1990 A.WESTON at 00:53 CDT A friend is trying to get started programming on the ST, and I have recommended several books that I find invaluable. The only problem is that he cannot locate anyone who sells any of these titles. For starters, ST Internals seems about impossible to obtain these days. Mail order houses that list it in their ads don't have it when we call. The Concise programmer's ref from Glentop is another good one that seems to be impossible to obtain. The Compute VDI and AES books, etc. Where can someone buy these books? If anyone knows of a dealer that has any of these titles (or anything else similar) please give me an address and/or phone number. Thanks. ------------ Category 3, Topic 22 Message 57 Tue May 08, 1990 M.L.HANSON at 06:33 CDT I just ordered and received one of the Compute! books from the publisher by mail. Phone 1(800)345-1214. The books are: Book ISBN Price (shipping extra) VDI 0-87455-093-9 $19.95 AES 0-87455-114-5 $19.95 TOS 0-87455-149-8 $24.95 ------------ Category 3, Topic 22 Message 58 Tue May 08, 1990 LEPULLEY at 09:49 MDT A.Weston, Abacus has dropped support for the ST (according to whoever it is that answers their phone), so you'll have to do some digging to find the ST Internals book. You might try some of the mail-order places that are in the magazines. ------------ Category 3, Topic 22 Message 59 Wed May 09, 1990 A.WESTON at 22:47 CDT Abacus is gone, ok. Apparently the supply of ST Internals is too. None of the mail order places have it. Well....time to drop back and punt. ------------ Category 3, Topic 22 Message 60 Thu May 10, 1990 R.RANDALL5 [Zeroy] at 22:35 EDT Abacus drops ST? Boy! When Abacus decides a computer isn't worth their trouble it really gives one pause. I guess that means I'm on my own with AssemPro now also. Sheesh! It's gettin' lonely out here. BTW, after I got ahold of a copy of ST Internals, I realized that I had most of the information in my Laser C manual. But I didn't really understand the system calls until I saw how they related to the hardware. I guess I'm just an old chiphead, but none of it made any sense to me as disembodied system calls. ------------ Category 3, Topic 22 Message 61 Thu Jul 05, 1990 L.JOHNSON13 at 21:43 CDT Hi. Mom just purchased an old TEKTRONIX 4695 color inkjet printer. We'd like to be able to use it with the ST. We apparently do have a printer driver for the IBM PC compatible, but can anyone tell me of a printer driver for this for the ST? Since I doubt one exists, it should be possible to use the IBM driver config to make one for the st. Anyone have any tips for me on doing something like this? I assume that first you pull the printer codes from the config file. But, how does one make a printer driver on the ST, anyway? Is it a simple ascii file filled with the printer codes? GEnie bulletin boards are still a mystery to me, so I'd appreciate any help to come to me thru MAIL, since I don't know how to check responses to this note. Thanks! L.JOHNSON Lee Johnson ------------ Category 3, Topic 22 Message 62 Sat Jul 07, 1990 J.MEEHAN3 [Joe] at 22:15 EDT L.JOHNSON13, I believe that what you want to do is to look at the software that you are going to be using and see what their documentation says about printer drivers. Second you need the manual for the TEK 4695 to see what features it supports and what codes turn them on and off. Most ST software that support printers have a way of being configured for different printers by the user, often you can use a driver or config file for a similar printer. I don't think that you will find any kind of do all printer driver for an ST. >>> Joe M <<< ------------ Category 3, Topic 22 Message 63 Sun Jul 08, 1990 M.ABREU at 12:42 EDT As far as I know, if someone prints from the desktop there is no "printer driver" that grabs data and does a conversion before printing. Since there are software print buffers and spoolers I suppose someone could (or has) written something like a "printer driver" for stuff from the desktop, but I'm not aware of anything myself. What this means is if the printer accepts straight ASCII characters it'll probably work as is, otherwise you've got some work to do. All is not lost, depending on what software you're using and how far you're willing to go. Some programs, like 1st Word for example, allow the user to create a printer driver. Given the printer manual and some time a person creates what amounts to a translation table, not really writing software though. For GDOS-based software, like Easy Draw for example, the software company might be able to create a GDOS driver for your specific printer. Seems like Migraph used to do this for folks, for some price, if they could supply the printer owners manual. I know in MAC-land and IBMPC-land there are things like printer drivers that are generic across different software packages. For the ST that seems to be GDOS. Hope this helps instead of confusing you more. Mark. ------------ Category 3, Topic 22 Message 64 Sat Jul 14, 1990 R.LOWREY at 00:17 CDT I'm a sorta-novice C programmer on the ST; I program for a living in the IBM mainframe world and can generally figure most things out but I'm have a small problem.... I have a program that has data files that need to be read in and I have that working fine; what I'd like to do is to be able to place the program in any directory on any drive and have it look for the data files in the same directory---how do you determine the disk & path that your program executed from? I'm programming in Laser C and I have no problem setting paths, disks, etc. but for the life of me, I can't figure out how you determine the original execution path... Any help for this silly problem will be appreciated... Robert L. ------------ Category 3, Topic 22 Message 65 Sat Jul 14, 1990 J.EIDSVOOG1 at 01:59 PDT Robert, If all you want to do is load files from the directory containing your program, the easiest way is to simply use the filename only. That is, just pass "DEFAULT.DAT" (or whatever) to Fopen(). If you really need to determine the path from which you were executed you must do a Dgetdrv() to get the current drive (0=A) and Dgetpath(pathbuf,0) to get the current (default) path. John ------------ Category 3, Topic 22 Message 66 Sat Jul 14, 1990 R.LOWREY at 23:48 CDT Hmmm...I was doing a Dgetdrv/Dgetpath but it didn't seem to work.... I'll try the filename-only method and see if that works better; I must be over- complicating this horribly. Now I'm off on another program and have finished it except for one small problem: the program is a desk accessory; the first thing the DA does is to do a fsel_input, then read a file, then display a dialog box. Everything works OK if there are NO windows on screen when the DA is selected; if there are windows, everything works except when the dialog box has been displayed, the windows behind it "refresh" and wipe it out.....I realize that this has something to do with the initial fsel_input, but what am I missing? Is there something tricky about using it from a DA? It's like the redraw from the fsel_input has not "caught up" with things until my dialog box has been drawn; do I have to delay in the DA to give AES time to "catch up"? Thanks for the help; I'll go try it out! Robert L. ------------ Category 3, Topic 22 Message 67 Tue Nov 27, 1990 T.GIANNETTE [Sparky(Oahu)] at 23:06 PST For beginners only! Any new programmer wanting to learn the basics of programming is probably best fitted if using a version of PASCAL which does not require you to label each and every line. I have had my share of programming and have given it up for other more lucrative options. Like using the programs you guys write. ------------ Category 3, Topic 22 Message 68 Fri Dec 07, 1990 R.GOFF at 22:09 PST Does anyone know where I could pick up some example code in BASIC for a text editor in a window? I would prefer HiSoft, but can translate. Bob ------------ Category 3, Topic 22 Message 69 Wed Jan 16, 1991 W.CHOW [wing] at 01:28 EST i want to write my own ram tester question, where or what do i look at for total memory and lowest address where i can read+write to, so i can test my bits. ------------ Category 3, Topic 22 Message 70 Fri Jan 18, 1991 M.L.HANSON at 20:27 CST If you are in supervisor mode you can start at address zero. The last byte plus 1 is specified by the long word at address $42E. I would expect errors to occur when you change certain (unkown) addresses in the code and tables for the OS. You can identify these by running your test program and then exclude them in a revised version of your program. ------------ Category 3, Topic 22 Message 71 Sun Jan 20, 1991 DOUG.W at 15:29 EST It's safer to turn off all interrupts (set the IPL to 7), and when you're done testing a location, you should restore the data that was there. Also, you need to skip over the actual test routine in memory, or have a duplicate copy and switch between them as needed. --Doug ------------ Category 3, Topic 22 Message 72 Sat Feb 02, 1991 D.ELSON1 [ |> Axe-man ] at 09:21 MST Hello People, I need some Info on how the Item Selector returns information. I can use it to get a file opened, but can't seem to get at the path or file name for use inside my programs. Are there specific variables where this info is returned? My compiler is VERY vague on the subject. Thanks, David ------------ Category 3, Topic 22 Message 73 Sun Feb 03, 1991 R.GOFF at 10:23 PST What language are you using? Most that I know of require you to pass the selector function at least one string where it will put the result. Bob ------------ Category 3, Topic 22 Message 74 Sun Feb 03, 1991 D.ELSON1 [ |> Axe-man ] at 21:28 MST Bob, I'm trying to use the 'fsel_input' function of lattice c. The call: error = fsel_input (path, filename, &button); where: WORD error > return code ( 0 if error ) char *path > buffer containing path and wildcard specs char *filename > buffer containing filename to display WORD &button > exit button ( 0=cancel, 1=ok ) "The file selector library returns the results of this interaction between the user and the dialog to the application." The above is nearly verbatum from the manual. To an extent it is quite correct. When my program calls the selector. the file selected is indeed passed back. The problem is, I don't know how. I need to get this information out, so I can access the file date etc. and don't know where to look. I would assume that as the selector is a ROM routine in the machine, this call would be built much the same in any language. I've tried fiddling with the path and filename parts of the call on return and as yet have no success. I may be looking in the wrong place, the wrong way, or the wrong reality ;^). Any thoughts? David ------------ Category 3, Topic 22 Message 75 Mon Feb 04, 1991 K.BAD [Ken @ Atari] at 04:00 EST David, After allowing the user to select a file with the file selector, you have to paste together the pathname and filename from the fsel_input returns. Don't forget to check the 'button' parameter to see if the user cancelled the selection! Once you have put together a full path\filename, if you need more specific information on the file (such as the size, date, etc.) then you need to use the GEMDOS Fsfirst() call to get that information. All that fsel_input() gives you is is the path and filename. ttfn... (*ken*) ------------ Category 3, Topic 22 Message 76 Thu Feb 07, 1991 D.ELSON1 [ |> Axe-man ] at 04:56 MST Thanks Ken, I assume you mean the selector changes the path and filename strings on return. I'll try it out. have fun at GEnie HQ. David ------------ Category 3, Topic 22 Message 77 Mon Feb 11, 1991 JWEAVERJR at 14:17 EST He did. ------------ Category 3, Topic 22 Message 78 Fri Feb 15, 1991 K.BAD [Ken @ Atari] at 04:17 EST Indeed, I did... on both counts ;) Any luck with the file selector, David? (*ken*) ------------ Category 3, Topic 22 Message 79 Thu Feb 21, 1991 JLS [John STanley] at 04:53 CST D.ELSON1, Did you ever get an answer to your question about how fsel_input returns the path and filename? ------------ Category 3, Topic 22 Message 80 Sat Feb 23, 1991 D.ELSON1 [ |> Axe-man ] at 07:51 MST Ken and John, I have What I think is the answer ( thanks Ken ) but haven't had a chance to experiment yet. I've got to 12 hour days seven days a week to get two new radio stations up and running in Toronto and have been getting home with a head full of over cooked mush lately. Thanks for asking and I'll let you know how it goes as soon as things settle down enough to work on it. David ------------ Category 3, Topic 22 Message 81 Sun Feb 24, 1991 M.ABREU [Abe] at 11:04 EST D.ELSON1 - I'm a C rookie who's been playing with getting the item selector to work via a function I can use in a lot of future code. If you'd like to see it I can supply it here in the topic. Let me know. ------------ Category 3, Topic 22 Message 82 Sun Feb 24, 1991 D.ELSON1 [ |> Axe-man ] at 17:00 MST Abe, Sure, I'd like to see it. Time being the way it is, I can use all the help I can get. Much appreciated! David ------------ Category 3, Topic 22 Message 83 Sat Mar 02, 1991 M.ABREU [Abe] at 14:08 EST David, check file 18407 in the library. It's just source code. ------------ Category 3, Topic 22 Message 84 Mon Mar 18, 1991 D.DAVIS42 at 20:37 EST Could someone please explain to me, down & dirty, keyboard scan codes and what they are used for? It would be greatly appreciated. I have had a bit of experience in C on UNIX systems and would like to write some things for myself on the ST. Thanx Darrel ------------ Category 3, Topic 22 Message 85 Tue Mar 19, 1991 H.PARSONS4 [MEGABYTE] at 00:21 CST D.DAVIS42, Basically, keyboard scan codes are used to detect which key is pressed. I know that this may sound useless, since there are various ways to detect keyboard input; however, there may be times when you want to know the whether the "2" key on the upper row of keys was pressed, or if it was the "2" key on the keypad. The keyboard scan code can tell you exactly which key was pressed. Herb ------------ Category 3, Topic 22 Message 86 Tue Mar 19, 1991 D.DAVIS42 at 20:43 EST I guess I thought they had to do with interrupts, like monitoring to see a certain key has been pressed at any time. I want to write a simple text editor for myself. I know how to handle a buffer, file I/O , etc., in C but I don't know how to monitor constantly to see if special keys have been pressed. ------------ Category 3, Topic 22 Message 87 Wed May 01, 1991 B.VARGO at 05:53 EDT How do you open a file to append in ST Basic. The command: Open "A",#2,File$: Deos not seem to work in ST Basic, thi ks. :Open "I or O",#2, File$: Using an IBM PcBasic book, all other command Seem real close??? ------------ Category 3, Topic 22 Message 88 Thu Jun 27, 1991 C.WALNUM1 [CLAY] at 00:33 EDT ------------ Category 3, Topic 22 Message 89 Sat Jun 29, 1991 R.WATSON15 [Wayne Watson] at 12:39 EDT Maybe this will fit here. I am starting to learn C some. I bought a book that teaches C. It is very informative and has helped a lot. I have programmed a lot in GFA and have programmed some very complicated code in GFA. The book lacks technique and such. Is there some references that I can pick up (preferably ST specific) that will help me a little more in getting into C programming? If so, can you supply the information? ------------ Category 3, Topic 22 Message 90 Sat Jun 29, 1991 D.CHARTER at 14:30 EDT Wayne, There is a book out called "C-Manship Complete" by Clayton Walnum. It is published by Taylor Ridge Books,PO Box 48, Manchester, CT 06040. Phone 203-643- 9673. This is probably THE BEST book on C programming the Atari ST computer. The book is a compilation of articles he wrote for ST-Log on C programming. It teaches C programming, while demonstrating techniques of how things are done with GEM. I recommend this book. (How'd I do Clay). Duane ------------ Category 3, Topic 22 Message 91 Sun Jun 30, 1991 C.WALNUM1 [CLAY] at 02:17 EDT Duane: You did great! Thanks for recommending the book and saying such nice things. ---Clay ------------ Category 3, Topic 22 Message 92 Sat Jul 06, 1991 D.DAVIS42 at 21:22 EDT I've got an easy question for some C guru. How do I print or send stuff to the printer WITHOUT using Cprnout/Cprnos commands. Can I define prn (or lpn) to be of type FILE and use open or fopen? Any help? Thanx. ------------ Category 3, Topic 22 Message 93 Sun Jul 07, 1991 S.YELVINGTO2 [Steve] at 17:43 EDT D.DAVIS42: That depends on the compiler. Some C compilers, such as Sozobon, are set up with FILE *stdprn already opened, just like stdin and stdout. Others, such as Mark Williams, let you open such a file with stdprn = fopen("prn:","wb"). See your documentation and/or stdio.h. ---- Steve Yelvington Marine on St. Croix, Minnesota ------------ Category 3, Topic 22 Message 94 Mon Jul 08, 1991 DARLAH [RT~SYSOP] at 00:00 EDT Steve: Thank you for all the sharing you have done in the library. saw your name and wanted to let you know how I felt. ------------ Category 3, Topic 22 Message 95 Mon Jul 22, 1991 M.LEE3 at 22:47 EDT Can anyone recommend as where to begin in looking for a good programming software/language? I have had my computer for years and still not know exactly how it works. Thanks, Mike L. ------------ Category 3, Topic 22 Message 96 Tue Jul 23, 1991 M.L.HANSON at 07:28 EDT Mike - I would recommend Pascal. It is _the_ language of choice throughout the world for teaching computer science. Pascal is to computer languages as English is to natural languages. With a bit if strain you can see a similarity between a program and the language of mathematics, English and logic. The best way to decide if this is true or not is to get hard copy of some samples of Pascal and say C and BASIC and assembler and FORTRAN. Look at them side by side. Which one looks the _least_ like they came from a a Rosetta stone? Given equal quality of programming, Pascal looks like the least like gibberish. There are a lot of samples of Pascal source code in the libraries and also samples of assembler, C and BASIC, although probably less of them. Modula is a direct descendent of Pascal and insofar as the _language_ is concerned is probably an equally good choice. Search on keywords of pascal, c (I hope that works) and basic to find sample code. Given a language, you still need a compiler package. The only Pascal for the ST that I have used is Personal Pascal. You can not expect any meaningfull support or enhancements down the line, but it is remarkably bug free and usable as it is. __However, in my opinion, level 2.x requires a hard disk to be usable!__ If you don't have a hard disk, try to find an old copy of level 1.x. It is very usable with a RAM disk. I have no reason to think that some other (e.g., Prospero) Pascal compiler isn't good too, I just haven't tried any others. The other languages all have some area where they are better than Pascal. C produces more compact code - but I attribute that to quality of programming behind the 'package' than an innate language advantage. GFA BASIC is 'more powerful' much like a Chinese icon (one of 4000 or so) is more powerful than English text (with 26 icons). And assembler is faster, the ultimate in both speed and compactness. And also difficulty of programming. I'm looking forward to seeing what language you actually use in your first upload! -Merlin ------------ Category 3, Topic 22 Message 97 Tue Jul 23, 1991 M.LEE3 at 23:56 EDT Merlin, Thanks for the recommendation!! I've always worked with programs but still, sometimes I wished I'd have it my way! Maybe this will start to change. Besides the point I'm a die hard Atarian and I'd like to support it in some ways. Thanks, Mike L. ------------ Category 3, Topic 22 Message 98 Wed Jul 24, 1991 S.YELVINGTO2 [Steve] at 03:09 EDT I'd agree with Merlin that Pascal is a fine choice. I ``learned'' with C, because I didn't want to buy a compiler that I might not ever use, and C was the only free compiled language at the time (ST BASIC and Logo are interpreted, not compiled). But I did a LOT of reading about Pascal and the theories of Dr. Niklaus Wirth before I started writing in C. It helped a lot. I don't know that I'd agree that programming will help you learn how a computer works. Programming is more of a matter of understanding how to plan -- how to think ahead, how to design -- than it is a matter of understanding computer innards. High-level languages like Pascal, C and structured BASICs try to insulate you from the ugly truth of the microprocessor. They don't always succeed, but they usually do a good job of it. Assembler puts you into direct contact with the CPU. Just don't expect to get any work done. :-) If you decide to go with Pascal, you should have no trouble finding good books at your public library. One rather fun book you should try to find is ``Elementary Pascal'' by Henry Ledgard and Andrew Singer (Vintage Books, 1982). In the book, Sherlock Holmes and Dr. Watson solve a series of mysteries by (of course!) logic -- assisted by Charles Babbage's Analytical Engine, programmed in Pascal. Never mind that the history is all mixed up (Babbage's engine was never built). It's a painless and entertaining way to absorb some elementary Pascal concepts. ------------ Category 3, Topic 22 Message 99 Wed Jul 24, 1991 M.L.HANSON at 08:13 EDT If you want to learn how computers work, the Time/Life series is excellent for a novice. - Merlin ------------ Category 3, Topic 22 Message 100 Thu Jul 25, 1991 M.EVERHART2 [MIDIMIKE] at 03:35 EDT I'm also interested in learning programming - there was another company producing a version of Pascal besides Personal Pascal, I just can't remember who - anyone else remember? ------------ Category 3, Topic 22 Message 101 Thu Jul 25, 1991 J.NESS [Jim] at 20:03 EDT Midimike - Actually, there are now 3 Pascals. ICD's Personal Pascal, Prospero Pascal, and HiSoft's new offering, Hispeed Pascal (supposedly Turbo Pascal compliant). In terms of support, Prospero is not online (I suspect they are not even marketing the product anymore), ICD is online but refers Pascal questions to their phone support people, and HiSoft is online but has no history yet in supporting their Pascal. -JN ------------ Category 3, Topic 22 Message 102 Sat Jul 27, 1991 M.LEE3 at 01:00 EDT Well I didn't mean learn exactly how a computer works, just how to get it to work my way. I agree that it is really not something anyone can know exactly... Mike L. ------------ Category 3, Topic 22 Message 103 Sat Sep 07, 1991 S.LAUGHLIN at 01:44 EDT I do a lot of artwork on the computer but frequently find myself limited by the paint programs they have available for the ST. I want to learn enough about paint programs to be able to write my own. I understand a little of the C language ( about a thimble full ) but I have no idea where to start, what books to get, what compiler etc. If anyone could point me in the right direction I would greatly appreciate it. ------------ Category 3, Topic 22 Message 104 Sat Sep 07, 1991 M.L.HANSON at 02:49 EDT As a starter, get the two books by Leemon on AES and VDI, especially the on e on VDI but preferably both. Can't recommend a book on C. The Leemon books are mentioned several places on the board, including mfr, price, ISBN #, etc. Look around. ------------ Category 3, Topic 22 Message 105 Mon Sep 09, 1991 C.WALNUM1 [CLAY] at 23:22 EDT I can recommend a book on C. It's called C-MANSHIP COMPLETE. But I won't say too much more about it, considering I'm the author. Suffice it to say that it'll teach both C programming and GEM programming. ---Clay ------------ Category 3, Topic 22 Message 106 Sat Sep 28, 1991 S.LAUGHLIN at 20:23 EDT Well I rewrote my binary function. Its a lot shorter now and it works. I still don't understand why in the first version it was changing the variable I sent as a paremeter, e.g, if unsigned i = 32767 before the function, its value would be 255 after the function as if it was coverted from an unsigned interger to an unsigned character. Although I am a lot less embarrased to show the code from the second version, I would like to know how the first version was changing the variable. I've got a feeling there is something in the conversion rules I don't understand and it could account for some bombs later. Both versions follow : /* binary : convert a number to a binary string 1st version */ void binary(x,s) unsigned x; char s[]; { int i; unsigned bit_position; /* unneccessary variable */ for(i = 0; i < 16; ++i) s[i] = '0'; if(x > 32767) /* This test is rediculous */ x = 0; bit_position = 16384; /* all this to see if there is */ for( i = 1; i < 15; ++i){ /* a 1 are a zero in the bit */ if( x >= bit_position){ /* column. I found ( x & 1 ) */ s[i] = '1'; /* will tell you that */ x = (x - bit_position); } bit_position = (bit_position >> 1); } if(x == 1) s[i] = '1'; s[i + 1] = '\0'; } /* binary : convert a number to a binary string 2nd version */ void binary(x,s) unsigned x; char s[]; { int i; s[16] = '\0'; for( i = 15; i >= 0; --i){ s[i] = (x & 1) ? '1' : '0'; x >>= 1; } } I asked this question first in topic 31 but I think this topic is more appropriate. Thanks Shawn ------------ Category 3, Topic 22 Message 107 Sun Sep 29, 1991 J.FRANDOLIG [John F] at 10:02 EDT Shawn, I'm not sure what the question was, but I ran your previous example through the GNU compiler and it seemed to work fine - the variables value wasn't affected. What compiler were you using? Just thought I'd mention it. ------------ Category 3, Topic 22 Message 108 Sun Sep 29, 1991 W.WALKER14 [MOOG] at 22:49 EDT Can anyone tell me how to rename a file using "C" function calls??? I am using Mark Williams C Thanks Mark ------------ Category 3, Topic 22 Message 109 Mon Sep 30, 1991 S.YELVINGTO2 [Steve] at 00:55 EDT Moog-- What you need is a GEMDOS function, Frename. See page 231 of the MWC manual. The syntax is: Frename(0,oldname,newname) .. where oldname and newname are pointers to arrays containing the old and new filenames. The names may either be full pathnames, or simple filenames. In the latter case, the current directory and folder is assumed. A couple of warnings: -- The new filename must not already exist. -- Both filenames must refer to the same logical drive. If you need to rename A:\FILE1.C to B:\FILE1.C, don't use Frename; you'll have to copy the file and delete the original. ------------ Category 3, Topic 22 Message 110 Mon Sep 30, 1991 W.WALKER14 [MOOG] at 22:50 EDT Thanks Steve Boy do I feel dumb! I went for months thinking that MWC had missed a basic function. ------------ Category 3, Topic 22 Message 111 Wed Oct 02, 1991 S.LAUGHLIN at 21:25 EDT John F. --- Thanks for responding. I am using the Sozobon public domain compiler. I found my mistake and it was in the main function that I compiled my first version with. I had arrayed the bin[16] instead of bin[17] leaving no room for the null character. Now if I can just figure out how that changed 32767 into 255 ... . Thanks for the help. Shawn ------------ Category 3, Topic 22 Message 112 Sat Oct 05, 1991 S.LAUGHLIN at 04:07 EDT How do I write this macro so Sozobon C will accept it? #define show(a) printf(#a " = %d\n",a) It doesn's seem to like that format. Thanks in advance. Shawn ------------ Category 3, Topic 22 Message 113 Sat Oct 05, 1991 S.YELVINGTO2 [Steve] at 15:29 EDT Shawn: You can't use that macro, unless Ian has put something into HCC that I don't know about. You can do something useful that might help, but you can't do THAT macro. Sozobon is a K&R compiler -- also known as ``Classic C'' -- with some ANSI extensions, but it is not an ANSI-conformant compiler. The operation you describe is an ANSI preprocessor feature. I don't think it's among the ANSI features that have been added to Sozobon. In your example, the unary # is an ANSI ``stringization'' operator that is followed by the name of a formal parameter. When you do this: show(handle) it is expanded to show("handle = %d\n", handle) ... which is a good way to trace a variable if you're bear-trap debugging a program. Unfortunately, to do this you need GCC (and therefore lots of RAM and lots of hard disk) or one of the newer commercial compilers ($$). You CAN do this with Sozobon C: #ifndef _STDC_ #define show(a) printf("FILE = %s LINE = %d VARIABLE = %d",\ __FILE__,__LINE__,a) #else /* original macro */ #endif ... which should make your code portable to an ANSI compiler. The __FILE__ and __LINE__ special macros are not Classic C, but they ARE supported by Sozobon. This won't tell you the name of the variable you're tracing, but it will give you enough information to figure it out by comparing the program's output with the original code. -- Steve Yelvington, Marine on St. Croix, Minnesota steve@thelake.mn.org (In winter we walk on water) ------------ Category 3, Topic 22 Message 114 Sat Oct 05, 1991 S.LAUGHLIN at 20:33 EDT Steve, Thanks again. The macro you provided ought to do it. The programs I'm learning on are very short so it shouldn't be a problem figuring what variables are what.I've a lot of friends in the Marine band stationed at the Naval Support Activites Unit down here. Shawn, a "WHO DAT" Saints fan in New Orleans ( In the fall we shut out Vikings !) ------------ Category 3, Topic 22 Message 115 Thu Oct 31, 1991 JLS [John STanley] at 01:30 EST S.LAUGHLIN, >... I found my mistake and it was in the main function that I > compiled my first version with. I had arrayed the bin[16] instead > of bin[17] leaving no room for the null character. Now if I can > just figure out how that changed 32767 into 255 ... . Shawn, you just answered your own question... If you look carefully at the original program, you'll find that the variable you used to hold 32767 was the next variable in memory right after the bin[] array. When your 1st version of the binary() function wrote a '\0' (zero byte) to the 17th byte of the bin array (that only had room for 16 bytes), it zeroed the high order byte of the 16 bit integer thus converting 32767(0x7FFF) into 255(0x00FF)... Happy? ... JLS ------------ Category 3, Topic 22 Message 116 Thu Nov 07, 1991 T.KUNICH1 [TED] at 03:52 EST Hello, I have a simple (or maybe a not so simple) question about programming in Personal Pascal. What I need to do is simply toggle the ST from medium resolution to low resolution and vice-versa. Is there a way to do this within Personal Pascal? I had an idea in mind to have two desktop files, rename one to DESKTOP.INF and perform a warm/cold boot. Is there a easy way to do a cold/worm boot in PP? The reason I want to do this is because I want to toggle between the two resolutions from within GOGOST (a menu program for executing programs) so I can run low resolution games easily. Thanks for ANY input, Ted ------------ Category 3, Topic 22 Message 117 Thu Nov 07, 1991 M.L.HANSON at 20:33 EST Ted, To do a warm boot you must execute a RESET instruction, one of the instructions in the 68,000 repertoire. To do this you must be write an assembly language procedure and link it with the Personal Pascal program. From your question, I would guess you don't have an assembler so I wrote a brief routine, tested it, and sent it to you via E-Mail. Include the _file name_ (not the entry point name) as an 'additional link file' so the PP linker can find it. It's easiest if you put the .o file in the same directory as the linker. To do a cold boot, I would proceed as follows. There are several 'magic' values the OS checks when deciding whether to do a warm or a cold boot. These are long words located at $420, $426, and $43A. Change these with a 'POKE' to any value that strikes your fancy. The chance that you will guess the magic value is pretty slim. Then issue a reset instruction. - Merlin ------------ Category 3, Topic 22 Message 118 Thu Nov 07, 1991 T.KUNICH1 [TED] at 22:11 EST Merlin, Thanks for the help, I appreciate it. But, I am having troubles getting the linker to link you code correctly. I have PP 2.02 but with no docs (PP was given to me by a friend long ago). The file that was attached to the E-mail was called T.KNC. Renaming it did not help either. I am also confused on what is the command for doing the warm/cold boot. This program has some other duties that need to be performed prior to the boot. Is you code a procedure, a command or a function? Please let me know. ------------ Category 3, Topic 22 Message 119 Thu Nov 07, 1991 M.L.HANSON at 23:05 EST Ted... I don't understand that name. The file was caled RESET.ARC as I recall. It's an .ARC containing asm source (.S), an object module (.O) to be used as an external procedure, the .PAS test program, and the compiled and linked .PRG - just to prove it works. I'll send another copy and then sign off and de-arc the copy I have and try it. If no further post here, it worked OK for me. I did take the precatuion of listing the files in the .ARC and that came out OK but I didn't actually de-arc which I would do for a library upload. The comand to do a warm boot is to call the external procedure in the .O module. To do a cold boot, precede with the little dance I described in my earlier upload. .. Merlin ------------ Category 3, Topic 22 Message 120 Sat Nov 09, 1991 B.STOREY [Bill] at 08:17 EST When I was programming the 8-bit, I found the Compute magazine books "Mapping the Atari" Vol 1,2,(and 3?) indispensible. Those books told me where to peek and poke to get greater use from the computer. I hav not seen anything like that for the STe. Does anyone know if there ARE any? If anyone has some they want to sell, drop me some e-mail. B.STOREY ------------ Category 3, Topic 22 Message 121 Sat Nov 09, 1991 S.YELVINGTO2 [Steve] at 13:27 EST Specifically for the STE? You're out of luck, unless you read German. The Profibuch is supposed to be good, but it hasn't been translated, and probably won't be. On the ST in general, you're not SUPPOSED to peek and poke into memory locations. The operating system has functions that provide higher-level access to the machine's capabilities. There are a couple of dozen documented system variables that you can mess with (in supervisor mode), but many of them can be examined/modified using xbios functions. I have some books that provide generally reliable information, but they're all out of print: The Mark Williams C manual, ``Atari ST Application Programming'' by Pollack and Weber, and ``Atari ST Internals'' from Abacus Books. ------------ Category 3, Topic 22 Message 122 Tue Mar 03, 1992 D.DEBOE at 23:31 EST Today's queston: Is there a 'best' C compiler? I've been writting with GFA Basic for many years and would like to try something a bit more powerl. However, good docs is a definite consideration. I've seen a lot of great stuff done with GFA, but I myself have no idea of how to recreate them. I need some tips and inside info! Well, that's actually two questions, isn't it? A good C and a good source of info on the internals. Opinions anyone? Many Thanks David DeBoe soon to be an internationally famous software author /s ------------ Category 3, Topic 22 Message 123 Fri Mar 20, 1992 K.MILLER69 [Kyle Miller] at 01:51 EST To anyone, I am sure this question was probably asked before somewhere here on GEnie, but I don't have the $$$ to find it. I was wondering what TOS uses RAM for. I know it needs 32k for the screen and some for buffer. What happens to the rest? My curosity into this was raised when I read in a review of Wordflair ][ in ST Informer. The reviewer said the new TOS takes 300k of RAM. What is in the 300k? I seem to remember reading somewhere that the desktop portion of TOS loads into RAM and acts as an interface to the real work horse of the operating system, TOS. Is this it? I know this sounds like a basic dumb question, but I am sure someone here has the knowledge to answer this. Thanx!!!! ------------ Category 3, Topic 22 Message 124 Mon Mar 23, 1992 R.WATSON15 [Wayne Watson] at 23:20 EST I was writing an Assembly routine to call from within GFA Basic. Now, the problem is, when I use 'beq.s subroutine' to go to a subroutine and I use 'rts' at the end of the subroutine, it seems as though it is exiting out of the program back to GFA Basic. If I use 'JSR or BSR' and RTS, there is no problem. Is there another way to return back to the calling area when using "beq.s" that is the equivalent of RTS but, not cause it to exit. I will upload the source if that will help explain things better. Thanks. ------------ Category 3, Topic 22 Message 125 Tue Mar 24, 1992 W.PARKS3 [Dr. Bob] at 00:09 EST Wayne, Sorry, but BRANCH and JUMP-TO-SUBROUTINE are different. BRANCH is a JUMP-and-don't-come-back-here instruction whether it's BEQ BEQ.S, BNE BCC, BPL whatever. You'll simply have to split the operation across a couple of lines of instruction: bne.s .dontgoyet bsr dosubroutine .dontgoyet ;rest of your code goes here Bye: Dr. Bob ------------ Category 3, Topic 22 Message 126 Tue Mar 24, 1992 EXPLORER [John J.] at 14:57 EST Wayne: To clarify, the BEQ/BNE, etc.-series instructions simply add a precalculated offset to the 68000 program counter, causing a "jump" to take place (or not take place) depending on the value in the status register (last calculation resulted in zero, etc.). They're approximately equivalent to the BASIC statement: IF (condition) THEN GOTO (location) The RTS instruction works by pulling a return address off the stack, updating the stack pointer, and branching to the address. Thus the normal, subroutine "call-return" procedure involves (during the "call" phase) first pushing a return address onto the stack, then (when the RTS is encountered), pulling that return address back off the stack and using it to return to the instruction following the "call." But the BEQ instruction doesn't put a return address on the stack (it's just a "blind" GOTO). So when your subroutine encounters the RTS, the return address it gets from the stack is (apparently) the one placed there by GFA's "call machine language module" function (effectively a JSR) as a return destination following module execution. So your program returns to BASIC, instead of jumping back into its own code, following subroutine execution. In a sense, you're lucky -- if you'd been doing any stack-handling to speak of, chances would be good that the return address "found" by RTS wouldn't be meaningful, branching your program off into the ozone, someplace. (grin) What you need is a BSR instruction (BRanch to Subroutine), which _does_ place a return address on the stack. But since BSR has no "decision-making" capability, you'll have to break up the instruction over several lines, as Dr. Bob demonstrated. This involves inverting the conditional evaluation (from BEQ to BNE) so that execution AVOIDS branching to the subroutine if the condition is NOT equivalent to zero. ------------ Category 3, Topic 22 Message 127 Tue Mar 24, 1992 R.WATSON15 [Wayne Watson] at 22:53 EST Thanks. That is what I was afraid of. I wish the rest of Clay's books were available. He got me started and now I want to dive right in but... Thanks again. ------------ Category 3, Topic 22 Message 128 Wed Apr 01, 1992 R.GLOVER3 [Rob] at 22:48 EST Can someone give me some info on how to write a terminate-stay-resident program in either GFA Basic, C, or assembler? Nothing fancy, but something that won't step on other stuff (naturally). Thanks! Rob ------------ Category 3, Topic 22 Message 129 Thu Apr 02, 1992 M.L.HANSON at 08:54 EST There is a corner clock in the library that is TSR and includes assembler source code. I can't remember the name but it may have had 'mono' somehow embedded. I learned how to do TSRs using that as a basis. The idea of using anything other than asm for such a program sounds like a bad idea to me. -Merlin ------------ Category 3, Topic 22 Message 130 Sun Jun 07, 1992 J.SCULL at 22:49 EDT I would like to read the program of "ST Talk" to determine what command is used to sent to the Volksmodem. How do I do that and/or how can I find out? Thanks. ------------ Category 3, Topic 22 Message 131 Fri Jun 12, 1992 T.HARRIS17 [Land Shark] at 00:21 EDT I have a little question. GNU C and GNU G++ are programs I been seeing for a while on the board. What I like to know is first what is required for each of these programs to run? Second, what is the difference between the GNU C and the GNU G++? ------------ Category 3, Topic 22 Message 132 Fri Jun 12, 1992 S.YELVINGTO2 [Steve] at 04:19 EDT Land Shark -- GNU C (GCC) is a C compiler. G++ is a C++ compiler. They're different languages. C++ is (very loosely) based on C, but it's not a procedural language like C; it's an object-oriented language. As for what ``object- oriented'' means, well, that depends on who you ask. :-) If you want to do much with GCC you'll need a 2MB machine with a hard drive. G++ would be happy on a 4MB machine. If you don't have that much RAM and still want to work with C, download Heat and Serve (Sozobon) 1.33i. I don't know of any C++ for the ST other than G++. Comeau Software is working on one, but it's not available yet. ------------ Category 3, Topic 22 Message 133 Thu Jul 23, 1992 D.DAVIS42 at 18:52 EDT Hi all.. I was playing around with the serial port, using a small program as a dumb terminal, and I started thinking... What is "terminal emulation"? I know that it is a system whereby my terminal knows how to handle control characters of different types of displays, but how would I make a program emulate "vt- 100", etc. Can someone suggest a book that would explain this for me? Thanks ------------ Category 3, Topic 22 Message 134 Fri Jul 24, 1992 T.GIRSCH [T.J.] at 00:41 EDT I can't really suggest a book, unfortunately. Basically, terminal emulation is the process by which special ascii codes are mapped to specific functions. This differs from term to term. (e.g. "Clear Screen" codes for VT-100 are not necessarily the same as "Clear Screen" codes for a KERMIT terminal.) Sorry I can't help any more... -TJ ------------ Category 3, Topic 22 Message 135 Fri Jul 24, 1992 EXPLORER [John J.] at 10:57 EDT To D.DAVIS42: In English, "to emulate" means to take on the external characteristics of another person with a high degree of fidelity and spiritual investment. In modern computing, the term is most commonly used to describe situations where software (usually running on a general-purpose microcomputer) is engineered to duplicate the functions and characteristics of dedicated or semi-dedicated hardware. "Terminal emulation" is the design of software that duplicates the functions and characteristics of a standard hardware terminal, such as a DEC VT-100. Years ago, back at the dawn of the information age, people communicated with mainframe computers using a wide variety of "terminal devices." The first terminals were teletypes, which accepted input via a keyboard and produced output on a line-printer. Later, these were supplanted by video terminals -- initially "dumb" terminals whose scrolling screen displays duplicated (emulated) the functions of a teletype printer. When microprocessors began appearing, they were eagerly adopted by terminal manufacturers. Instead of driving terminal screens with expensive, low-level hardwired logic, it became cheaper to EMULATE this logic, using a microprocessor and some ROM software. As time wore on, more and more of the functions of dedicated terminals were moved into software -- to the extent that today's dedicated terminal is essentially a task-dedicated microcomputer. At the same time, the presence of microprocessors in dedicated terminals has encouraged the design of more "intelligent" and complex terminal standards -- to the point where most of today's "hot" terminal standards (X Terminal, etc.) could not possibly be implemented in hardware alone. Indeed, a basic X Terminal is more similar to an ST than it is to one of the clunky, old TTYs of yesteryear: it knows about windows, mice, etc. Early microcomputer types also experimented with emulation -- initially in the course of developing protocols for driving screens and printers. For example, screen output functions built into the Atari ST's operating system are designed to EMULATE functions of a DEC VT-52 terminal. You can control the cursor's position, current printing color, and other nifty output features, simply by writing VT-52 control-character sequences to the ST screen, via Cconout() or other TOS-level screen-write functions. Doubtless, this is exactly what your "dumb terminal" program is doing; and as a result, it's not _really_ a dumb terminal at all -- it's actually emulating a VT-52, courtesy of the ST's screen-driver subsystem, and the VT-52 -- what with its color capability and all -- is actually a pretty _smart_ terminal, as first- generation terminal standards go. (If you wanna see a DUMB terminal, check out what happens when you build a serial I/O shell around an IBM PC's basic screen drivers!) Anyway, nowadays, the distinction between what's "hardware" and what's "software" has gotten so blurry, and terminal standards have developed that require so much microprocessor power, that it's useful to generalize and start thinking of "terminals" as virtual devices. The important thing about a terminal "standard" is simply that it's a _standard_: it defines precisely the characteristics of a device in response to input (from host and user). In most cases, you can assume that a reasonably-powerful computer, such as the ST or TT, has sufficient hardware flexibility to express virtually any "terminal standard," given clever programming (sure, there are exceptions). Having gone so far as to redefine "terminal standard" in terms of virtual devices, I should take the extra step and explain that there are many reasons why one might want to create a terminal emulation that doesn't bear any direct relationship to telecommunications, or to using your computer to communicate with a remote host. For example, modern implementations of the Unix operating system can be set up to address a variety of different virtual terminals -- essentially independent processes (programs executing in a multi-tasking environment) that control the screen, keyboard, mouse, and other I/O devices. Different Unix applications may actually require that a certain virtual terminal be installed, or that both a certain virtual terminal AND a certain user-interface system BUILT on that virtual terminal be installed, before they can operate. Indeed, your typical single-user Unix workstation implementation, nowadays, has the Unix kernel running under OSF/Motif or Open Look or something else (the user-interface and application environment), running under XWindows or something similar (the virtual terminal). Ultimately, the whole question of "what's a terminal?" as opposed to "what's an environment manager?" or even "what's an operating system?" is becoming increasingly blurred. Even hardware can be emulated, nowadays -- Darek Mihocka's GEMulator, for example, is a software-based system that lets a 386- or-better IBM PC-compatible run ST software. And everybody knows about Spectre. I fully expect that within ten years or so, most of what we now see as "the intrinsic limitations of hardware" -- i.e., "the wall" -- will be expressed entirely in software, and we'll have added a couple of new levels to our increasingly-layered concept of the virtual machine. By the year 2000, you'll be able to go out and buy a computer ... some hardware that can do virtually anything ... And on this hardware will run many, many layers of "personality." Maybe at the lowest level, right on top of the BIOS, there'll be three or four layers of hardware emulation -- maybe several, running concurrently. Then the operating- system emulations, the environment-manager emulations, the terminal emulations, and your applications. You'll be able to run "ST," "PC," "Macintosh," and "Unix" apps, side-by-side, along with applications for machines not-yet-developed ... or even for "machines" that are never expressed in hardware, but are designed in an entirely virtual way. Apple and IBM are currently working on an OS project they call "Pink," which is likely to be hardware-independent. I'd be very much surprised if we didn't see "Windows for Mac" in the next three years, or something very much along those lines. Meanwhile, in answer to your question "how would I make a program emulate VT- 100?" -- it's pretty easy. You start by finding a VT-100 specification, either by phoning DEC or writing to ANSI or IEEE or CCITT, or maybe just your nearest university or Unix installation ... Somebody's gotta have it, and you shouldn't have to spend much more than postage or xerox charges to acquire it. Same goes for most other terminal standards. What you'll end up with is from 3 to 50 pages of information that more or less completely describes the behavior of a VT-100 terminal. Among other things, the docs will tell you: 1) What the hardware can do: i.e., how many colors it can display, what its screen resolutions are, how many characters across and down in each of its various text modes, details of any mixed modes, how many keys on its keyboard, what ASCII codes these produce, etc. The VT-100 is a pretty simple terminal, and most of its characteristics are handily subsumed by those of an ST. The keyboards differ (VT-100 has certain dedicated keys, for example), but you have enough keys on an ST so that you can redefine some to suit your purposes. The VT screen hardware is a little harder to duplicate, as I recall -- mostly because, unlike the ST, it's a character-mapped system, and the appearance of a character on-screen (colored, blinking, underlined, etc.) is defined by an attribute byte (or word) stored next to the character code in screen RAM. Managing the realtime characteristics of such a system can be a little complicated (it's relatively challenging to produce blinking text, for example, on a bit-mapped screen ... you have to set up a background function to re-write the screen bitmap on a periodic basis, wherever blinking text appears). But the ST has sufficient processing power, interrupts, user timers, and other hardware goodies to make it possible. 2) How the protocol works: i.e., what does the VT-100 do in response to receipt of a given character sequence from its "host," and what character sequence does the VT-100 output, in response to a given command? Given this information, you can design your terminal emulator in several parts -- each actually a "micro emulator" that emulates a particular aspect of VT- 100 functions. At minimum, you'll need to design a screen driver that emulates the VT-100's screen hardware, a keyboard interpreter that remaps the ST's keyboard to conform to VT-100 norms, a protocol emulator that chats with the screen driver and keyboard interpreter and serial port (i.e., the host), tying their functionalities together into a full VT-100 function set, plus whatever low-level serial-port or other interface drivers you may need. It may sound overwhelming, but it's a project that can easily be compartmentalized, and attacked piece-by-piece. Naturally, you can push such a project as far as you like. But be aware that although "complete" VT-100 emulator programs do exist, most so-called VT-100 emulations actually provide only a subset of VT-100 functions. Moreover, while my own instinct would be to subdivide the program into a "hardware" emulator and a "software" emulator, there are many practical ways to finesse this distinction, particularly if you're willing to accept a less-than-perfect overall emulation. In practical terms, a workable VT-100 emulator, offering a sufficient subset of text-mode capabilities to let you access most commercial hosts that support "VT-100" as a user terminal, can be built on top of the Atari's built-in VT-52 functions using really minimal amounts of code. On the other hand, a really complete emulation is a monster project. I once did some consulting for a telcom software firm that offered a very flexible terminal package featuring numerous terminal emulations. Their overall terminal program architecture was very intelligent: At the lowest level, they had built a fairly powerful "virtual screen-handler" that could do everything from put a blinking "X" at cursor position 40,72 to plot pixels and draw lines. The virtual screen-handler could do pretty much anything that any standard terminal could, as regarded hardware. On top of this, they put a hardware-personality stage: something that knew how to call the virtual screen handler to emulate a specific type of terminal, but didn't have to concern itself with low-level details of screen-handling. On top of the hardware- personality, they put a basic protocol emulation handler and a keyboard mapper. All they ever had to do to add a new emulation was to develop or adapt a hardware-personality, develop a protocol emulation handler, and design a new keyboard map. They could, as a result, slap in a new emulation in something like a week, all programmed in very high-level C, or actually table-driven (i.e., "programmed" with a text-editor). ------------ Category 3, Topic 22 Message 138 Sat Jul 25, 1992 D.DAVIS42 at 21:33 EDT John, Thanks for the (WOW) reply. The real reason I asked about this was to find out how or where I would find the specifications for each terminal type. I guess that now I know what to ask, I can get under way. This is all due to my needing a new terminal package for the ST. I took my ST out of the closet this week, after using a PC for a few months, and decided to use it as my primary computer ( I like the ST MUCH better). I bought Stalker 3.0 on a recomendation and am somewhat disappointed with it. (To keep from being lynched, let me say that I haven't spent HOURS with it yet :-) ). Most of my work is done online to UNIX sites and I need both a FULL featured dial directory as well as good vt-100 emulation. So far, no complaints with the VT emulation in Stalker, but I guess I'll have to write a script to dial long distance company codes. Back to the message.. I will now try to find the specs for the different emulations. Thanks again for the lesson (you'd never get that kind of help in MS-DOS-land) ------------ Category 3, Topic 22 Message 139 Sun Jul 26, 1992 EXPLORER [John J.] at 10:25 EDT You'll find BackTalk to be a powerful and comprehensive language, well-suited to the kind of work you're doing. However, I'd be surprised if STalker's basic autodialer was insufficient for your needs. Note that if you have access to a Unix installation, you can at least find tabular specifications for a VT-100 terminal someplace in bin/tty, I think. Also, be aware that Atari itself has produced a really first-class VT-100 emulator in cartridge form, that I believe is used for ST-as-terminal access to its own Unix minicomputers. Give them a call at (408) 745-2000, and see if the product is still (or was ever) publically available. ------------ Category 3, Topic 22 Message 140 Thu Aug 06, 1992 R.GILLIES at 01:34 EDT Question regarding application ID's: Is the 3rd element in the Global array a secure address to obtain the application ID of the current program? From what I've determined that my TOS1.4 returns version 320 for global(0), 1 for global(1) and 0 for global(2). Does this sound right to you'all out there in hacker land? I'm not sure if the data in those first three elements are guaranteed to stay the same during during an OPEN WORKSTATION, GRAFHANDLE, or OPEN VIRTUAL WORKSTATION (or any others). The reason I ask is that I'm trying to right a desk accessory, and MENU_REGISTER requires the application ID with pointer to a 0 terminated string. Am I correct in understanding this? My interpreter doesn't have a "canned" ap_id = init(appl) function, since it performs it's own application "init" function at startup. Finally, my last question. Must Desk Accessories "have" a window or tree object made available when invoked? Can it simply sit there in the background, doing some processing without having to take up a single menu slot, yet accessible through the APPL_WRITE, READ, FIND, etc., etc? It seems the MENU_REGISTER "requires that 0 terminated string to place up there". P.S.--I'm doing all this with MultiForth, so if there's anyone out there who'e "pioneered" desk accessory initializion routines who's willing to share the code with me, I'd be extremely appreciative in having you do so. :-) ...Bob ------------ Category 3, Topic 22 Message 141 Thu Aug 06, 1992 S.YELVINGTO2 [Steve] at 03:03 EDT Bob -- The third element of the global array, global[2], is indeed where you'll find the application ID after calling appl_init. You mentioned MultiFORTH -- does it support desk accessories? The startup procedure for a DA is much different (and much simpler) than that of a program. If your forth interpreter binds in a startup routine that doesn't provide for the needs of a DA, you're not going to be able to do anything but crash your ST. On your last question: A DA doesn't need to do anything visual, nor does it need to respond to menu clicks. It can sit there and do nothing if that's what you want, or it can periodically wake up (using evnt_timer or evnt_multi) and perform a quick chore. ------------ Category 3, Topic 22 Message 142 Thu Aug 06, 1992 R.GILLIES at 04:12 EDT Glad you're up burning the midnight oil with me, Steve! According to the demo programs (these are fully functional "skeleton" code, just plug in your subroutine) there're support structures written among the extension files (GEM, messages, event handling, window and on and on) that culminate in a WORD that installs you customized "event handler". Window, Menu, and you quessed it, Desk Accessories. Your handler get's installed in a loop that access event_multi at the lowest levels. What your handler does is up to you, of course. So, from the standpoint of messages, MultiForth allows for full use of the AES's services. NOW, in regards to starting up, all MultiForth kernal does is perform the appl_init "internally". Then reverts to "text mode". That and performs an appl_exit during BYE, a WORD which can be bypassed. That's it, according to the manual. It's pretty bare bones without the GEM (and utility) extensions. It does let me into the command line interpreter "the Outer Interpreter, to you Forth Freaks" when booted from the AUTO folder! (I don't think I dare access the AES from there!). I really don't see anything ~ that can prevent me from writting an accessory as long as I bypass BYE with an infinite loop that calls event_multi. ...Bob ------------ Category 3, Topic 22 Message 143 Thu Aug 06, 1992 R.GILLIES at 04:30 EDT In addition, Steve, it's probably not too difficult to work up them fancy PRG/ACC's. Be aware of the menu limitations and such, examine memory locations during startup (you can have a WORD execute before MultiForth is fully initialized) to look check whether it launched as an ACC or PRG, then emplace an appl_exit for PRG's or prevent such for ACC's. It sounds simple, but HECK, I admit here and now that I'm experiencing difficulty in getting a working ACC. I still too inexperienced to write the proper message handling routines (the structure for emplacing them is already supplied) and the samples of code I have regarding such are in "C". They're too involved with window handling, too! I need something simple that confirms that my ACC did in fact register with the AES. I'm just trying to rule out "errors in logic" by keeping it simple, and concentrate on getting the dern thang registered with the AES. 8^/ thanx for any tips you can TOSs by way. ...Bob ------------ Category 3, Topic 22 Message 144 Thu Aug 06, 1992 R.GILLIES at 05:06 EDT Furthermore, (I'm on a roll, guys and gals) it doesn't request all of memory. Apparently, I have to allocate more manually as my program code grows. I don't know if this aspect of memory handling has any bearing in regards to DA's, but it would allow me to adjust memory during bootup, like Arabesque, if the proper words were written. I guess what's I'm trying to shed a firefly's worth of light on aspects I can accomplish, whether or not they indicate a hinderance to DA's or not, I do not know (I don't even know if I answered adequately enough you question regarding start up bindings that would prove to be a hinderence). I'll tell you what. If someone can show me the tiniest piece of code (preferebly in "C") that initializes an ACC, and let's me know in no uncertain terms it working, I'll get my answer. <8^} ...trying desperately to not be a pinhead... ..Bob >8^7 ------------ Category 3, Topic 22 Message 145 Fri Aug 14, 1992 S.YELVINGTO2 [Steve] at 01:46 EDT I'm kind of handicapped here -- all my DA code is on my hard drive, which is shut down by an apparently bad power supply. If you were programming in C, you would link a startup module, written in assembler, that would set up a stack and call your main function. This differs greatly from a full-fledged program, where the startup code would have to calculate the memory required by the program, call Mshrink() to free the memory it doesn't need, and perform various other housekeeping chores. Some startup modules check a register value on launch to determine whether the code is functioning as a program or a DA, and respond accordingly. If your FORTH interpreter doesn't provide for DA operation in its program startup code, then you're SOL (unless you can rewrite the interpreter's startup routines). Using the wrong startup routines will bomb your program. Guaranteed. If it does, writing a DA is fairly simple: Get an application ID with appl_init. Call menu_register to get hooked into the menu bar. Go to sleep by calling the event manager, waiting for a message from the AES (or a timer event, etc.). When you get a message, wake up and do your thing. Keep an eye out for messages from the AES in case the foreground application terminates. If it does, you must go back to sleep. Don't mess with Malloc/Mfree. (There are exceptions, but in general, don't.) This may be a BIG problem with your FORTH interpreter. It's even a problem with some C libraries, including dLibs. Don't let your program lose control to the event manager while holding a file handle open. There may be some other ``gotchas,'' but those are the biggies. ------------ Category 3, Topic 22 Message 146 Fri Aug 21, 1992 R.GILLIES at 00:04 EDT Thanks for those tips, Steve. I think I'll make an attempt to contact the programmer who created the ST version. It appears he's the only one who has the code to make any changes. When (*if*) I reach him, I'll mention those thing you outlined. ...Bob ------------ Category 3, Topic 22 Message 147 Mon Aug 24, 1992 K.OLSON10 [Ken] at 18:07 EDT Hi! I just got some programs written in GFA-BASIC Version 2. All I have is GFA-BASIC Version 3.5E. How do I convert the "2" BAS to "3" GFA? I did a search of the manual but found nothing. Any help would be appreciated. Ken.O :) ------------ Category 3, Topic 22 Message 148 Wed Aug 26, 1992 D.BROWN65 [David] at 23:20 EDT Ken, GFA 3.5 lesson #1... The manual stinks. It has many spelling errors, examples that bomb, and keywords explained wrong. The only way I know of is to save a GFA 2.0 as ASCII (List). Then use your GFA 3.5 to MERGE the file in. Most program will convert fine, but some variable names will conflict with new GFA 3.5 commands. It has been so long since I converted that I can't remember any examples other than NAME$ (Converts is to NAME "$" AS "", or sometime similar). Good luck with v3.5, the manual really stinks but it has a lot of great features, if you can figure them out! David ------------ Category 3, Topic 22 Message 149 Fri Aug 28, 1992 K.OLSON10 [KenO.] at 07:11 EDT Hi! David, Thanks for the fast response - almost as fast as WARP9. How forgetful of me. I should have remembered how to convert files with ASCII and merge. Right the manual is not the best even if it is the largest one for any program I have. KenO. :) ------------ Category 3, Topic 22 Message 150 Sat Sep 19, 1992 J.TARRENTS [jerry] at 22:43 EDT Can someone help a "not even a" beginner? I have a "type in" Basic program and the only Basic operating system I have is the Atari Basic which came with my machine. What would be the proper way to edit the following string: LPRINT PSTRK(I);TAB(35);USING"##.####";PMKT so the Atari Basic program will run it? The program seems to be having problems with the - USING"##.####" - every string with that in it gives a syntax error. Thanx. JT ------------ Category 3, Topic 22 Message 151 Sun Dec 13, 1992 POTECHIN [Nathan @ DMC] at 08:36 EST I found this message elsewhere and thought it might be more appropriate right here. Could someone please help? L.CROSS2 [L.CROSS] at 10:16 EST Sub: I'm asking 4 help with RCS etc...! NONE of the books I have explain how to program Resource Dialogs in a manner that is understandable to a novice, like myself. I've uploaded a letter called PLEEZHLP.TXT. ------------ Category 3, Topic 22 Message 152 Sun Dec 13, 1992 D.STMARTIN [Binary Ink] (Forwarded) L.CROSS2 Try PROGRAMMING IN GFA BASIC 3.0 formerly from MichTron. It lays out the programming interface with dialogs real well. If you're interested in the RCS itself, there was a series of articles in Antic or STart (before they went belly up). ------------ Category 3, Topic 22 Message 153 Mon Dec 14, 1992 W.PARKS3 [Dr. Bob] at 01:06 EST Yes, how/what/why/and where are hard to find when starting with resource files. I found HiSoft's WERCS manual to be rather informative when I began working with resources. I still keep it handy to answer those "...now where is that object's x located again?" type of questions :-) Hisoft's Devpac also has some fine example (fully functional) code using menus and alerts. I expect that their C package would also have some similar examples, though I can't say for sure. Bye: Dr. Bob ------------ Category 3, Topic 22 Message 154 Sun Jan 17, 1993 J.FOY2 [JLF] at 07:35 EST Please! tell me how to get a program compliled and ready to run with heat and serve C I think it is like sozobon C. How do you link what name does a linker file have? If it get a little long please mail me the answer. step one simple print program done. Whats next? ------------ Category 3, Topic 22 Message 156 Sun Jan 17, 1993 J.TRAUTSCHOL [jtrautschold] at 22:11 EST JLF... There should be a complete set of instruction included with Heat & Serve C. Remember though, HSC is not meant for beginners. You really have to know something about C and how compilers and linkers work before attempting to use these tools. They do an excellent job, but are not for the C neophyte. John T. ------------ Category 3, Topic 22 Message 157 Mon Jan 18, 1993 S.SCHAPER [Meneldil] at 21:16 EST John, It seems to work for me, and I'm about as neophytish as you can get. ------------ Category 3, Topic 22 Message 158 Mon Jan 18, 1993 SFRT-ASST [Kenne@SFRT] at 22:18 EST How do you program the file selector in Hisoft Basic? ------------ Category 3, Topic 22 Message 159 Tue Jan 19, 1993 S.YELVINGTO2 [Steve] at 02:56 EST >Remember though, HSC is not meant for beginners. You really have to >know something about C and how compilers and linkers work before >attempting to use these tools. They do an excellent job, but are not >for the C neophyte. If you can figure out C, you can surely figure out how to use HSC. All you have to do is double-click a .C file and it compiles into a program. The INSTALL program modifies your DESKTOP.INF file and installs an environment- setter in your AUTO folder to make it all work automatically. You never have to learn the ugly details of assembler, linking, etc. You don't even have to learn how to use a shell (GEM or otherwise), since it runs from the Desktop. HSC's drawbacks from the standpoint of a beginner are the lack of a GEM tutorial or even documentation, and only partial ANSI compatibility. If you're trying to learn C from a book that uses prototypes, you're going to be in trouble fast. ------------ Category 3, Topic 22 Message 160 Tue Jan 19, 1993 J.FOY2 [JLF] at 22:09 EST I have a little head way. Now I want to compile Hisoft C toolbox? Is that what I want or do I want to include it? Anyway it's got a few compatblity differences. Has anyone compiled this toolbox with heat and serve? thank! ------------ Category 3, Topic 22 Message 161 Tue Jan 19, 1993 S.SCHAPER [Meneldil] at 23:34 EST BTW, Steve, HiSoft C is K&R, but with a few quirks that I don't know all of yet. ------------ Category 3, Topic 22 Message 162 Wed Jan 20, 1993 S.SCHAPER [Meneldil] at 00:48 EST JLF, Interestingly, we are working with the same software. How far along are you in learning C? Are you using anything in addition to the tutorial in the HiSoft C manual? ------------ Category 3, Topic 22 Message 163 Fri Jan 22, 1993 J.FOY2 [JLF] at 01:28 EST I have the K & R book. The more I learn the less I know. Hisoft just doesn't go deep enough. Is there anything out there that explanes all the functions. Whats a vdi_handle? ------------ Category 3, Topic 22 Message 164 Fri Jan 22, 1993 S.SCHAPER [Meneldil] at 08:59 EST JLF, You are definitely ahead of me, but then, I'm in grad school, and C isn't the only language to deal with. C is more fun, though. ------------ Category 3, Topic 22 Message 165 Fri Jan 22, 1993 M.L.HANSON [Merlin] at 19:11 EST JLF -- I haven't looked at your previous posts so I don't know the context of your question. There is a book _C For Programmers_, by Leendert Ammeraal that I think is a pretty good introduction to ANSI C for someone that that is not comfortable with K&R. And he describes all the functions that are part of ANSI C. But your question about vdi_handle suggests that you mean functions associated with and unique to the ST. The books by Sheldon Leemon on AES and VDI do a good job on those. Are you by any chance trying to learn C AND to program AES and VDI at the same time? That is hazardous to your mental health as far as I am concerned. vdi_handle stands for virtual device interface handle. A virtual device could be the monitor screen, the keyboard, some kind of graphics pad, and so on. A handle is analagous to a file name except it is a number instead of a string of characters; and furthermore it is a small number, like 5 or 6. ------------ Category 3, Topic 22 Message 166 Sun Jan 24, 1993 EXPLORER.5 [Robert Goff] at 13:16 EST A vdi handle is a number that you give to some of the GEM library functions. (GROSS oversimplification.) I sympathize. When I first began looking at C, the language looked like it was on a platform over my head and I could find no way of climbing up. After you get the drift of the K&R book, there are two resources you should review: the reference document for your library functions (in Sozobon and HSC, the library is called dlib and the document file should be in the documents folder in the compiler directory); and a GEM library reference. There are two reasonably good GEM library references that I know of: the best is the Compute! Technical Reference Guide, one volume for AES and one for VDI; and the other is the Atari developer's documentation. Once you begin to see where all the functions are and what they do, you'll begin to put them together. |) | |)O|) Robert Goff ------------ Category 3, Topic 22 Message 167 Tue Jan 26, 1993 Z.USER at 09:13 EST I find the library to be a total jumble of files...IBM, Mac, ST all mixed up. I want a daily budget programme. How do I find one, assuming there is one? How do I find the appropriate de-arcing programme? Thanks. Michael ------------ Category 3, Topic 22 Message 168 Tue Jan 26, 1993 BRIAN.H [ST~SysOp] at 19:52 EST Z.USER Are you using Aladdin or a terminal program? Please specify. *******Brian********* Written on Tuesday 26 January 1993 at 08:19 p.m. AST ------------ Category 3, Topic 22 Message 169 Tue Jan 26, 1993 SANDY.W [sysop] at 20:29 EST Michael - There are really _very_ few MAC and IBM programs in our library. Just a few _old_ ones from the early days of the Mac and IBM emulators. They are all located in Library 24 (Emulators). Use the JOIN/IGNORE option on the Library menu (Option 12) to ignore library 24, and you will never have to worry about seeing any of these files. The vast majority of files in our Library are Atari specific. If you have found any recent files that are now, we would like to know about them so we can take the appropriate action. Budget programs would most likely be found in Library 6 (Business Applications) or Library 10 (Demos). To search an individual library, use option #8 to select a library, then use option #3 to search on a specific keyword such as BUDGET. Actually, in this particular case, I wouldn't worry about searching only the Business library, as budget is a fairly specific keyword. Just enter the Library, select option #3, type BUDGET as the keyword, and hit return for the next two options and see what you get. If you run into problems, please let us know what you did, and what you saw so we can give you more specific help. The above directions are for those running "manually". If you are using Aladdin, the procedure is somewhat different, but you can still use the Aladdin Library Search option to search on BUDGET. For the extraction program, download the self extraction file ARC_LZH2.TOS, #25162. That file will take care of the great majority of files in the Software Library. ------------ Category 3, Topic 22 Message 170 Tue Jan 26, 1993 ST.LOU [Lou Rocha] at 20:29 EST Michael, have you considered Home Accounts2? ------------ Category 3, Topic 22 Message 171 Wed Jan 27, 1993 A.FASOLDT [Al Fasoldt] at 03:42 EST Michael, The GEnie library is a jumble of IBM, Mac and ST files? First, no, it isn't anything like that. Second, since that was your impression, tell us how you are accessing the GEnie libraries and we'll take it from there. Something must be messed up somewhere. Al ------------ Category 3, Topic 22 Message 172 Sun Feb 07, 1993 N.FRAGA at 01:30 EST I just bought Devpac 3, for my STE. I attending classes for programming and in Assembly class they 'kinda' showed us how to read a printed 'assembled' program. When I list the program to be assembled to the printer, it looks alot different. Is there any book that will help me how to 'read' the printed listing? I hope I asked this question right!! I'd appreciate any help. ------------ Category 3, Topic 22 Message 173 Sun Feb 07, 1993 M.L.HANSON [Merlin] at 11:31 EST N.Fraga: Well, I surely don't understand your question. I don't think I ever made a printer listing from Devpac, but assume it is a typical assembler listing. First of all does your question relate to the _symbolic_ form (using the mnemonics) or the _hexadecimal form_? I get the vague impression that you want to be able to convert between these two forms. Is that, by any chance, your problem? Another possibility for confusion relates to macro expansion. Are macros involved in your problem in some way? You say you can't 'read' something or other. What is a sample line or so of what you see that doesn't make sense? ------------ Category 3, Topic 22 Message 174 Sun Feb 07, 1993 W.PARKS3 [Dr. Bob] at 23:29 EST Most of the "assembly listings" a person may own are simple text listings of the source file which contain only the details that the writer typed in. Many times, the listings you may see in publications contain a lot of extra details such as line number, relative address, hex code etc etc. DevPac (any version) can produce these 'extended detail' listings for you if you want. Normally, the default LIST output when assembling is [OFF]. In the assembly dialog, simply select the button for LIST OUTPUT to FILE and a full assembly listing will be produced for you. The LIST directive can also be used within your source code to produce a listing (default output is the screen but can be directed elsewhere). LIST and NOLIST can be used to selectively print desired portions of your code if you wish. I often use this when I INCLUDE several files to skip over the parts that I don't care to show each and every time I assemble. MONST can also 'dissassemble' a binary file and sends the output to either a disk file or direct to your printer. I'd suggest ignoring this for now since you've said that you're just starting with DevPac. ALSO! Don't forget, if you need any DevPac specific answers that Oregon Research handles HiSoft's DevPac over in CAT33 ... I forget exactly which topic but that's the easy part to find ;-) Bye: Dr. Bob ------------ Category 3, Topic 22 Message 175 Sat Feb 13, 1993 N.FRAGA at 01:58 EST Well what I was referring to was the line number, where the instruction starts, etc. The specific memory locations, without having to read the original source. I maybe confusing you the way I have prased my question, and when I back next time (later this week), I wiil type a sample line. I appreciate your help! Norm. ------------ Category 3, Topic 22 Message 176 Wed May 05, 1993 J.ROY18 [Jonathan] at 00:30 EDT Do any of the C compiler for the ST, other than GNU C, support C++? I will be doing alot of programming this summer, most of which should be OOP. I'd hope not to kick my RAM up to 4MEG for GNU C if I don't have to, since that's quite a bit of money for me. I'm hoping Lattice C or Pure C has a relatively ANSI-complient C++ implementation. Thanks! ------------ Category 3, Topic 22 Message 177 Thu May 06, 1993 R.WATSON15 [Wayne Watson] at 02:33 EDT Jonathan, Lattice C can be forced into STRICT ANSI mode and even if it isn't, it still uses some ANSI reccomended ways (part ANSI compatible). As far as C++ features, Lattice C offers C++ style comments, Ellipsis, Anonymous Unions, Floating Point _asm support, _interrupt keyword and possibly others. This list was taken from the User's Manual addendum. You can turn on/off C++ and/or ANSI compatibilty modes. In the User's Manual, they mention a C++ version of Lattice C. Not sure if they mean another program or what. I really like Lattice C. It is a very nice package. ------------ Category 3, Topic 22 Message 178 Thu May 06, 1993 J.ROY18 [Jonathan] at 20:25 EDT But the real question is, how much support for objects, inheritence (sp?), etc, does Lattice C have? :) ------------ Category 3, Topic 22 Message 179 Mon May 10, 1993 RHFACTOR at 04:10 EDT Hi Gang, Just joining in this topic with a question. I'm programming with GFABasic and am interested in developing a 'voice synthesis' subroutine using the internal sound chip of the ST. Any suggestions or example code to point me in the right direction? Thanks, RHFactor ------------ Category 3, Topic 22 Message 180 Mon May 10, 1993 DABRUMLEVE [kidprgs] at 08:57 EDT There's a routine for evoking STSPEECH.TOS from within GFA programs, but it's a little persnickity. I once asked GFA for the command "SAY". ;-) ------------ Category 3, Topic 22 Message 181 Wed May 12, 1993 RHFACTOR at 02:15 EDT Hi D. The drawback I found with STSPEECH.TOS is that it doesn't seem to work with GFA3.5 compiler. So it seems I may have to start from the beginning. Anyone with suggestions or sample SOUND/WAVE commands that could be used as building blocks for a speech synthesis program ??! Thanks! RHFactor ------------ Category 3, Topic 22 Message 182 Wed Jun 02, 1993 S.SCHAPER [Meneldil] at 23:47 EDT Hi, I am having trouble translating the following expression into C: Rn/Rn+1 = [1+m/MenvF]^2 First, I need to solve it for m, which I don't recall how to do, Secondly how do I represent it in C, specifically, squaring the left-hand side. My original way of doing it was way off, and I'm stumped, so I'd really appreciate some help here. ------------ Category 3, Topic 22 Message 183 Thu Jun 03, 1993 S.SCHAPER [Meneldil] at 19:01 EDT Is this where I can ask about a divide by zero error I haven't been able to track down? I am trying to teach myself C. ------------ Category 3, Topic 22 Message 184 Thu Jun 03, 1993 M.L.HANSON [Merlin] at 19:06 EDT Meneldil: I suppose I will do something wrong, but I will give it a shot anyway. Let: z = MenvF (for brevity) p = Rn/(Rn+1) (for brevity) After a certain amount of manipulation, I come up with: m^2 + 2mz -{[p-1]* z^2} = 0 This is a quadratic equation in m, presented in the standard form ax^2 + bx + c = 0. If you only had high school algebra, it is possible you have never been exposed to quadratic equations. Let: x = m a = 1 b = 2z c = -{[p - 1]*z^2)} A general quadratic can be solved by: x = [-b +/- sqrt[(b^2 - 4ac)]/ 2a I would write a function to solve for the general case of a quadratic equation, and pass a, b and c as parameters and returning the two (possible) root values for x.. I didn't understand your question about 'squaring the left side'. Please repost if that is something you still want to do. ~~~~~~~ Yes, you could ask about a divide by zero problem here. ------------ Category 3, Topic 22 Message 185 Thu Jun 03, 1993 S.SCHAPER [Meneldil] at 21:36 EDT OK: Here is the area that gives me a divide by zero error (or would it be easier to upload the whole program (not a whole lot larger than this part, so you can run it, such as it is) float x; float n; float TitusBode; float P; float R; float f; float StarMass; float ringmass; float I; float ShellRadius; float rocheradius; float planetmass; float comp; /*composition of planet*/ float d; float object_no; #include main() { printf("enter radius of stellar shell in Astronomical Units\n"); ShellRadius = scanf("%*e"); fseek(stdin, 0, 2); printf("enter mass of stellar shell in sols\n"); StarMass = scanf("%*e"); I = f*StarMass*(exp(ShellRadius), 2.); f = 0.02; /*for now*/ /*for now*/ rocheradius = 0.1; /*for now*/ /* ringmass = (StarMass*f)*(sqrt(ShellRadius/(ShellRadius+1))-1);*/ do { ringmass = (StarMass*f)*(sqrt(ShellRadius/(ShellRadius+1))-1); x = 1+(ringmass/(StarMass*f)); ShellRadius = (exp(x.), 2.)*(ShellRadius+1.); /* TitusBode = (exp(1+ringmass/(StarMass*f)), 2.);*/ printf("orbital radius is %e A.U.\n", ShellRadius); printf("orbital period is %e years\n", ShellRadius*3.14); printf("mass of ring is %e\n\n\n\n", ringmass); ShellRadius = ShellRadius/TitusBode; f = (I/(exp(StarMass*ShellRadius), 2.)); StarMass = StarMass-ringmass; printf("f = %e\n", f); printf("I=%e\n", I); } while (ShellRadius >= rocheradius); evnt_keybd(); } ------------ Category 3, Topic 22 Message 186 Fri Jun 04, 1993 T.GIRSCH [TJ @ S-Mart] at 03:11 EDT Meneldil - What I'd do is create a macro in the beginning, as follows: #define debug(s) printf("%s\n",s) Then, before and after each calculation, place a statement as follows: debug("Checkpoint 1"); /* Calculation here */ debug("Checkpoint 2"); and so on. It's primitive debugging, but it's a quick and dirty way to isolate the statement at which you're getting the division by 0. - T.J. ------------ Category 3, Topic 22 Message 187 Sat Jun 05, 1993 S.YELVINGTO2 [Steve] at 03:15 EDT Ditto what TJ said. Actually, what I usually do is a little different. I scatter lines like this through the program: printf("%d\n", __LINE__); ... so I can tell what line number was executing when the program blew up. It's a crude debug method, but it works. You can easily chop out the statements by searching for \nprintf. One other comment: As I said in another topic, take scanf out and shoot it. The safe way is to use fgets to get a string, and then use fscanf to convert it AFTER checking to make sure it fits the expected format. If you're going to use the stream i/o library for console input on the Atari, you should't mingle GEM calls with it. Just call getc() to wait for keyboard input. ------------ Category 3, Topic 22 Message 188 Sat Jun 05, 1993 S.SCHAPER [Meneldil] at 17:06 EDT Steve, what does the , __LINE__) portion mean? I don't _see_ line numbers in Hi-Soft C (K&R) I do wish to avoid GEM calls at this point, as you suggested, for portability's sake, as I'd like to get it running, and add the other modules to get it to do what I want it to, then post it, so that it can be compiled on other systems, then write a GEM interface to it. ------------ Category 3, Topic 22 Message 189 Sun Jun 06, 1993 M.L.HANSON [Merlin] at 10:11 EDT Meneldil: __LINE__ is a predefined variable in ANSI C. It provides the source code line number. Try it, even if you can't find it in the book. You have to be alittle adventurous to teach yourself to program in a ny language. ------------ Category 3, Topic 22 Message 190 Wed Jun 09, 1993 T.GIRSCH [TJ @ S-Mart] at 01:01 EDT Merlin - HiSoft C isn't ANSI C, I don't think. In any case, most editors will tell you what line you're on as you're editing, so you can manually put in a line number. Steve - I think you meant to tell him to use fgets to get the string, and then use sscanf (not fscanf, as you had mentioned), after you know it fits the expected format. Any incarnation of scanf is notorious for core dumps and runtime errors, however, and I avoid it completely (even if I have to re-invent the wheel to do so). - T.J. ------------ Category 3, Topic 22 Message 191 Wed Jun 09, 1993 S.SCHAPER [Meneldil] at 01:19 EDT I give up. Someone show me how this is supposed to work, to get the numeric imput from the keyboard to the variables. Needs to be floating point, in HiSoft, double and float are equivalent, however once I have everything working, I want to compile in HeatnServe, so it should be compliant with that, too. ------------ Category 3, Topic 22 Message 192 Wed Jun 09, 1993 S.SCHAPER [Meneldil] at 19:44 EDT T.J., So, how do I use fgets to read the keyboard numeric input, evaluate the result to see if it is the right kind, then use sscanf to convert it to a floating point number for the variable? ------------ Category 3, Topic 22 Message 193 Wed Jun 09, 1993 D.CHARTER at 21:26 EDT Meneldil, I have missed part of the message thread, but if you want to get keyboard numeric input and convert it to a float I think you could use gets() to get a string and then use atof() to convert it to a float. fgets() reads from a stream (file), where gets() is from the standard IO (keyboard) ------------ Category 3, Topic 22 Message 194 Thu Jun 10, 1993 T.GIRSCH [TJ @ S-Mart] at 00:52 EDT Meneldil - Actually, as I said, I'd avoid sscanf completely. If the user is inputting a number properly, you should just be able to use atof() to convert it to a float. I also believe that the character returned by atof() tells you whether or not the string was successfully converted, but I'll hafta consult K&R first... - T.J. ------------ Category 3, Topic 22 Message 195 Thu Jun 10, 1993 S.SCHAPER [Meneldil] at 01:15 EDT Thanks, D.CHARTER (BTW, log on to the RT, then type `NAM' and give yourself a name, nickname or handle. ------------ Category 3, Topic 22 Message 196 Thu Jun 10, 1993 S.SCHAPER [Meneldil] at 19:32 EDT TJ, What neither my HiSoft tutorial, nor the book I checked out from the library tell me, is what the proper format of the gets() function is, in a way that I can understand it. This may be true of atof(), too, as I haven't looked at it yet. I used the version Siegel used (Turbo C/QuickQ for DOS) and the editor told me I had missing parameters in the function. I mean what do all of these parts mean? variable = gets(buf,max,stdin); Ok, I understand variable, but what is buf (yeah, I know it is a buffer, but the interpreter doesn't like it written in there), how should one write max (max character length) and do you actually have to type in stdin, when you already have #include up where you declare variables? (now, actually that is the format for fgets. gets is written simply as gets(), but then the editor tells me that that lacks parameters. Argh! ------------ Category 3, Topic 22 Message 197 Thu Jun 10, 1993 D.CHARTER [Duane] at 22:20 EDT Meneldil, I will get a name when I send this. Try this: char buf[10]; /* Declares a character buffer size of 10*/ float number; /* Declares a float */ gets(buf); /* This gets what you type and puts it in 'buf' */ number=atof(buf); /* converts data in 'buf' to a float type */ Or you could try: number=atof(gets(buf)); /* Does it all in one step */ Hopefully this is fairly correct. I am doing it off the top of my head...I don't have my books close by. The actual compiler will also make a difference. Hope this helps. Duane ------------ Category 3, Topic 22 Message 198 Sun Jun 13, 1993 S.SCHAPER [Meneldil] at 18:28 EDT Thank you for the help on gets. That appears to work now, although there are, of course other bugs that I have to work on now. Main ones appear to be algebraic transformations and solving for x which I forget how to do. But I sure appreciate the help to date here! ------------ Category 3, Topic 22 Message 199 Thu Jun 17, 1993 S.YELVINGTO2 [Steve] at 03:08 EDT Duane and Meneldil, The reason fgets() is usually recommended rather than gets() is that the latter does NOT check to make sure that the user doesn't type more data than will fit into the buffer. Note the prototypes: char *fgets(char *buf, int limit, FILE *stream) char *gets(FILE *stream) fgets() stops accepting input when it encounters a newline, EOF, or limit-1 characters. This is not a minor shortcoming of gets -- it's potentially a major problem. In fact, it's one of the security holes that Robert T. Morris Jr. used a couple of years ago when he created the Internet Worm. He wrote binary executable code past the end of an input buffer, literally rewriting a program to break past computer defenses and bring the entire global network to a halt. You're not going to get the same spectacular results on the ST, but you can very easily write past the buffer into other parts of memory, trashing variables or executable code. After the Internet Worm uproar, most C programmers abandoned gets() and scanf(), which has similar weaknesses, in favor of other functions that protect against user errors. There is another, minor, difference between gets() and fgets(). The former discards the newline character '\n' if input it terminated by a newline; the latter includes it in the input buffer. This is not a problem with the example code, because atof() stops processing when it hits a newline. Incidentally, the prototype for atof() is: double atof(char *string) Hope this helps. Steve Yelvington Marine on St. Croix, Minnesota ------------ Category 3, Topic 22 Message 200 Sat Jun 19, 1993 S.SCHAPER [Meneldil] at 02:58 EDT Steve, Can you explain to me how to interpret prototyping? ------------ Category 3, Topic 22 Message 201 Sun Jun 20, 1993 T.GIRSCH [TJ @ S-Mart] at 04:00 EDT All - If anyone can send me code (C, preferably) for playing DigiSounds, or tell me where I can find some, it would be greatly appreciated. Thanks, - T.J. ------------