Hello! I have a question , How to complement a number that is in a register by u
ID: 3838597 • Letter: H
Question
Hello! I have a question , How to complement a number that is in a register by using assembly language . Also, I do not know the opcode for negation . Then, add to it 1 to be 2's complement and store it in another register ? Using Armsim !I hope you understand !
Thank you Hello! I have a question , How to complement a number that is in a register by using assembly language . Also, I do not know the opcode for negation . Then, add to it 1 to be 2's complement and store it in another register ? Using Armsim !
I hope you understand !
Thank you I have a question , How to complement a number that is in a register by using assembly language . Also, I do not know the opcode for negation . Then, add to it 1 to be 2's complement and store it in another register ? Using Armsim !
I hope you understand !
Thank you
Explanation / Answer
MVN X1, X2 // X1,X2 are Registers. Negate the value
ADD X1, X1 #1 // add +1 to the register
Begin:
mov ax, data
mov ds, ax
mov es, ax
mov ah, 0000h
mov a1, num
NOT a1
mov b1, a1
adc a1, 00000001B
mov b1, a1
Exit:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.