Path: utzoo!attcan!uunet!tellab5!toth From: toth@tellabs.com (Joseph G. Toth) Newsgroups: comp.sys.apple2 Subject: Re: HyperC filing question Summary: Creating StandAlone executables won't be easy Message-ID: <4560@tellab5.tellabs.com> Date: 15 Nov 90 14:13:37 GMT References: <1990Nov8.045226.7696@wpi.WPI.EDU> Sender: news@Tellabs.COM Lines: 97 I have tried mailing this, but my mailers keep rejecting the address -------------------------- Michael, It has been a while since I played with HyperC, and I only have a few of my listings here at work with me, so I can't totally guarantee the accuracy of everything I say here. In response to some of the questions in your recent posting; A) How do I create my own libraries? from the command prompt, enter 'mkdir ' in program code, Sorry, I haven't figured that one out yet, using the create didn't work for me. Looks like it will have to be written in assembler as a separately linked in function. B) Can the sym function do anything useful? Absolutely, Try using it once on the supplied archive libraries. You will find all kinds of useful info (however, I somehow assumed that you did this to be able to find out the entry point names in rt65.o to be able to generate your assembly routine graphics functions. C) How does one make an independent system program using Hyperc? Well, this will take a lot of work. I know the steps but not the details, and the details will require a lot of investigation. 1 - examine the format of the link command, you will notice an very short file (named s.o) that gets linked in before it processes any of your files. It is the first entry after the -a, followed by the $1 (for which the shell script substitutes your object file). You can even create your own archives and include them here if you have a large program or a bunch of nice short functions (a good place for separately compiled graphics functions, anybody ever create a Unix-like Curses package for an Apple //). This entry is the startup code that has external references to exit() and main(). This must be re-created where it provides all of the operations that the HyperC shell provides before executing your program. These include; a) loading the 'HYPERC' code at its appropriate location in memory ( I will explain shortly ). b) create a stack frame and initialize all required variables. c) parse the command to pass the parameters (argc, argv) to main. d) calling the main program with the argc and argv parameters. e) providing a call to exit() in case the program simply returns (does not perform its own call to 'exit()') I almost forgot, but 'exit()' will hace to be re-written to provide the standard ProDOS exit operation, as the current 'exit()' appears to return control to the HyperC shell by some method other than restarting the shell via the ProDOS 'quit' code. be a non-standard method. The reason for loading the HYPERC code is that it contains much of the operational code required by the linked operations. You may think you are including 'open', 'close', 'printf', etc. in your linked executable, but you are not. Those, and many other functions, are actually contained in the HYPERC code. Go back to question B - look at the output. The letters have meaning; A - anchored location T - an entry point in the object file X - an external entry referenced by code in the object. Watch the output on the screen while a link is in progress. Ever wonder why the insertion address of an included object didn't change from one file to the next? The answer is that that object only contained Anchored entries and variable definitions (no actual code). The numbers following an A in the symbol table listing is the PHYSICAL address in the Apple's memory where other objects containing an external reference will access. It would probably be safest to have the startup code load the HYPERC code since it is possible that code in rt.o, or any other supplied archive entry, could have direct calls to code in the HYPERC code whthout showing up in the Symbol Table dump. D) What is the name and function of all assembler directives? I have no idea. E) How many 65c02 codes are supported? I read somewhere that an assembler directive selects c02 code and that all op codes were supported. Sorry, a haven't found that info yet, will still look. F) What is the syntax for 65c02 codes implemented with implied operands? But you said you already know. I hope I was able to provide some useful information, even though I know I couldn't give any easy solutions. Joe Toth Tellabs, Inc. Lisle, Il.