0
$\begingroup$

For example, to add two 16-bit numbers on my 8 bit machine, I add the low bytes together, then the high bytes together, and then add the carry flag to the high byte of the output.

This strategy falls apart when dealing with twos complement signed numbers.

How do I handle adding two 16-bit signed numbers, when my ALU can only process 8 bits?

$\endgroup$
1
  • $\begingroup$ More often than not, there's an "add" instruction respecting a carry in ("adc"?). This strategy falls apart when dealing with twos complement signed numbers Please describe, in your question, how this falls apart. $\endgroup$
    – greybeard
    Aug 13, 2022 at 21:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.