Add new attachment

Only authorized users are allowed to upload new attachments.

This page (revision-7) was last changed on 25-Apr-2010 19:46 by Carsten Strotmann  

This page was created on 25-Apr-2010 11:19 by Carsten Strotmann

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 113 added one line
!!OP-CODES, revisited
At line 115 added 81 lines
The bulk of the assembler consists of dictionary entries for each op-code. 6502 one mode op-codes are:
BRK,
CLC,
CLD,
CLI,
CLV,
DEX,
DEY,
INX,
INY,
NOP,
PHA,
PHP,
PLA,
PLP,
RTI,
RTS,
SEC,
SED,
SEI,
TAX,
TAY,
TSX,
TXS,
TXA,
TYA,
When any of these are executed, the corresponding op-code byte is assembled into the dictionary.
The multi-mode op-codes are:
ADC,
AND,
CMP,
EOR,
LDA,
ORA,
SBC,
STA,
ASL,
DEC,
INC,
LSR,
ROL,
ROR,
STX,
CPX,
CPY,
LDX,
LDY,
STY,
JSR,
JMP,
BIT,
These usually take an operand, which must already be on the stack. An address mode may also be specified. If non is given, the op-code uses z-page or absolute addressing. The address modes are determined by:
|| Symbol || Mode || Operand
| .A | accumulator | none
| # | immediate | 8 bits only
| ,X | indexed X | z-page or absolute
| ,Y | indexed Y | z-page or absolute
| X) | indexed indirect X | z-page only
| )Y | indirect index Y | z-page only
| ) | indirect | absolute only
| one | memory | z-page or absolute
!! EXAMPLES
Here are examples of Forth vs. conventional assembler. Note that the operand comes first, followed by any mode modifier, and then the op-code mnemonic. This makes best use of the stack at assembly time. Also, each assembler word is set off by blanks, as is required for all Forth source text.
{{{
.A ROL, --> ROL A
1 # LDY, --> LDY #1
DATA ,X STA, --> STA DATA,X
DATA ,Y CMP, --> CMP DATA,Y
6 X) ADC, --> ADC (06,X)
POINT )Y STA, --> STA (POINT),Y
VECTOR ) JMP, --> JMP (VECTOR)
}}}
Version Date Modified Size Author Changes ... Change note
7 25-Apr-2010 19:46 8.387 kB Carsten Strotmann to previous
6 25-Apr-2010 19:29 6.717 kB Carsten Strotmann to previous | to last
5 25-Apr-2010 19:20 5.109 kB Carsten Strotmann to previous | to last
4 25-Apr-2010 18:54 3.263 kB Carsten Strotmann to previous | to last
3 25-Apr-2010 18:45 1.263 kB Carsten Strotmann to previous | to last
2 25-Apr-2010 11:22 0.416 kB Carsten Strotmann to previous | to last
1 25-Apr-2010 11:19 0.379 kB Carsten Strotmann to last
« This page (revision-7) was last changed on 25-Apr-2010 19:46 by Carsten Strotmann