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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ASR Arithmetic Shift Right ASR<br />

Syntax:<br />

Operation:<br />

Description:<br />

ASR or ASR A<br />

→ → → → → → →<br />

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

Shifts all bits of the accumulator one place to the right. Bit 0 of the accumulator is loaded<br />

into the CF flag. Bit 7 remains the same.<br />

Condition Flags:<br />

CF:<br />

ZF:<br />

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

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

Source Machine Code Cycles<br />

Format Opcode Operand<br />

ASR 3Ch 4<br />

CALL Call Function CALL<br />

Syntax:<br />

Operation:<br />

Description:<br />

CALL address<br />

[psp] ← pc<br />

psp ← psp + 2<br />

pc ← k<br />

Executes a jump to a subroutine starting at the address given as an operand. The Program<br />

counter (pc) is pushed onto the program stack without disturbing the data stack. The zero<br />

flag (zf) and carry flag (cf) are pushed along with the pc. The program stack pointer is<br />

incremented. The program counter is loaded with the address value.<br />

Condition Flags:<br />

CF:<br />

ZF:<br />

Carry flag unaffected.<br />

Zero flag unaffected.<br />

Source Machine Code Cycles<br />

Format Opcode Operand<br />

CALL addr 9xh address byte (first 4K ROM) 10<br />

CALL addr 5xh address byte (second 4K ROM, B CPUs only) 10<br />

15

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

Saved successfully!

Ooh no, something went wrong!