How to read a byte from a specific address (e.g. $12345) ?
There is a STPASCAL library in Maxon Pascal which has PEEK and POKE.
Pure Pascal..... ???
Pure Pascal MEM MEMW
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
-
- Captain Atari
- Posts: 212
- Joined: Fri Jan 06, 2006 1:30 pm
- Location: Wroclaw - POLAND
- Contact:
Re: Pure Pascal MEM MEMW
In the same way you would do it in C. By having a pointer of the appropriate type pointing to the address you like to write/read:
Code: Select all
program peekpoke;
type PLongInt = ^LongInt;
begin
PLongInt($10000)^ := 42;
writeln(PLongInt($10000)^);
end.
-
- Captain Atari
- Posts: 212
- Joined: Fri Jan 06, 2006 1:30 pm
- Location: Wroclaw - POLAND
- Contact:
Re: Pure Pascal MEM MEMW
Thanks. A simple example works. I still have a problem with write to the card registers. I'll have to check it out, maybe I made a mistake somewhere.
EDIT: It depended on compiler settings and it's working now
EDIT: It depended on compiler settings and it's working now
