setN sets the negative flag if the argument is negative (high bit is set)
(value byte)
| 389 | |
| 390 | // setN sets the negative flag if the argument is negative (high bit is set) |
| 391 | func (cpu *CPU) setN(value byte) { |
| 392 | if value&0x80 != 0 { |
| 393 | cpu.N = 1 |
| 394 | } else { |
| 395 | cpu.N = 0 |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | // setZN sets the zero flag and the negative flag |
| 400 | func (cpu *CPU) setZN(value byte) { |