How do I write an assembly program segment using HCS12’s IDIV tocalculate 5/2? The example I am given is to calculate 6/4. I amusing CodeWarrior just FYI
See below:
1000 00 06 00 04 xx xx xx xx …… (This is the memory address butdoes it go in the code? or does that get pre-inputted)
LDD $1000 ;numerator = 6
LDX $1002 ;denominator = 4
IDIV ;6/4 = 1, with remainder = 2
Note: After IDIV, X = $0001, and D = $0002,
Solution