Site Tools

base:16-bit_comparison

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

 base:16-bit_comparison [2020-10-27 00:34] – tww_ctr base:16-bit_comparison [2021-09-13 17:23] (current) – New version didn't pass all validation tests. Reverted to old version. tww Both sides previous revisionPrevious revision2021-09-13 17:23 tww New version didn't pass all validation tests. Reverted to old version.2020-10-27 00:34 tww_ctr 2020-10-24 14:05 verz [TWW Method] 2020-10-24 12:55 verz [TWW Method] 2020-10-24 00:06 verz 2020-10-22 20:30 tww created 2021-09-13 17:23 tww New version didn't pass all validation tests. Reverted to old version.2020-10-27 00:34 tww_ctr 2020-10-24 14:05 verz [TWW Method] 2020-10-24 12:55 verz [TWW Method] 2020-10-24 00:06 verz 2020-10-22 20:30 tww created Line 5: Line 5: 16 bit equivalent of the CMP OPC: 16 bit equivalent of the CMP OPC: + /*! «»«»«»«»{CMP16}«»«»«»«» /*! «»«»«»«»{CMP16}«»«»«»«» - Does exactly the same as CMP of two values (effectively its a A - M) and sets the flags as follows: + Does exactly the same as CMP of two values (effectively its a val1-val2) and sets the flags as follows: - If A = M : Carry =  SET   Zero =  SET   Negative = CLEAR + (BCC/BCS)      (BEQ/BNE)      (BMI/BPL) - If A > M : Carry =  SET   Zero = CLEAR  Negative = CLEAR + If val1 = val2 : Carry =  SET   Zero =  SET   Negative = CLEAR - If A < M : Carry = CLEAR  Zero = CLEAR  Negative =  SET + If val1 > val2 : Carry =  SET   Zero = CLEAR  Negative = CLEAR + If val1 < val2 : Carry = CLEAR  Zero = CLEAR  Negative =  SET */ */ - lda A+1 + lda val1 - cmp M+1 + sec - bne !+ + sbc val2 - lda A + php - cmp M + lda val1+1 - !: + sbc val2+1 - // Status register sorted, from here you can branch as you like as you would after a CMP opc. + php + pla + sta temp + pla + and #%00000010 + ora #%11111101 + and temp + pha + plp + + + Somewhere on ZP: + temp: + .byte \$00 + +
base/16-bit_comparison.txt · Last modified: 2021-09-13 17:23 by tww