Z380 [9]

ZXNet echo conference «zx.spectrum»

From Walerij Kozhevnikov (500:95/462. To All 6 April 1998


===Cut ===
╔═════════════════ ═════════════════════════ ════════════════════╗
║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ MPU Z380 ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║
╚═══════════════════════ ════════════════════════════ ═══════════ў
(Continued. Previous publications are in numbers 8,7,6).

(C) WLODEK BLACK

Addressing methods.

To calculate (obtain) the physical address of the operand used when executing a particular command, various addressing methods are used. The authors of the corporate description divided
them into 7 groups, 6 of which were present in the Z80, and one - relative stack addressing - was added.

Register addressing. The operand is contained in the 8-bit register
A,B,C,D,E,H,L,IXU,IYU,IXL,IYL,A',B',C',D',E',H',L', or in the 16-
or 32-bit register BC,DE,HL,IX,IY,BC',DE',HL',IX',IY', and
also in register SP or in registers I or R. For example: LD HL,I;
LD IY,DE; LD BC,IX; EX D,D'.

Direct addressing. The operand is contained directly
in the instruction code. The DDIR IB or DDIR IW
decoding directives allow you to identify a 24- or 32-bit immediate
operand.

Indirect register addressing. The address of the operand is contained in a
register (pair). HL has advantages over other pairs in
the shortness of the opcode, but BC and DE can do everything too. IX and
IYcan be used to address JP. BC addresses the space of I/O devices.

Direct addressing. The address of the operand is part of the instruction code. The normal address value is 16-bit, but decoding directives can be used to set a 24- or 32-bit absolute address.

Index addressing. The absolute address of the operand is calculated by adding the contents of index register IX or IY with the offset included in the instruction. Offset is a signed number in the most significant digit. The normal offset value is 8 bits, but
it can be extended to 16 or 24 bits using DDIR.

Addressing with an offset relative to the program counter or stack pointer. 1. Regarding the PC program counter. This way you can address JP and JR transitions and CALL subroutine calls, for example:
JR NZ,eee (eee is a 24-bit offset); CALR PE,ee (CALR - Call
Relative). For commands of this subgroup, no decoding directives are used - each of these commands has an individual code
and its own mnemonics in the assembler. 2. Regarding SP. The normal offset value is 8 bits. Extension to 16 or 24 bits
is done through DDIR.

The mnemonic DDIR IB, DDIR IW is indicated first in the general mnemonic
of the command (see, for example, DDIR IW OUTA... in the input-output examples).
The assembler will generate the necessary prefix to the codecommands.
"DDIR IB" means "add a byte", that is, if the default
operand was a byte, it will become a word one, and if it was 16-bit, it will
become 24-bit.
"DDIR IW" means "add a word", that is, 16 bits. The 8-bit
operand will become 24-bit, and the 16-bit will expand to 32 bits.

Instruction system. Instruction groups.

The authors divided the instruction system into 17 groups:

8-bit boot;
16- and 32-bit boot;
PUSH/POP;
register exchange, block transfers and comparisons;
8-bit arithmetic and logic;
processor control instructions and global arithmetic instructions
like DAA;
decoding directives;
16- and 32-bit arithmetic;
multiply and divide instruction group;
8-bit shifts;
16-bit shifts;
8-bit single bit operations (SET, RES, BIT);
jumps;
subroutine calls, subroutine returns, and group RST;
8-bit I/O in external I/O space;
8-bit I/O in internal I/O space;
16-bit I/O.

Conventions used
in instruction descriptions.

dst - destination operand
src - source operand
dst(m-n) - bits n to m, for example: HL(23-16) - 16..23 bits
pair HL
n - 8-bit constant
nn - 16-bit constant
d - 8-bit offset
r - registergeneral purpose
s - 8-bit address
dd,qq,ss,tt,uu - any 16-bit element, the essence of the address or
offset used in addressing
xxh - h - designation of the high byte, where "xx" is any
16-bit operand
xxl - l - low byte
SR - control register
(C) - indication of indirect addressing of input-output
by pair BC
cc - condition, for example Z; NC; PE, etc.
[ ] - optional component
( ) - indication of indirect addressing
<- - forwarding direction, for example: HL <- HL+DE -
place the result of the addition HL+DE in HL

Flag designations:

S - Sign
Z - Zero
H - Half carry
P/V - Parity/oVerflow (parity/overflow)
N - Add/Subtract (addition/subtraction)
C - Carry (carry)

? - the flag receives an unpredictable, untrue value
. - the flag does not change the value
0 - the flag is reset to 0
1 - the flag is set to 1
V - P/V flag reflects overflow
P - P/V flag reflects parity

Condition designations:

Z - Zero (equal to zero or equal to each other)
NZ - Not Zero (not equal to zero or not equal to each other)
C - Carry (there is a carry)
NC - No Carry
S - Sign (sign flag set)
NS - No Sign (sign flag cleared)
NV - No oVerflow (P/V flag cleared)
V - oVerflow (P/V flag set)
PE - Parity Even (even result)
PO -Parity Odd (odd result)
P - Positive (non-negative result; flag S is cleared)
M - Minus (negative result; flag S is set).

As you can see, new condition codes have been introduced that make specifying conditions more convenient, although no new conditions themselves have appeared (since no new flags have appeared).

(Continued) follows).

Jason.

Powered by ScorpionZS256turbo+/SMUC/HDD'IDE130Mb/FDD'800/
/CMOS/Covox/ATkbd/Mouse/CDOS...

=== Cut ===