CDP1804 Syntax

Information

This page describes the additional instructions of the CDP1804 which is the successor of the CDP1802.

This info is also available online on the Emma 02 site.

Definitions

xx 8 bit value
xxxx 16 bit value
RN Register number N (N = 0 to F), RN can also be represented as N in all commands
RX Stack or data pointer register
RP Program counter register
RN.0, RX.0 or RP.0 Lower order byte or RN, RX or RP
RN.1, RX.1 or RP.1 Higher order byte or RN, RX or RP
M(RN)->D; RN+1->RN This notation means: The memory byte pointed to by RN is loaded into D, and RN is incremented by 1.

Syntax

INSTRUCTION MNEMONIC OP CODE OPERATION
MEMORY REFERENCE
REGISTER LOAD IMMEDIATE RLDI RN,xxxx 68CN M(RP)->RN.1; M(RP+1)->R(N).0; RP+2-RP
REGISTER LOAD VIA X AND ADVANCE RLXA RN 686N M(RX)->RN.1; M(RX+1)->RN.0; RX+2->RX
REGISTER STORE VIA X AND DECREMENT RSXD RN 68AN RN.0->M(RX); RN.1->M(RX-1); RX-2->RX
REGISTER OPERATIONS
REGISTER N TO REGISTER X COPY RNX RN 68BN RN->RX
BRANCH INSTRUCTIONS-SHORT BRANCH
SHORT BRANCH ON COUNTER INTERRUPT BCI xx 683E IF CI=1, M(RP)->RP.0; O->CI ELSE RP+1->RP
SHORT BRANCH ON EXTERNAL INTERRUPT BXI xx 683F IF XI=l, M(RP)->RP.0 ELSE RP+1->RP
COUNTER INSTRUCTIONS
LOAD COUNTER LDC 6806 D->COUNTER
GET COUNTER GEC 6808 COUNTER->D
STOP COUNTER STPC 6800 0->COUNTER CLOCK
DECREMENT COUNTER DTC 6801 COUNTER-1->COUNTER
SET TIMER MODE AND START STM 6807 TPA÷32->COUNTER CLOCK
SET COUNTER MODE 1 AND START SCM1 6805 EF1->COUNTER CLOCK
SET COUNTER MODE 2 AND START SCM2 6803 EF2->COUNTER CLOCK
SET PULSE WIDTH MODE 1, START SPM1 6804 TPA*EF1->COUNTER CLOCK; EF1 _/¯ STOPS COUNT
SET PULSE WIDTH MODE 2, START SPM2 6802 TPA*EF2->COUNTER CLOCK; EF2 _/¯ STOPS COUNT
ENABLE TOGGLE Q ETQ 6809 IF COUNTER=01 • NEXT COUNTER CLOCK _/¯; !Q->Q
INTERRUPT CONTROL
EXTERNAL INTERRUPT ENABLE XIE 680A 1->XIE
EXTERNAL INTERRUPT DISABLE XID 680B 0->XIE
COUNTER INTERRUPT ENABLE CIE 680C 1->CIE
COUNTER INTERRUPT DISABLE CID 680D 0->CIE
CALL AND RETURN
STANDARD CALL SCAL R1,xxxx 688N RN.0->M(RX); RN.1->M(RX-1); RX-2->RX; RP->RN; M(RN)->RP.1; M(RN+1)->RP.0; RN+2->RN
STANDARD RETURN SRET RN 689N RN->RP; M(RX+1)->RN.1; M(RX+2)->RN.0; RX+2->RX