addition

ZXNet echo conference «code.zx»

From 500:812/29.03 To BCEM 20 February 1998

Greetings! Making our way through the thorns of assembler, I came across a couple of commands: ADD and ADC. If anyone knows the semantic difference between these commands, except for the memory occupied by commands ty and the cost of clock cycles for execution, then write pls. -+- ZXASM3.0

From 500:812/22.01 To Sergej Pougachev 22 February 1998

┌┐ CM07p├0 B┴┴py┌ 02/20/98, B 7:56 ├┤ekT0 Sergej Pougachev ┌┐│/│Ca/ k BCEM ┌┐p0 addition: ├┤i Sergej & BCEM! SP> Greetings! SP> Making our way through the thorns of assembler SP> I came across a couple of commands: ADD and ADC. SP> If anyone knows the semantic difference between these SP> commands, except for memory occupied by commands - SP> and the cost of clock cycles for execution, then SP> write pls. COMMAND BYTES BLOCKS LOGIC ADD A,R 1 4 A=A+R ADC A,R 1 4 A=A+R+C ADD A,(HL) 1 7 A=A+(HL) ADD A,(II+n) 3 19 A=A+(II+n) ADC A,(HL) 1 7 A=A+(HL)+C ADC A,(II+n) 3 19 A=A+(II+n)+C ADD HL,XX 1 11 HL=HL+XX ADD IX,QQ 2 15 IX=IX+QQ ADD IY,WW 2 15 IY=IY+WW ADC HL,XX 2 15 HL=HL+XX+C NOTATIONS: C - CARRY FLAG R - 8 BIT REGISTER A,B,C,D,E,H,L XX - REGISTER PAIR HL,DE,BC,SP QQ - REGISTER PAIR IX,DE,BC,SP WW - REGISTER PAIR IY,DE,BC,SP (HL) - CONTENTS OF MEMORY CELL (1 BYTE) BY ADDRESSED REGISTER PAIR HL II - INDEX REGISTER IX,IY(II+n) - CONTENTS OF THE ADDRESSED MEMORY CELL INDEX REGISTER WITH OFFSET n Among other things, there are still undocumented commands, working with 1 register of index register pairs. ADD A,Z ADC A,Z Z IS THE LOW OR HIGH BYTE OF REGISTERS IX OR IY. COMMANDS ARE EXECUTED IN 8 CLOCKS. Wi7h be57 Wi5he5, FK0. -+- SMM version 1.05