According to Andreas Bauer:
- I've installed GPC into H:\GPC including DJGPP and the BINUTILS, I think it's all v2. When running gpc.exe says: ld.exe: cannot open -lgpc: No such file or directory (ENOENT) Do i have to pass params to gpc or to set an environment-var ?
DJGPP (including GPC) searches for libraries and such things in a specific directory structure. Normally, an environment variable points to the DJGPP directory, e.g. "H:\DJGPP", where there is a configuration file for the rest of the story. If you set it up in another directory tree structure, you have to specify library pathes either manually (-L) or by another environment variable which should be in the DJGPP documentation.
- I noticed that the output of GPC can't be redirected to a file. Is there any posibility to write the compiler-output into a file ?
Yes: gpc foo.pas -o foo.exe 2>foo.err
Errors go to the "error device", therefore ">foo.err" is not sufficient.
- Can you tell me if it's possible to use standard x86-assembly with gpc? Or is there at least a complete documentation of the gnu-assembler anywhere ? I can hardly get used to it :(
I have the same problem. Look into the GNU C documentation, section "Extensions to ASM" or similar. There is a description, but I had problems to understand it. Anybody out there who could explain to both of us how to use that inline assembler syntax?
- What must be done so that i can access the DPMI-interface through pascal without using assembly language ?
I think you *must* use assembly language. Interrupts and such things are not in Pascal's language standard. However it would be nice to have a Unit with a function (written in assembler) which solves this task ...
Is there any docu about that topic ?
I don't know of such a thing. There could be some hints in the DJGPP and/or EMX documentation.
- I created a program accessing an "array[1..4000000] of byte". All i got was an exception. How large must the stack be for this application and why the stack ?
I don't know why the stack is used, and I will change it (and use the data segment instead) unless somebody can tell me why the stack is preferable for the main program.
However, if you put the array into a Unit (or Module), it will be accepted.
Greetings,
Peter
e-mail: peter.gerwinski@uni-essen.de home address: D"usseldorfer Str. 35, 45145 Essen, Germany WWW: http://agnes.dida.physik.uni-essen.de/~peter/
On Tue, 8 Oct 1996, Peter Gerwinski wrote:
I don't know why the stack is used, and I will change it (and use the data segment instead) unless somebody can tell me why the stack is preferable for the main program.
Peter, I recall that I had tough time to make non-local goto's back to the main program level work in gpc.
In the beginning I made all routines in the main program level appear as global symbols, and all variables go to the data area. This worked fine, except that the goto handling routines crashed the compiler when a non-local goto back to the main program level was made. I could not make this work with the goto's like this.
The solution to the goto problem was to make all routines in the main program to be nested routines inside a "global main program scope" that can be jumped into from inside.
This had the unfortunate side-effect that made main program variables go into the stack, which is sort of stupid for obvious reasons.
However, MODULES are not treated like this, so currently if you have a large array, you can put it in a module, and it will go to the data area. (This is because you can not jump to the modules scope, so it does not cause problems :-)
If you wish you can try to force all program vars back to the global scope. This would be fine (I think it is possible, I just did not do that, sigh).
Juki jtv@hut.fi