Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In my digital systems class we are learning about Assembly for the MSP430. The j

ID: 3534798 • Letter: I

Question

In my digital systems class we are learning about Assembly for the MSP430. The jump instruction adds an offset to the PC to find the new instruction location. jmp offset, or jmp label, where W= 2*offset and W = Label - PC.


Given PC = 0x1002 and jmp label, (label is 0xFFFC). W = 0xFFFC - 0x1002 = -6.


I dont understand how to get -6 from that. I know how to subtract by adding A to (not)B, but im not sure if they are both negative because they are 2s complement or not. If someone could show the binary math of how to get to negative 6 I would appreciate it.


Another example is PC= 0x187E, label = 0x1800, making offset = 0x3C1

Picture of notes for refrence.


Explanation / Answer

Please rate with 5 stars :)


FFFC in binary is 1111111111111100


1002 in binary is 0001000000000010


2's complement of FFFC is 0000000000000100

2's complement of 1002 is 11101111111111100


Subtract them to get the value -6 in 2's complement.


Cheers!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote