Re: A83: Re: regarding jr nc, $+x
[Prev][Next][Index][Thread]
Re: A83: Re: regarding jr nc, $+x
The entire point of jr nc,$+4 is to use less labels.
>From: "David Phillips" <david@acz.org>
>Reply-To: assembly-83@lists.ticalc.org
>To: <assembly-83@lists.ticalc.org>
>Subject: A83: Re: regarding jr nc, $+x
>Date: Thu, 18 Jan 2001 00:57:32 -0700
>
>
>No. The $ symbol refers to the address where the opcode starts, so you end
>up with the address at the end of the instruction. To compute the value
>for
>the relative jump, it will subtract that address plus the size of the
>opcode, or $+2, giving you 0. A relative jump of 0 is essentially a nop.
>"jr 2" would be correct, except that would be computed as an absolute
>address, and not a relative one, which would (most likely) result in the
>relative jump being out of range. You need $+4. But there's an easier
>way:
>use labels :)
>
> > Is this correct?
> >
> > jr nc, $+2
> > ld b,24
> > ;code proceeds here if no carry
>
>
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com