CPU Registers
A | Accumulator | |
X | Index | |
Y | Index |
Number Literal
literal在日语中被翻译成「直定数」,似乎比有些中文译本中的“字面值”更好理解。既可以理解成“直接定义的数”,从开发者的角度;也可以理解成“直接能确定的数”,从编译器的角度。
Syntax:
#<radix modifier>number
<radix modifier>:: $ | % | NULL
‘$’ symbol means the number is in hexadecimal
‘%’ symbol means the number is in binary
‘NULL’ means the number is in decimal
‘#’ symbol means immediate value
Addressing
address is 16bits
Direct Addressing
Syntax: ($)?<address>
‘$’ symbol means the address is in hexadecimal
Instructions
LDA, LDX, LDY
将立即数,内存单元中的值写入寄存器
STA, STX, STY
将寄存器中的值存到内存单元