Added more tests

This commit is contained in:
2025-03-13 16:02:09 +01:00
parent 5a5061c5d7
commit d96c351b4b
12 changed files with 205 additions and 39 deletions

View File

@ -4,6 +4,5 @@ import "git.urbach.dev/cli/q/src/cpu"
// SubRegisterNumber subtracts a number from the given register.
func SubRegisterNumber(destination cpu.Register, source cpu.Register, number int) uint32 {
number &= 0b1111_1111_1111
return 0b111100010<<23 | (uint32(number) << 10) | (uint32(source) << 5) | uint32(destination)
return encodeRegisterNumberFlags(0b11, destination, source, number, false)
}