SHENZHEN I/O

SHENZHEN I/O

ALU-I386-A
2 kommentarer
cyxw  [ophavsmand] 18. juni 2024 kl. 5:05 
@transcendentalConstant314 All data considered byte signed data, if a num is bigger than 127, then maybe its sign flag……
transcendentalConstant314 17. juni 2024 kl. 17:45 
On the first test run, there is a set of inputs that is

OPR1 = 239
OPR2 = 176
MODE = 100

and naturally this means calculate 239 + 176. Now, my code does yield the right RESULT, that being 159. But I don't quite understand why the flags are supposed to be set the way they are, in the specificaion as written. I understand why ZF should be 0, I understand why CF should be 100, but I don't understand why SF should be 100. For the first input triplet, that one being (196, 142, 100), the result should be (82, 100, 0, 0), where 82 is RESULT, 100 is CF, and the last two 0 entries being ZF and SF, respectively. Why should this input require SF to be 0, but the input I listed first requiring SF to be 100?