user2994884
user2994884

Reputation: 163

How to change sign of a .BLOCK or .WORD in Pep8 (Assembly)?

How would I go about changing the sign of a negative .BLOCK to positive in Pep8? And the other way around?

Thank you

Upvotes: 0

Views: 913

Answers (1)

Maxime Lorant
Maxime Lorant

Reputation: 36161

All you have to do is load 0 into the accumulator, and then subtract the number by that.

LDA 0,i
SUBA num1,d
STA num1

Upvotes: 1

Related Questions