Jbit QS: System Overview
Jbit QS: System Overview
Copyright
c 2007-2011 Emanuele Fornara JBit http://jbit.sourceforge.net/
JBit-QS Getting Started, System Overview, IO Basic Operations, Support Tables, 6502
Latin1 6502
0 1 2 3 4 5 6 7 8 9 Operations
30 ! " # $ % & ’ BRK: BReaK; in JBit, used to halt the VM.
40 ( ) * + , - . / 0 1 NOP: No OPeration.
50 2 3 4 5 6 7 8 9 : ; LDA, LDX, LDY: LoaD Accumulator/X/Y.
60 < = > ? @ A B C D E STA, STX, STY: STore Accumulator/X/Y.
70 F G H I J K L M N O INX, INY, INC: INCrement X/Y/memory.
80 P Q R S T U V W X Y DEX, DEY, DEC: DECrement X/Y/memory.
90 Z [ \ ] ^ _ ‘ a b c TAX, TAY, TXA, TYA, TSX, TXS: Transfer register.
100 d e f g h i j k l m CMP, CPX, CPY: CoMPare with accumulator/X/Y.
110 n o p q r s t u v w JMP: JuMP.
120 x y z { | } ~ JSR: Jump to SubRoutine.
RTS: ReTurn from Subroutine.
CLC, CLV: CLear Carry/oVerflow.
SEC: SEt Carry.
BEQ, BNE: Branch if EQual/Not Equal (z flag).
BMI, BPL: Branch if MInus/PLus (n flag).
BCC, BCS: Branch if Carry Clear/Set.
BVC, BVS: Branch if oVerflow Clear/Set.
ADC: ADd (to/into accumulator) using Carry.
SBC: SuBtract (from/into accumulator) using Carry.
AND: bitwise AND (with accumulator).
ORA: bitwise inclusive OR (with Accumulator).
EOR: bitwise Exclusive OR (with accumulator).
BIT: test BITs: #6 to v flag and #7 to n flag.
Line Art ASL, LSR: Arithmetic/Logical Shift Left/Right.
ROL, ROR: ROtate Left/Right.
T 1 0 0 0 B R L T PHA, PLA: PusH/PuLl Accumulator.
L R PHP, PLP: PusH/PuLl Processor status.
2
1
8
32
4
16
64
128
B Operands
#n: Constant n.
n: Cell 0:n.
n:n: Cell n:n.
128 129 130 131 132 133 134 135
n:n,X: Cell X cells after n:n.
n:n,Y: Cell Y cells after n:n.
r: Next cell + relative offset r, shown as n:n.
136 137 138 139 140 141 142 143
n,X: Cell 0:(n+X modulo 256).
n,Y: Cell 0:(n+Y modulo 256).
(n:n): Cell pointed by n:n.
Conversions (n,X): Cell pointed by 0:(n+X modulo 256).
(n),Y: Cell Y cells after cell pointed by 0:n.
0 0000 0 0 8 1000 8 128
1 0001 1 16 9 1001 9 144 Examples
2 0010 2 32 10 1010 A 160 TAX: Transfer (i.e. copy) Accumulator into X.
3 0011 3 48 11 1011 B 176 LDA #2: LoaD Accumulator with constant 2.
4 0100 4 64 12 1100 C 192 LDX 2: LoaD X with content of cell 0:2.
5 0101 5 80 13 1101 D 208 STX 2:18: STore (i.e copy) X into cell 2:18.
6 0110 6 96 14 1110 E 224 BCC 6: If C=0, skip (i.e. jump forward) 6 bytes.
7 0111 7 112 15 1111 F 240 BCC 240: If C=0, jump back 16 (i.e. 256-240) bytes.
Copyright
c 2007-2011 Emanuele Fornara JBit http://jbit.sourceforge.net/