Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > 6502 mnemonics definitions as compilable header file
2012-08-16 16:39
Monte Carlos

Registered: Jun 2004
Posts: 359
6502 mnemonics definitions as compilable header file

I'm currently searching through the internet for a list of 6502 mnemonics in the form

Instruction_NOP = $ea
Instruction_BITZP = $24
Instruction_LDAIMM = $A9

etc.

I want to use such a list to stadardize speedcode generation.
I do not want to define the opcode values again and again in every code where i need speedcode generation.
What i can find are lists of the instructions with explanations and some intruction to value correspondences as tables, but this is not the format to include it in a sourcecode for beeing able make something like

lda #Instruction_LDAIMM
sta (speedcodeptr),y
iny
lda #some value
sta (speedcodeptr),y

etc.

If someone knows about such an header file existing somewhere in the net i would be glad about getting a hint. Else i would have to create such a list by myself.

Yours Monte Carlos
 
... 10 posts hidden. Click here to view all posts....
 
2012-08-16 20:29
Slammer

Registered: Feb 2004
Posts: 416
Here is a table which also includes DTV commands..
http://www.theweb.dk/docuprev/webhelp/cpt_BasicAssemblerFunctio..

If you use KickAssembler they are already in the assembler. Eg:
        lda #RTS
        sta target

You can read about it here: http://www.theweb.dk/docuprev/webhelp/ch11s02.html

EDIT: I have a simple java table with the definitions. You can have it if you need it. Its relatively simple to make a for loop and print it out in any format you want.
2012-08-16 20:43
Flavioweb

Registered: Nov 2011
Posts: 463
Here are all 256 opcodes...
BRK = $00
ORA_(zp,X) = $01
HALT = $02
ASL-ORA_(zp,X) = $03
NOP_zp = $04
ORA_zp = $05
ASL_zp = $06
ASL-ORA_zp = $07
PHP = $08
ORA_#n = $09
ASL_A = $0A
AND_#n/MOV_b7->Cy = $0B
NOP_abs = $0C
ORA_abs = $0D
ASL_abs = $0E
ASL-ORA_abs = $0F
BPL_rel = $10
ORA_(zp),Y = $11
HALT = $12
ASL-ORA_(zp),Y = $13
NOP_zp = $14
ORA_zp,X = $15
ASL_zp,X = $16
ASL-ORA_abs,X = $17
CLC = $18
ORA_abs,Y = $19
NOP = $1A
ASL-ORA_abs,Y = $1B
NOP_abs = $1C
ORA_abs,X = $1D
ASL_abs,X = $1E
ASL-ORA_abs,X = $1F
JSR_abs = $20
AND_(zp,X) = $21
HALT = $22
ROL-AND_(zp,X) = $23
BIT_zp = $24
AND_zp = $25
ROL_zp = $26
ROL-AND_zp = $27
PLP = $28
AND_#n = $29
ROL_A = $2A
AND_#n-MOV_b7->Cy___- = $2B
BIT_abs = $2C
AND_abs = $2D
ROL_abs = $2E
ROL-AND_abs = $2F
BMI_rel = $30
AND_(zp),Y = $31
HALT = $32
ROL-AND_(zp),Y = $33
NOP_zp = $34
AND_zp,X = $35
ROL_zp,X = $36
ROL-AND_zp,X = $37
SEC = $38
AND_abs,Y = $39
NOP = $3A
ROL-AND_abs,Y = $3B
NOP_abs = $3C
ORA_abs,X = $3D
ASL_abs,X = $3E
ROL-AND_abs,X = $3F
RTI = $40
EOR_(zp,X) = $41
HALT = $42
LSR-EOR_(zp,X) = $43
NOP_zp = $44
EOR_zp = $45
LSR_zp = $46
LSR-EOR_zp = $47
PHA = $48
EOR_#n = $49
LSR_A = $4A
AND_#n-LSR_A = $4B
JMP_abs = $4C
EOR_abs = $4D
LSR_abs = $4E
LSR-EOR_abs = $4F
BVC_rel = $50
EOR_(zp),Y = $51
HALT = $52
LSR-EOR_(zp),Y = $53
NOP_zp = $54
EOR_zp,X = $55
LSR_zp,X = $56
LSR-EOR_abs,X = $57
CLI = $58
EOR_abs,Y = $59
NOP = $5A
LSR-EOR_abs,Y = $5B
NOP_abs = $5C
EOR_abs,X = $5D
LSR_abs,X = $5E
LSR-EOR_abs,X = $5F
RTS = $60
ADC_(zp,X) = $61
HALT = $62
ROR-ADC_(zp,X) = $63
NOP_zp = $64
ADC_zp = $65
ROR_zp = $66
ROR-ADC_zp = $67
PLA = $68
ADC_#n = $69
ROR_A = $6A
AND_#n-ROR_A = $6B
JMP_(abs) = $6C
ADC_abs = $6D
ROR_abs = $6E
ROR-ADC_abs = $6F
BVS_rel = $70
ADC_(zp),Y = $71
HALT = $72
ROR-ADC_(zp),Y = $73
NOP_zp = $74
ADC_zp,X = $75
ROR_zp,X = $76
ROR-ADC_abs,X = $77
SEI = $78
ADC_abs,Y = $79
NOP = $7A
ROR-ADC_abs,Y = $7B
NOP_abs = $7C
ADC_abs,X = $7D
ROR_abs,X = $7E
ROR-ADC_abs,X = $7F
NOP_zp = $80
STA_(zp,X) = $81
HALT = $82
STA-STX_(zp,X) = $83
STY_zp = $84
STA_zp = $85
STX_zp = $86
STA-STX_zp = $87
DEY = $88
NOP_zp = $89
TXA = $8A
TXA-AND_#n = $8B
STY_abs = $8C
STA_abs = $8D
STX_abs = $8E
STA-STX_abs = $8F
BCC_rel = $90
STA_(zp),Y = $91
HALT = $92
STA-STX_(zp),Y = $93
STY_zp = $94
STA_zp,X = $95
STX_zp,Y = $96
STA-STX_zp,Y = $97
TYA = $98
STA_abs,Y = $99
TXS = $9A
STA-STX_abs,Y = $9B
STA-STX_abs,X = $9C
STA_abs,X = $9D
STA-STX_abs,X = $9E
STA-STX_abs,X = $9F
LDY_#n = $A0
LDA_(zp,X) = $A1
LDX_#n = $A2
LDA-LDX_(zp,X) = $A3
LDY_zp = $A4
LDA_zp = $A5
LDX_zp = $A6
LDA-LDX_zp = $A7
TAY = $A8
LDA_#n = $A9
TAX = $AA
LDA-LDX = $AB
LDY_abs = $AC
LDA_abs = $AD
LDX_abs = $AE
LDA-LDX_abs = $AF
BCS_rel = $B0
LDA_(zp),Y = $B1
HALT = $B2
LDA-LDX_(zp),Y = $B3
LDY_zp = $B4
LDA_zp,X = $B5
LDX_zp,Y = $B6
LDA-LDX_zp,Y = $B7
CLV = $B8
LDA_abs,Y = $B9
TSX = $BA
LDA-LDX_abs,Y = $BB
LDY_abs,X = $BC
LDA_abs,X = $BD
LDX_abs,Y = $BE
LDA-LDX_abs,Y = $BF
CPY_#n = $C0
CMP_(zp,X) = $C1
HALT = $C2
DEC-CMP_(zp,X) = $C3
CPY_zp = $C4
CMP_zp = $C5
DEC_zp = $C6
DEC-CMP_zp = $C7
INY = $C8
CMP_#n = $C9
DEX = $CA
SBX_#n = $CB
CPY_abs = $CC
CMP_abs = $CD
DEC_abs = $CE
DEC-CMP_abs = $CF
BNE_rel = $D0
CMP_(zp),Y = $D1
HALT = $D2
DEC-CMP_(zp),Y = $D3
NOP_zp = $D4
CMP_zp,X = $D5
DEC_zp,X = $D6
DEC-CMP_zp,X = $D7
CLD = $D8
CMP_abs,Y = $D9
NOP = $DA
DEC-CMP_abs,Y = $DB
NOP_abs = $DC
CMP_abs,X = $DD
DEC_abs,X = $DE
DEC-CMP_abs,X = $DF
CPX_#n = $E0
SBC_(zp,X) = $E1
HALT = $E2
INC-SBC_(zp,X) = $E3
CPX_zp = $E4
SBC_zp = $E5
INC_zp = $E6
INC-SBC_zp = $E7
INX = $E8
SBC_#n = $E9
NOP = $EA
SBC_#n = $EB
CPX_abs = $EC
SBC_abs = $ED
INC_abs = $EE
INC-SBC_abs = $EF
BEQ_rel = $F0
SBC_(zp),Y = $F1
HALT = $F2
INC-SBC_(zp),Y = $F3
NOP_zp = $F4
SBC_zp,X = $F5
INC_zp,X = $F6
INC-SBC_zp,X = $F7
SED = $F8
SBC_abs,Y = $F9
NOP = $FA
INC-SBC_abs,Y = $FB
NOP_abs = $FC
SBC_abs,X = $FD
INC_abs,X = $FE
INC-SBC_abs,X = $FF
2012-08-16 21:21
TWW

Registered: Jul 2009
Posts: 545
Try:

Kickassembler Manual Chapter 10.2
2012-08-17 11:48
Skate

Registered: Jul 2003
Posts: 494
I've coded a 6510 disassembler this year which works but has many missing features. I'm planning to release the tool in the future. It's not even in alpha stage so i'm not gonna share the tool or the complete source codes but opcodes part might be useful to some of you. It took a few hours to complete the opcode list with some of their required parameters. i may need more properties in the future but since it's not an emulator but a disassembler, it covers my needs as it is.

http://www.akaydin.com/misc_files/6510OpCodes.zip

p.s: it's a C++/CLI project, not a native one.
2012-08-17 14:39
Monte Carlos

Registered: Jun 2004
Posts: 359
@Flavio: That seems again treatable by search and replace, but there are some inconsistencies with grahams table and the naming of the illegals may be misleading. For example cyclewise NOP $nn =/ NOP #nn although the result is no operation in both cases. Also STA-STX is sometimes SAX and sometimes TAS, when looking in Grahams table.
I don't want to complain, it's still easier to use your table as a base and work in the differences instead of creating the whole table from scratch.
Anyway, thank you for your effort!
I will post the new table, which will be in accordance to grahams table, soon.

Monte Carlos
2012-08-17 20:56
Flavioweb

Registered: Nov 2011
Posts: 463
Quote: @Flavio: That seems again treatable by search and replace, but there are some inconsistencies with grahams table and the naming of the illegals may be misleading. For example cyclewise NOP $nn =/ NOP #nn although the result is no operation in both cases. Also STA-STX is sometimes SAX and sometimes TAS, when looking in Grahams table.
I don't want to complain, it's still easier to use your table as a base and work in the differences instead of creating the whole table from scratch.
Anyway, thank you for your effort!
I will post the new table, which will be in accordance to grahams table, soon.

Monte Carlos


I think also Skate files posted may be very useful for you. joining all infos here, i think you can achieve what you need...
2012-08-22 15:25
Monte Carlos

Registered: Jun 2004
Posts: 359
The new lists can be found here:

http://www.codebase64.org/doku.php?id=illegalmnemonicslist
and here:
http://www.codebase64.org/doku.php?id=legalmnemonicslist

The lists posted here contained some errors. So please refer to the Codebase entries, if you need the symbol definitions.
Previous - 1 | 2 - 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
ΛΛdZ
theK/ATL
WVL/Xenon
Guests online: 106
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
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 Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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