| |
Dwangi
Registered: Dec 2001 Posts: 130 |
illegal opcodes that f
|
|
... 13 posts hidden. Click here to view all posts.... |
| |
Kabuto Account closed
Registered: Sep 2004 Posts: 58 |
To explain what's going on take a look at LDA ABX and STA ABX first.
LDA ABX takes 4 cycles unless a page wrap occured (address+X lies in another page than address) in which case the value read during the 4th cycle (which was read with the original high byte) is discarded and in the 5th cycle a read is made again, this time from the correct address. During the 4th cycle the high address byte is incremented in order to have a correct high byte if the 5th cycle is neccessary. The byte read from memory is buffered and copied to A during the read of the next command's opcode.
But there's a problem with storage commands: they need to put the value to write on the internal bus which is used for address computations as well. To avoid collisions STA ABX contains a fixup which makes it always take 5 cycles (the value is always written in the 5th cycle as the high byte is computed in the 4th cycle).
This fixup requires some transistors on the CPU; the guys at MOS forgot (or were unable?) to make them detect STX ABY (which becomes SHX) and a few others, they are missing that fixup so this results in a collision between the value and high address byte computation.
|
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
Quote: http://oxyron.net/graham/opcodes.html
@Graham:
This link seems to be dead... Did you store it anywhere else? |
| |
Steppe
Registered: Jan 2002 Posts: 1510 |
Try this:
http://www.oxyron.de/html/opcodes.html |
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
@Steppe:
Thanx... Too bad it doesn't state the workings of the illegal opcodes.
For example: What does AHX do? Which flags are altered? And so on... |
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
Blueehhh...
Sorry I was too quick... IT DOES STATE IT ALL!!!
Thanx again |
| |
Monte Carlos
Registered: Jun 2004 Posts: 359 |
What does &H mean?
Monti Carlotti |
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
Ehr... I believe the H stands for the instruction pointer (program counter). This points to the instruction in mem which is beeing executed.
|
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
To extend this...
The H is short for PCH (according to some other docs on the net), where PC is program counter and the H is the Highbyte of the address...
So, if the PC would be $1234, PCH = $12 and PCL = $34. |
| |
Monte Carlos
Registered: Jun 2004 Posts: 359 |
so a
ldx #$05
ldy #$cc
shy $fe00
means
ldx #$05
lda #$cc
and #$ff ;h+1
sta $fe00,x
????
|
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
ehr... No...
The program counter points to the current opcode in memory which is beeing executed by the processor...
So...
*=$1000
PC:$1000 : lda #$01
PC:$1002 : ldy #$02
PC:$1004 : shy $2000
; then shy is:
; #$02 & #$20 and stores it in $2000 |
Previous - 1 | 2 | 3 - Next |