Cycle neutral branching#

General Information

Author: Michael J. Mahon
Assembler: generic

From Michael J. Mahon:

I've found it useful to devise macros to do certain conditional operations in constant time. For example, "increment Y if carry set" (with A volatile) is:

BCS *+3	  ; Branch to INY
LDA $C8	  ; $C8 = INY

If Carry is set, the branch takes 3 cycles and the INY 2. If Carry is clear, the branch takes 2 cycles and the LDA 3. So this CINY macro always takes 5 cycles.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 03-Feb-2023 16:21 by Carsten Strotmann  
G’day (anonymous guest) My Prefs
© 2010-2021 AtariWiki
All content in the Wiki is licensed under Creative Commons Share Alike License, unless otherwise noted.
JSPWiki v2.8.3