use pointer arithmetic instead of raw peeks and pokes

This commit is contained in:
Irmen de Jong
2025-10-05 17:25:10 +02:00
parent b961ce97d6
commit ec9475c308
5 changed files with 28 additions and 24 deletions
+10
View File
@@ -45,6 +45,16 @@ class TestMemory: FunSpec({
mem.getUB(1001) shouldBe 0xeau
}
test("long access") {
val mem = Memory()
mem.setSL(1000, 12345678)
mem.getSL(1000) shouldBe 12345678
mem.setSL(1000, -888888)
mem.getSL(1000) shouldBe -888888
mem.setSL(1000, 0)
mem.getSL(1000) shouldBe 0
}
test("32 bits float access") {
val mem = Memory()
mem.getFloat(1000) shouldNotBe 0.0