VIM Q again
Rick Stevens
ricks at nerd.com
Mon Jun 2 17:44:02 UTC 2008
Mikkel L. Ellertson wrote:
> Cameron Simpson wrote:
>> On 02Jun2008 02:09, Gene Heskett <gene.heskett at verizon.net> wrote:
>> | Jump tables scattered around in your code, taking up valuable space
>> cuz the | darned thing doesn't have a conditional long branch ability,
>> just for starters.
>>
>> Hmm. I don't seem to recall needing jump tables, but perhaps my code
>> was smaller than yours. In fact, I've got some z80 code right here [...]
>> The long jump JP command allows conditionals. The 8080 might not have;
>> I never used that, either. I did have a Z80 macro for measuring the
>> length of the jump and using a JR instead of a JP where possible, but
>> JPs definitely allowed conditions.
>>
> The 8080/8085 had jump to an absolute address, with or with out
> conditions, but did not have the jump relative that the Z80 did. So even
> for a jump of 126 bytes away, you had to use the 3 byte jump instructions.
The Z80 had:
JR idx(unconditional)
JR Z,idx (jump relative if zero)
JR NZ,idx (jump relative if non-zero)
JR C,idx (jump relative if carry)
JR NC,idx (jump relative if non-carry)
And one of my favorites for loops:
DJNZ idx (decrement and jump relative if non-zero)
So, yes, the Z80 had conditional relative jumps. It also had that nice
set of secondary registers...very handy for interrupt processing.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer rps2 at nerd.com -
- Hosting Consulting, Inc. -
- -
- Lottery: A tax on people who are bad at math. -
----------------------------------------------------------------------
More information about the users
mailing list