According to

https://bitsavers.org/pdf/dec/pdp11/1170/PDP-11_70_Handbook_1977-78.pdf
page 64 (4-24):

"N: set if high-order bit of low-order byte (bit 7) of
result is set; cleared otherwise"
This commit is contained in:
folkert van heusden 2024-03-29 15:00:57 +01:00
parent 899e2a00ea
commit b018d4bf06
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -83,7 +83,7 @@ def op_swab(cpu, inst):
val, xb6 = cpu.operandx(inst & 0o77, rmw=True) val, xb6 = cpu.operandx(inst & 0o77, rmw=True)
val = ((val >> 8) & cpu.MASK8) | ((val & cpu.MASK8) << 8) val = ((val >> 8) & cpu.MASK8) | ((val & cpu.MASK8) << 8)
cpu.psw_n = val & cpu.SIGN16 cpu.psw_n = val & cpu.SIGN8
# note this screwy definition, per the handbook # note this screwy definition, per the handbook
cpu.psw_z = ((val & cpu.MASK8) == 0) cpu.psw_z = ((val & cpu.MASK8) == 0)