🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: rec.games.programmer
2 messages
2 total messages Started by Harold Iuzzolino Fri, 24 Jul 1992 17:04
Re: TP or C ? (was: Languages to program in and ports and blah and etc...)
#177
Author: Harold Iuzzolino
Date: Fri, 24 Jul 1992 17:04
27 lines
1506 bytes
>>I still like Pascal.  Everybody says, "it was originally intended only to teach
>>people how to program".  And I say, "so what?"  C apparently wasn't "good
>>enough" in it's original incarnation either.  Otherwise, why did they have to
>>come up with ANSII C and C++?  And C does sacrifice readability in favor of
>>flexibility.  The C "for" statement is especially weird; it's completely
>>different from "for" statements I've seen in any other language.
>
[Pointer stuff deleted]
>
>Also, in C, I wanted to check a couple of bits at memory location 0400:0017.
>All I did was:
> 
>if(*((char *)0x04000017)&3) ...
>
>How would you do that in pascal? 

this is one way (there are others, as I can think of two more)

var blah:longint absolute $0400:$0017;

begin
 if blah=3 then InsertSpiffyProcedureNameHere; {Or whatever...}
end.

--Mark Iuzzolino	      | "What do you mean you found a way to store
   President, Ashgon Inc.     | memory in locations smaller than a bit?" --A 
   CEO, Fantasy Squared Inc.  | very confused teacher.
Re: TP or C ?
#193
Author: Chris Gray
Date: Sat, 25 Jul 1992 08:17
30 lines
1178 bytes
In article <!1hmlwg@lynx.unm.edu> iuzzolin@carina.unm.edu (Harold Iuzzolino)
writes:

>>Also, in C, I wanted to check a couple of bits at memory location 0400:0017.
>>All I did was:
>>
>>if(*((char *)0x04000017)&3) ...
>>
>>How would you do that in pascal?
>
>this is one way (there are others, as I can think of two more)
>
>var blah:longint absolute $0400:$0017;
>
>begin
> if blah=3 then InsertSpiffyProcedureNameHere; {Or whatever...}
>end.

And, if anyone in the universe cares, in Draco it would be:

    if pretend(0x04000017, *char) & 3 ~= 0 then ...

or, since I prefer to use symbolic names:

    byte DeviceRegister @ 0x04000017;
    ...
    if DeviceRegister & 0x03 ~= 0 then ...

--
Chris Gray   alberta!ami-cg!cg	 or   cg%ami-cg@CS.UAlberta.CA
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads