What's in my mind is this:
Normal 6502 registers:
Accumulator
X&Y
Stack Pointer
Status
...but where does that Halt line fit in?
In the Status register, you normally have negative, overflow, BRK command, decimal mode IRQ disable, zero, and carry modes. The guid I'm looking at here shows a blank bit there in the status register. Is that where the Halt command fits in?
IIRC, that's the only difference in the 6502 and Sally.
OK, I don't quite get how the 6502 has added this up:
A 16-bit addition routine. $20,$21 + $22,$23 = $24,$25 CLC clear the carry LDA $20 get the low byte of the first number ADC $22 add to it the low byte of the second STA $24 store in the low byte of the result LDA $21 get the high byte of the first number ADC $23 add to it the high byte of the second, plus carry STA $25 store in high byte of the result ... on exit the carry will be set if the result could not be contained in 16-bit number.
And here's what I came up with regarding this routine with some sample number I threw in (they're too small to have used the carry feature, though--would I need to clear the carry flag in this case?)
; addition CLC LDC $20 ADC $22 STA $24 LDA $21 ADC $23 STA $25 ; 0010 0000 $20 ; 0010 0010 $22 ; ------------- ; 0100 0010 $24 ; ============= ; 0010 0001 $21 ; 0010 0011 $23 ; ------------- ; 0100 0100 $25 ; therefore $20,$21 + $22,$23 = $24,$25 ; so if the values are set like this... ; $20 = 3 ; $21 = 4 ; $22 = 2 ; $23 = 5 ; ...then $24 = 5 and $25 = 9 for an addition routine that does this: ; 3,4 + 2,5 = 5,9Forgive me if I seem dumb, but when it comes to Sally, well, I kinda am. Anyway, it's $30,$31 where the data at $30 is "midnight" and $31 is "18", so I'm going to enjoy a few Z-80 based games
Let me know where I've gone goofy on this.
Edited by shadow460, Fri Nov 10, 2006 12:26 AM.














