Opps!
This message turned up in search, but its forum couldn’t be identified from the original transcript, so it may not be linked into its thread.
The question did make sense for either the Hardware or Programming sections
— what I objected to was the fact that you posted it in both. No biggie…
Here are a bunch of peek & poke routines. I don't guarantee them, and I
figure there are probably better ways to do these things. Would some "real"
C programmer please check them and tell me that I haven't screwed up too
badly… or that I have?
char peek(address);
long address;
{
return *((char *) address);
}
int peekw(address);
long address;
{
return *((int *) address);
}
long peekl(address);
long address;
{
return *((long *) address);
}
void poke(address,value);
long address;
char value;
{
char *pointer;
pointer = (char *) address;
*address = value;
}
void pokew(address,value);
long address;
int value;
{
int *pointer;
pointer = (int *) address;
*address = value;
}
void pokel(address,value);
long address;
long value;
{
long *pointer;
pointer = (long *) address;
*address = value;
}
– Bela