17.11.2014 Views

CYASM ASSEMBLER USER'S GUIDE VERSION 1.77

CYASM ASSEMBLER USER'S GUIDE VERSION 1.77

CYASM ASSEMBLER USER'S GUIDE VERSION 1.77

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RRC Rotate Right through Carry RRC<br />

Syntax:<br />

RRC A or RRC<br />

Operation:<br />

CF → b 7 - - - - - - b 0<br />

Description: Shifts all bits of the accumulator one place to the right. The carry flag is loaded into the<br />

most significant bit of the accumulator, bit 7. Bit 0 of the accumulator is loaded into the<br />

Carry flag.<br />

Condition Flags:<br />

CF: Set if LSB of the accumulator was set, before the shift, cleared otherwise.<br />

ZF: Set if the result is zero; cleared otherwise.<br />

Source Machine Code Cycles<br />

Format Opcode Operand<br />

RRC A 3Eh 4<br />

SUB Subtract without Borrow SUB<br />

Syntax:<br />

Operation:<br />

SUB A, expr<br />

acc ← acc - k<br />

SUB A, [expr]<br />

acc ← acc - [k]<br />

SUB A, [X + expr] acc ← acc - [X + k]<br />

Description:<br />

Subtracts a value; k, [k] or [X+ k] from the contents of the accumulator and places the<br />

result in the accumulator.<br />

Condition Flags:<br />

CF:<br />

ZF:<br />

Set if, treating the numbers as unsigned, the result < 0; cleared otherwise.<br />

Set if the result is zero; cleared otherwise.<br />

Source Machine Code Cycles<br />

Format Opcode Operand<br />

SUB A, expr 07h Immediate byte 4<br />

SUB A, [expr] 08h Direct address byte 6<br />

SUB A, [X+expr] 09h Offset byte 7<br />

27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!