started op table

This commit is contained in:
radumaco
2025-04-19 22:26:59 +02:00
parent d26e6b7436
commit 28243ac5d5
11 changed files with 246 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
package operations
import (
"radu.macocian.me/goboy/memory"
"testing"
)
func TestADD(t *testing.T) {
r1 := byte(3)
r2 := byte(4)
ADD(&r1, &r2)
expected := byte(7)
actual := r1
if actual != expected {
t.Errorf("actual %x != expected %x", actual, expected)
}
}
func TestADDFromMem(t *testing.T) {
r1 := byte(3)
addr := uint(1000)
memory.Write8(addr, byte(6))
ADDFromMem(&r1, addr)
expected := byte(9)
actual := r1
if actual != expected {
t.Errorf("actual %x != expected %x", actual, expected)
}
}