Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,21 @@
package require critcl
# This code assumes an ILP32 architecture, like classic x86 or VAX.
critcl::cproc peek {int addr} int {
union {
int i;
int *a;
} u;
u.i = addr;
return *u.a;
}
critcl::cproc poke {int addr int value} void {
union {
int i;
int *a;
} u;
u.i = addr;
*u.a = value;
}
package provide poker 1.0

View file

@ -0,0 +1,7 @@
package require poker
# Increment a memory location; this will probably crash if you try for real.
# We don't define how to get a good address, but it's not usually a problem
# for embedded programming...
set where 0x12340
poke $where [expr {[peek $where] + 1}]