CYASM ASSEMBLER USER'S GUIDE VERSION 1.77
CYASM ASSEMBLER USER'S GUIDE VERSION 1.77
CYASM ASSEMBLER USER'S GUIDE VERSION 1.77
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
7. Instruction Set<br />
The following notation will be used throughout this section of the document:<br />
acc Accumulator<br />
expr expression<br />
k operand value<br />
X X register<br />
ADD Add without Carry ADD<br />
Syntax:<br />
Operation:<br />
ADD A, expr<br />
acc ← acc + k<br />
ADD A, [expr]<br />
acc ← acc + [k]<br />
ADD A, [X + expr] acc ← acc + [X + k]<br />
Description:<br />
Adds a value; k, [k] or [X+ k] to the contents of the accumulator and places the result in<br />
the accumulator.<br />
Condition Flags:<br />
CF:<br />
ZF:<br />
Set if, treating the numbers as unsigned, the result > 255; cleared otherwise.<br />
Set if the result is zero; cleared otherwise.<br />
Source Machine Code Cycles<br />
Format Opcode Operand<br />
ADD A, expr 01h Immediate byte 4<br />
ADD A, [expr] 02h Direct address byte 6<br />
ADD A, [X+expr] 03h Offset byte 7<br />
ADC Add with Carry ADC<br />
Syntax:<br />
ADC A, expr<br />
ADC A, [expr]<br />
ADC A, [X + expr]<br />
Operation:<br />
acc ← acc + k + cf<br />
acc ← acc + [k] + cf<br />
acc ← acc + [X + k] + cf<br />
Description: Adds the content of the carry bit along with the contents of the accumulator to a value; k,<br />
[k] or [X+ k] and places the result in the accumulator.<br />
Condition Flags:<br />
CF:<br />
ZF:<br />
Set if, treating the numbers as unsigned, the result > 255; cleared otherwise.<br />
Set if the result is zero; cleared otherwise.<br />
Source Machine Code Cycles<br />
Format Opcode Operand<br />
ADC A, expr 04h Immediate byte 4<br />
ADC A, [expr] 05h Direct address byte 6<br />
ADC A, [X+expr] 06h Offset byte 7<br />
13