Page 2 of 2

Posted: Sun 27 May, 2007 4:57 pm
by Jim e
No, its 4 tstates. It's not jumping to the address pointed to by HL, its jumping to the address in hl. So only requires a read of 1 byte.

Posted: Sun 27 May, 2007 5:06 pm
by King Harold
Jim is right, it's actually a bad mnemonic, but I guess we'll have to live with it.. blame ZiLOG..

On the other hand, it's a jump, which is in fact a load, but it looks like a jump. So one could think 'jump to the instruction pointed at by hl' which would explain the reference brackets.
If jp xxx was defined as 'ld pc,xxx' then it would be completely wrong.


btw, you can't very well load a 16bit reg with a 8bit value.. 'ld pc,(hl)' would be completely impossible.

Posted: Sun 27 May, 2007 7:13 pm
by Andy_J
Oh, right, I knew that, I was just mis-thinking it =\


jp hl would probably be best... but then again you could have a label called hl... Gah. It's just a crappy mnemonic :D

Posted: Sun 27 May, 2007 9:04 pm
by CoBB
Andy_J wrote:jp hl would probably be best... but then again you could have a label called hl... Gah. It's just a crappy mnemonic :D
But this ambiguity isn't resolved, since it's still present in instructions like ld a,(hl).

Posted: Mon 28 May, 2007 12:14 am
by Andy_J
Let's just change assembly into something basic-ish! Or maybe it'd be more like COBOL...

Load into a from the address stored in hl.
Jump to the address stored in hl.
Add 1 to COBOL giving COBOL.


;)

Posted: Mon 28 May, 2007 9:43 am
by King Harold
my worry was actually that it could have been 6 t-states, like LD SP,HL, which is also a 1-byte instruction and a 16bit load to a special-purpose reg16 from hl (opcode: F9, so it could be the same 'family' as jp (hl) with it's opcode E9)

Posted: Mon 28 May, 2007 12:44 pm
by Jim e
No it's 4 tstates.

Posted: Mon 28 May, 2007 12:57 pm
by King Harold
Ok well I was just giving my reasons for thinking it could have been 6

Posted: Wed 04 Jul, 2007 5:40 pm
by King Harold
recently found this:
(this is from day 25)

Code: Select all

; A = x coordinate
; E = y coordinate     LOOK HERE
; B = number of rows
; IX = address of sprite
    LD     H, 0
    LD     D, H
    LD     E, L          ;AND LOOK HERE
Either E is not the y coordinate or you aren't supposed to overwrite it with L, but this doesn't make much sense.

Posted: Wed 04 Jul, 2007 5:47 pm
by tr1p1ea
Well its probably a typo in the inputs. Other sprite routines (and the code shows) that A would be X and L would be Y.

You should shoot off an email to sigma telling him about this.

Posted: Wed 04 Jul, 2007 6:04 pm
by King Harold
He does have an account on this forum - does he ever check us?
I don't know whether this is worth mailing him for though.. Just a minor typo - and it keeps you sharp while you're reading :P

edit: this is more serious, if it has been noted already then sorry but I'm too lazy to read everything again:
P/V is reset if BC becomes zero. Reset otherwise.