Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user eightbitswide ! (Registered 2024-12-24) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > illegal opcodes that f
2003-02-05 09:02
Dwangi

Registered: Dec 2001
Posts: 130
illegal opcodes that f

 
... 13 posts hidden. Click here to view all posts....
 
2004-09-10 09:56
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.
2005-10-31 09:50
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?
2005-10-31 10:26
Steppe

Registered: Jan 2002
Posts: 1510
Try this:
http://www.oxyron.de/html/opcodes.html
2005-10-31 10:35
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...
2005-10-31 10:36
MRT
Account closed

Registered: Sep 2005
Posts: 149
Blueehhh...

Sorry I was too quick... IT DOES STATE IT ALL!!!

Thanx again
2005-10-31 14:52
Monte Carlos

Registered: Jun 2004
Posts: 359
What does &H mean?

Monti Carlotti
2005-10-31 15:27
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.
2005-10-31 15:37
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.
2005-11-01 11:24
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

????

2005-11-01 12:17
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Guests online: 86
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.047 sec.