back | Last regenerated: 2022-04-20 17:31:36 kio |
8080 instructionsThese are the instructions which are common to the Command Line Options: --z80 Note: for the 8080 assembler mnemonics see chapter '8080 assembler instructions'. nop ld RR,NN RR = BC DE HL SP add hl,RR inc RR dec RR ld (bc),a ld a,(bc) ld (de),a ld a,(de) ld (NN),hl ld hl,(NN) ld (NN),a ld a,(NN) inc R R = B C D E H L (HL) A dec R ld R,N rlca rrca rla rra daa cpl scf ccf halt ld R,R R = B C D E H L (HL) A except ld (hl),(hl) add a,R R = B C D E H L (HL) A adc a,R sub a,R sbc a,R and a,R xor a,R or a,R cp a,R ret ret CC jp NN jp CC,NN call NN call CC,NN rst N pop RR RR = BC DE HL AF push RR RR = BC DE HL AF add a,N adc a,N sub a,N sbc a,N and a,N xor a,N or a,N cp a,N out (N),a in a,(N) ex (sp),hl ex de,hl di ld sp,hl ei Z80 instructionsList of all Command Line Options: --z80 ex af,af' exx djnz DIS jr DIS jr nz,DIS jr z,DIS jr nc,DIS jr c,DIS rlc R R = B C D E H L (HL) A rrc R rl R rr R sla R sra R srl R bit N,R res N,R Pseudo instructions: defl, set and '=' Z180 instructionsThese are the instructions added in the Command Line Options: --z180 in0 R,(N) R = B C D E H L F A mult RR RR = BC DE HL SP out0 (N),R R = B C D E H L A otim otdm otimr otdmr slp tst R R = B C D E H L (HL) A tst N tstio N Illegal instructionsList of all illegal Command Line Options: --z80 Undocumented opcodes after a combination of index register plus prefix 0xCB behave differently on different CPU brands. On CPUs like the Command Line Options: --z180 sll R R = b c d e h l (hl) a out (c),0xFF for NMOS CPUs out (c),0 for CMOS CPUs in f,(c) in (c) syntax variant inc R R = xh, xl, yh, yl or syntax variant: ixh, ixl, iyh, iyl dec R ld R,N add a,R adc a,R sub a,R sbc a,R and a,R xor a,R or a,R cp a,R ld R1,R2 R1 = b c d e xh xl a and R2 = xh or xl ld R1,R2 R1 = b c d e yh yl a and R2 = yh or yl ld R1,R2 R1 = xh or xl and R2 = b c d e xh xl a ld R1,R2 R1 = yh or yl and R2 = b c d e yh yl a --Command Line Options: --ixcbxh, .ixcbxh, _ixcbxh_ Syntax variantszasm supports different syntax for some opcodes: ex hl,de ex de,hl ex (sp),RR ex RR,(sp) RR = hl, ix, iy jp (RR) jp RR in R,(c) in R,(bc) out (c),R out (bc),R R = b c d e h l (hl) a in a,(N) in a,N out (N),a out N,A rst 0 rst 0 rst 1 rst 8 rst 2 rst 16 rst 3 rst 24 rst 4 rst 32 rst 5 rst 40 rst 6 rst 48 rst 7 rst 56 add a,R add R R = b c d e h l (hl) a adc a,R adc R and (ix+dis) (iy+dis) sub a,R sub R sbc a,R sbc R and a,R and R xor a,R xor R or a,R or R cp a,R cp R Some variants apply to notation for arguments: ld a,N ld a,#N ld a,(ix+0) ld a,(ix) ld a,(ix+dis) ld a,dis(ix) Beyond that, zasm provides convenience definitions for compound instructions to increase readability and maintainability by reducing the number of lines in a source files. Convenience definitionsThese are convenience definitions for combinations of real instructions. Those which are made from illegal opcodes can't be used for the Command Line Options: --z180 All opcodes which do not use the index registers or the 0xCB group can also be used for the 8080. All these combinations have no side effect. ld bc,de ld bc,hl ld de,bc ld de,hl ld hl,bc ld hl,de ld bc,ix ; illegal ... ld bc,iy ; ... ld de,ix ; ... ld de,iy ; ... ld ix,bc ; ... ld ix,de ; ... ld iy,bc ; ... ld iy,de ; ... ld bc,(ix+dis) ld bc,(iy+dis) ld de,(ix+dis) ld de,(iy+dis) ld hl,(ix+dis) ld hl,(iy+dis) ld (ix+dis),bc ld (iy+dis),bc ld (ix+dis),de ld (iy+dis),de ld (ix+dis),hl ld (iy+dis),hl ld bc,(hl) ld de,(hl) ld bc,(hl++) ld de,(hl++) ld bc,(--hl) ld de,(--hl) ld (hl),bc ld (hl),de ld (--hl),bc ld (--hl),de ld (hl++),bc ld (hl++),de ld (--bc),a ld (--de),a ld (bc++),a ld (de++),a ld a,(--bc) ld a,(--de) ld a,(bc++) ld a,(de++) ld R,(hl++) ld R,(--hl) rr bc ; 0xCB group rr de rr hl sra bc sra de sra hl srl bc srl de srl hl rl bc rl de rl hl sla bc sla de sla hl sll bc ; sll undocumented sll de ; sll undocumented sll hl ; sll undocumented rr (hl++) ; 0xCB group rrc (hl++) rl (hl++) rlc (hl++) sla (hl++) sra (hl++) sll (hl++) ; sll undocumented srl (hl++) bit N,(hl++) Pseudo instructions: defl, set and '=' Load/store Quad Registerssince version 4.4.2. actually, these are not implemented! only usable in '.Run test code and test your expectations: .expect register Quad registers are combinations of two 16 bit registers BC, DE, HL, SP, IX or IY. ld bcde,NNNN ld bchl,NNNN ld bcix,NNNN etc. ld debc,(NN) ld dehl,(NN) ld deix,(NN) etc. ld (NN),hlbc ld (NN),hlde ld (NN),ixiy etc. push bcde push dehl push hlix etc. pop bcde pop dehl pop hlix etc. 8080 assembler instructionsNOP LXI R,D16 R = B D H SP INX R DAD R DCX R STAX B STAX D LDAX B LDAX D INR R R = B C D E H L M A DCR R MVI R,D8 RLC RRC RAL RAR SHLD adr DAA LHLD adr CMA STA adr STC LDA adr CMC MOV R,R R = B C D E H L M A except MOV M,M HLT ADD R R = B C D E H L M A ADC R SUB R SBB R ANA R XRA R ORA R CMP R RET RNZ RZ RNC RC RPO RPE RP RM JMP adr JNZ adr JZ adr JNC adr JC adr JPO adr JPE adr JP adr JM adr CALL adr CNZ adr CZ adr CNC adr CC adr CPO adr CPE adr CP adr CM adr RST N POP R R = B D H PSW PUSH R ADI D8 ACI D8 SUI D8 SBI D8 ANI D8 XRI D8 ORI D8 CPI D8 OUT D8 IN D8 XTHL PCHL XCHG DI SPHL EI 8080 assembler instructions for Z80 opcodesThis table lists the 8080 assembler syntax for the additional opcodes of the Command Line Options: --z80 They were rarely used, because people quickly switched over to the much more readable Zilog Command Line Options: --z80 Most mnemonics are taken from the CROSS manual except the following: RLCR r CROSS-Doc: used RLC which is already used for RLCA, also deviation from naming scheme RRCR r CROSS-Doc: used RRC which is already used for RRCA, also deviation from naming scheme OTDR CROSS-Doc: used OUTDR which is a 5 letter word OTIR CROSS-Doc: used OUTIR which is a 5 letter word DADX rr CROSS-Doc: no opcode for ADD IX,rr DADY rr CROSS-Doc: no opcode for ADD IY,rr PCIX CROSS-Doc: no opcode for JP IX PCIY CROSS-Doc: no opcode for JP IY INC r CROSS-Doc: no opcode for IN r,(c) OUTC r CROSS-Doc: no opcode for OUT (c),r STAR CROSS-Doc: no opcode for LD R,A LDAI CROSS-Doc: no opcode for LD A,I LDAR CROSS-Doc: no opcode for LD A,R Some opcodes were extended to be used with dis(X) and dis(Y) as well. The new registers I, R were not accessed by name but with dedicated mnemonics. The index registers were abbreviated X and Y and an access (IX+dis) was written as dis(X). New mnemonics8080 syntax Command Line Options: --z80 Existing mnemonicsExisting 8080 mnemonics which now also can be used with index registers 8080 syntax Command Line Options: --z80 |