Re: branch computation

From: Chriz <chris_at_lachriz.de>
Date: Sun, 20 Oct 2019 22:00:16 +0200
Message-Id: <45CD1F65-C0E2-4890-A868-8759E5271C12_at_lachriz.de>
> Am 13.10.2019 um 22:13 schrieb didier_at_aida.org:
> 
> thanks, it works perfectly

I came up with a shorter version of the range check. The idea is to add $80 before checking just the high byte for zero.

> sec
> lda target
> sbc current
> tax
> lda target+1
> sbc current+1
cpx #$80  ; bit 7 of x reg -> carry
adc #0
bne out_of_range
; offset is in x

Enjoy!
Chriz
Received on 2020-05-29 23:16:55

Archive generated by hypermail 2.3.0.