Hi good afternoon.
I found this spoke.
how can you make poke (a, b) of it
a = 0xc000 and b = 129.
then how does a peek please?
it is sdcc.
thank you.
greeting
H
it is
thank you.
greeting
void poke(int a) {
__asm
ld h,5(ix)
ld l,4(ix)
ld (hl),#129
__endasm;
}
void main() {
int addr;
char s;
for (addr=0xc000;addr<0xffff;addr++) {
s= 128;
poke(addr);
}
}
The same way you write to any address in C, via pointers.
unsigned char *ptr;
ptr = 0xc000;
*ptr = 129;
printf("read from 0xc000: %d", *ptr);
It looks like a screen clear routine - I'd put a screen clear routine entirely in ASM (e.g., using the stack clear method - Save SP, Change SP to FFFF, PUSH * 16K of the value you want, restore SP).
But in plain C just use pointers as pelrun says - but that won't compile to the fastest screen clear code.
hello, thanks for info.
greetring