Added more tests

This commit is contained in:
Eduard Urbach 2025-03-13 16:02:09 +01:00
parent c4d763839a
commit f4b0020c49
Signed by: eduard
GPG key ID: 49226B848C78F6C8
12 changed files with 205 additions and 39 deletions

View file

@ -6,14 +6,14 @@ func Jump8(code []byte, offset int8) []byte {
return append(code, 0xEB, byte(offset))
}
// JumpIfLess jumps if the result was less.
func Jump8IfLess(code []byte, offset int8) []byte {
return append(code, 0x7C, byte(offset))
// JumpIfEqual jumps if the result was equal.
func Jump8IfEqual(code []byte, offset int8) []byte {
return append(code, 0x74, byte(offset))
}
// JumpIfLessOrEqual jumps if the result was less or equal.
func Jump8IfLessOrEqual(code []byte, offset int8) []byte {
return append(code, 0x7E, byte(offset))
// JumpIfNotEqual jumps if the result was not equal.
func Jump8IfNotEqual(code []byte, offset int8) []byte {
return append(code, 0x75, byte(offset))
}
// JumpIfGreater jumps if the result was greater.
@ -26,12 +26,12 @@ func Jump8IfGreaterOrEqual(code []byte, offset int8) []byte {
return append(code, 0x7D, byte(offset))
}
// JumpIfEqual jumps if the result was equal.
func Jump8IfEqual(code []byte, offset int8) []byte {
return append(code, 0x74, byte(offset))
// JumpIfLess jumps if the result was less.
func Jump8IfLess(code []byte, offset int8) []byte {
return append(code, 0x7C, byte(offset))
}
// JumpIfNotEqual jumps if the result was not equal.
func Jump8IfNotEqual(code []byte, offset int8) []byte {
return append(code, 0x75, byte(offset))
// JumpIfLessOrEqual jumps if the result was less or equal.
func Jump8IfLessOrEqual(code []byte, offset int8) []byte {
return append(code, 0x7E, byte(offset))
}