| ??? 06/24/00 14:08 Read: times |
#3397 - RE: Signed numbers (compare & subtract) |
Subtraction:
. ;r67 is first 16b value r6=msB r7=lsB . ;r45 is second 16b value r6=msB r7=lsB . ;r23 is used to stoe results . . clr c ;carry is used as borrow flag . mov a,r7 ;start with two lsB . subb a,r5 ;subtract with cleared borrow . ;careful - the carry holds a partial result, don't change it . mov r3,a ;store lsB result in r3 . mov r1,a ;store as partial zero-test . mov a,r6 ;do the two msB . subb a,r4 ;subtract with carry . mov r2,a ;msB result stored . orl a,r1 ;OR combine with r1 for zero test . . ; carry: 0 means r67>=r45, 1 means r67<r45 . ; accumulator: if zero, r67=r45 . ; r23 holds the difference. . ADD COMPARISON CODE HERE -Jay C. Box |
| Topic | Author | Date |
| Signed numbers (compare & subtract) | 01/01/70 00:00 | |
| RE: Signed numbers (compare & subtract) | 01/01/70 00:00 | |
| RE: Signed numbers (compare & subtract) | 01/01/70 00:00 | |
| RE: Signed numbers (compare & subtract) | 01/01/70 00:00 | |
| RE: Signed numbers (compare & subtract) | 01/01/70 00:00 | |
RE: Signed numbers (compare & subtract) | 01/01/70 00:00 |



