From 2d803eae57514d2f0a233a650ef75f6e419d300c Mon Sep 17 00:00:00 2001 From: ksherlock Date: Mon, 29 Jul 2013 09:48:32 -0700 Subject: [PATCH] Updated Technical Note PT37: Using MPW for Non Macintosh 68000 Systems (markdown) --- ...ote-PT37:-Using-MPW-for-Non-Macintosh-68000-Systems.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Technical-Note-PT37:-Using-MPW-for-Non-Macintosh-68000-Systems.md b/Technical-Note-PT37:-Using-MPW-for-Non-Macintosh-68000-Systems.md index c7fa5dd..5cb63f0 100644 --- a/Technical-Note-PT37:-Using-MPW-for-Non-Macintosh-68000-Systems.md +++ b/Technical-Note-PT37:-Using-MPW-for-Non-Macintosh-68000-Systems.md @@ -227,11 +227,11 @@ The Pascal and C compilers do some hidden work to initialize the run-time enviro With Pascal, most of this initialization is automatically inserted into your main procedure. There is very little you can do about it except to put all of your Pascal routines into separately compiled UNITs and write your entry point in C or assembly. -In the case of C, this initialization is performed by a routine in the file CRuntime.o called `CMain()`. The following is a description of what happens to your source code from the time the C compiler gets it to the time the code you have written is executed: +In the case of C, this initialization is performed by a routine in the file `CRuntime.o` called `CMain()`. The following is a description of what happens to your source code from the time the C compiler gets it to the time the code you have written is executed: * MPW C compiles all of the source files and creates object files for the linker. All functions are compiled in exactly the same way, including `main()`. -* These files are linked together. If you do not link with the file CRuntime.o, these routines will link together, but they will not have an entry point; the linker will not have any routine explicitly defined as the first one to be called, and it will default to setting up the first routine that it finds as the entry point. -* If you do link with the file CRuntime.o, then you will be linking with a routine called `CMain()`. This routine is marked as being an Entry routine, and it will be the routine that is executed when you launch the Macintosh program. +* These files are linked together. If you do not link with the file `CRuntime.o`, these routines will link together, but they will not have an entry point; the linker will not have any routine explicitly defined as the first one to be called, and it will default to setting up the first routine that it finds as the entry point. +* If you do link with the file `CRuntime.o`, then you will be linking with a routine called `CMain()`. This routine is marked as being an Entry routine, and it will be the routine that is executed when you launch the Macintosh program. `CMain()` performs the following steps: @@ -251,7 +251,7 @@ This is what `_RTInit` does: This is what `_DataInit()` does: -1. Assume that A5 is valid, and that there is data appended to the end of DataInit that is used to initialize the globals. This will be done by the linker automatically. +1. Assume that A5 is valid, and that there is data appended to the end of `DataInit` that is used to initialize the globals. This will be done by the linker automatically. 2. Determine the size of the globals and zero it out. 3. Read the data at the end of the procedure and use it to initialize the globals. Normally, this process will attempt to use `_BlockMove` on sufficiently large blocks of data, and a small loop for small blocks of data. A version of `DataInit()` that does not call `_BlockMove` is available from Macintosh Developer Technical Support. However, this limits you to 64K of contiguous pre-initialized storage.