Question: Hi! I'm don't need help solving this question, I just need an explenation to why it turns out this way. I'm using machine language to
Hi!
I'm don't need help solving this question, I just need an explenation to why it turns out this way. I'm using machine language to calculate the result of a question. The program I'm using need the numbers to be in hexadecimal 2's complement form. The registers I'm using only hold for 8-bit however so I can't put in 4 digits, I can only put in 2. The question is:
-125-30
I'll solve it this way:
-125= FF83 -30= FFE2
The result should be:
-155=FF65
What's strange is even though I enter only 83 and E2 in my code, I get the result 65. I'm told my code and result is correct, but I'm wondering why FF before each number doesn't seem to be necessary? Why do I get the correct result anyway? Why does the program calculate the correct result even though I haven't put in the full 4 digit numbers?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
