jac@osu-eddie.UUCP (Jim Clausing) (12/30/86)
I am trying to write an INIT resource to reset a few of the values in the parameter ram. Unfortunately, since GetSysPPtr is not in ROM, LightSpeed Pascal won't let me call it with the DA PasLib. I know the address in low memory of the stuff I want. My question is how do I get the address into my pointer variable. If I had assembler available it would be fairly simple, just move $01F8 to the appropriate location (I think I can even find that, it seems at the moment to be (A6)-12 bytes), but I don't have assembler. I could use Generic(??), I suppose, but I don't know what goes in there either. Can anyone out there help me? Any assistance will be greatly appreciated. -- ----------------------------------------------------------------- Jim Clausing "Is it time for a colorful metaphor?" CIS Department jac@ohio-state.CSNET Ohio State University jac@ohio-state.ARPA Columbus, OH 43210 jac@osu-eddie.UUCP (Disclaimer: Ohio State doesn't have opinions on anything that I have opinions on and if they did I wouldn't claim theirs so why should they claim mine?)
jac@osu-eddie.UUCP (Jim Clausing) (12/30/86)
I realize that my previous message was a mere 45 minutes ago, but I solved my own problem. I had forgotten about the Pointer() function. It does exactly what I need. Sorry I cluttered the net with my stupidity. -- ----------------------------------------------------------------- Jim Clausing "Is it time for a colorful metaphor?" CIS Department jac@ohio-state.CSNET Ohio State University jac@ohio-state.ARPA Columbus, OH 43210 jac@osu-eddie.UUCP (Disclaimer: Ohio State doesn't have opinions on anything that I have opinions on and if they did I wouldn't claim theirs so why should they claim mine?)
mjbo@orstcs.UUCP (mjbo) (01/03/87)
---------------- You should be able to coerce a longint variable into a pointer by using code something like this var p1: longint; p2: ^integer; { or a pointer to whatever you want to fetch} p1:= parmCopyAddr; {the address of parameter RAM copy} p2:= pointer(p1); This assumes that the address of the the low-memory copy of the parameter ram is the same on all machines-- perhaps not a good assumption. Type coercions of this nature are supported by the MPW and Lisa pascal compilers. I hope LSP also has them. otherwise you will have to use a TRIX variant record with pointer and longint variants. Type coercions are just about the only way for Pascal programmers to live in the Mac environment. Otherwise we would have to learn C! Sorry about the previous empty response--I never seem to read these notes in the office where I have and editor manual handy ---and who can figure out how to get help without a menu!! Mark J. Borgerson Oregon State University, Computer Science. (mjbo@orstcs)