A83: Re: Question


[Prev][Next][Index][Thread]

A83: Re: Question




Comments inside.

----- Original Message ----- 
From: "Jimmy Conner" <timagic@yahoo.com>
To: <assembly-83@lists.ticalc.org>
Sent: Wednesday, January 05, 2000 21:57
Subject: A83: Question

  Could someone point to what I'm doing wrong?  I was
wondering what the difference is between these 2 sets
of code, I can't figure out waht I'm doing wrong, hl
should point to the same place shouldn't it?

Jimmy


skip:
dec hl
dec hl
dec hl
;------------------------------------
ld b, (hl) ; 7            <- b equals contents of hl, whatever value that is
dec hl ; 6                <- hl points to previous byte
skip2:
dec hl ; 6 * 8 letters = 48
djnz skip2 ; (13 * 7) + 8 = 99                <- hl will be decremented b times
      Max Clocks =
158
;------------------------------------
ret


Second Code:


skip:
dec hl
dec hl
dec hl
;------------------------------------
ld c, (hl) ; 7                <- c equals contents of hl, whatever value that is
inc c ; 4                       <- c equals contents of hl+1
xor a ; 4   ' Is sbc affected by a or not?        <- a equals 0
xor b ; 4    If not then do a ld b, 0?               <- a equals b, *not* b equals 0
sbc hl, bc ; 15      total max 34
clocks;------------------------------------
ret



Follow-Ups: References: