<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 05 Aug 1994 13:26:15 +0000
From   : lamcw <lamcw@...>
Subject: Re: Steve's emulators.

hi there,

;I have a bit of a problem which I think I could really speed up - how can 
;I do relative branches? What I'm doing at the moment (basically) is:
;
;
; load branch distance byte
; if <branch distance> is less than 128
; move P back <branch distance>
; goto end
; move P forward <branch distance>
; .end
;
;Is there a better way of doing this? In the 256^3 speed test this is *by 
;far* where I lose my speed.


yes there is. if you define disp as a char variable, then the negative
sign is automatically taken care of by C. so all you need to code is

  if <condition true> { disp=<offset>; pc=pc+disp+2; goto next_opcode  }

chris lam,
aston univ.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>