Modern Computer Architecture and Organization

Modern Computer Architecture and Organization, by Jim Ledin. Published by Packt Publishing.


Chapter 1, Exercise 5

Write 6502 assembly code to subtract two 16-bit values in a manner similar to Exercise 4. Test with $0001-$0000, $0001-$0001, $0100-$00FF, and $0000-$0001. What is the result for $0000-$0001?

Answer

See the 6502 assembly file Ex__5_16_bit_subtraction.asm for the 16-bit subtraction code.

Try running this code at https://skilldrick.github.io/easy6502/