out_byte <- 0
decoded[0:7] <- 1
so_bit <- 0b0
+ early_stop <- 0b0
do while out_byte < 8
in_bit <- in_bits[63]
if in_bits = 1 then
if ra_used | (_RA = 0) then
+ early_stop <- 0b1
leave
ra_used <- 0b1
in_bit <- (RA)[63]
leave
else
so_bit <- 0b1
+ early_stop <- 0b1
leave
RT <- output
RS <- final_in_bits
- CR0 <- final_ra_used || 0b0 || (output = 0) || so_bit
+ CR0 <- final_ra_used || (output = 0) || early_stop || so_bit
Special Registers Altered:
max_count = 1 if once else 8
decoded, expected_SO = reference_pcdec(
supported_codes, input_bits, max_count=max_count)
- expected_EQ = len(decoded) == 0
+ expected_GT = len(decoded) == 0
+ expected_EQ = len(decoded) < max_count
expected_RT = int.from_bytes(
[int("1" + code, 2) for code in decoded], 'little')
decoded_bits_len = len("".join(decoded))
e = ExpectedState(pc=4, int_regs=gprs)
e.intregs[4] = expected_RT
e.intregs[5] = expected_RS
- e.crregs[0] = expected_ra_used * 8 + expected_EQ * 2 + expected_SO
+ e.crregs[0] = (expected_ra_used * 8 + expected_GT * 4
+ + expected_EQ * 2 + expected_SO)
with self.subTest(supported_codes=supported_codes,
input_bits=original_input_bits):
self.add_case(Program(lst, False), gprs, expected=e,