|
From: Elias P. <eli...@ao...> - 2001-03-08 17:06:25
|
> hello, just started to use dev-cpp, and cpp in general
> and I would like to know how to write data directly to
> memory, like if I had an array of cosinus and want to store
> it to use in an assembler program.
To write directly to memory, you could just use an array. For example:
float cosarray[360]; // global memory array
void myinitfunction() {
int i;
for(i=0;i<360;i++) {
cosarray[i]=cos(pi*(float)i/180); // write to memory
}
}
Of course you could also use an array created with malloc or new. The
assembler program only needs the pointer to it.
> I´ve seen something like this in documents for other
> compilers:
>
> outp(0x388,value)
>
> but that doesn´t seem to be valid in dev-cpp?
It's not valid for windows programs i think. The outp command of
DOS-compilers gets directly translated into the assembler command
"outp" (and doesn't write anything to memory). To access hardware in
windows, you have to use the windows drivers for it.
|