Detailed instructions for use are in the User's Guide.
[. . . ] Z80 Family CPU User Manual
User Manual
80
=L/2* :RUOGZLGH +HDGTXDUWHUV ( +DPLOWRQ $YHQXH &DPSEHOO &$ 7HOHSKRQH )D[ ZZZ=L/2*FRP
= &38 8VHUV 0DQXDO
This publication is subject to replacement by a later edition. To determine whether a later edition exists, or to request copies of publications, contact:
ZiLOG Worldwide Headquarters 910 E. Hamilton Avenue Campbell, CA 95008 Telephone: 408. 558. 8500 Fax: 408. 558. 8300 www. ZiLOG. com
Document Disclaimer
ZiLOG is a registered trademark of ZiLOG Inc. in the United States and in other countries. [. . . ] This greatly reduces interrupt service time by eliminating the requirement for saving and retrieving register contents in the external stack during interrupt or subroutine processing. These general-purpose registers are used for a wide range of applications. They also simplify programing, specifically in ROM-based systems where little external read/write memory is available.
$ULWKPHWLF /RJLF 8QLW $/8
The 8-bit arithmetic and logical instructions of the CPU are executed in the ALU. Internally, the ALU communicates with the registers and the external data bus by using the internal data bus. Functions performed by the ALU include:
80
2YHUYLHZ
< %27 7UGT U /CPWCN
Add Subtract Logical AND Logical OR Logical Exclusive OR Compare Left or Right Shifts or Rotates (Arithmetic and Logical) Increment Decrement Set Bit Reset Bit Test bit
, QVWUXFWLRQ 5HJLVWHU DQG &38 &RQWURO
As each instruction is fetched from memory, it is placed in the INSTRUCTION register and decoded. The control sections performs this function and then generates and supplies the control signals necessary to read or write data from or to the registers, control the ALU, and provide required external control signals.
3, 1 '(6&5, 37, 21 2YHUYLHZ
The Z80 CPU I/O pins are illustrated in Figure 3 and the function of each is described in the following paragraphs.
80
2YHUYLHZ
< %27 7UGT U /CPWCN
M1 MREQ IORQ RD WR RFSH HALT WAIT CPU Control INT NMI RESET CPU Bus Control BUSRQ BUSACK
27 19 20 21 22 28 18 24 16 17 26 25 23
System Control
Z80 CPU
30 31 32 33 34 35 36 37 38 39 40 1 2 3 4 5
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15
Address Bus
CLK +5V GND
6 11 29
14 15 12 8 7 9 10 13
D0 D1 D2 D3 D4 D5 D6 D7
Data Bus
)LJXUH
= , 2 3LQ &RQILJXUDWLRQ
3LQ )XQFWLRQV
$$
Address Bus (output, active High, tristate). The Address Bus provides the address for memory data bus exchanges (up to 64 Kbytes) and for I/O device exchanges.
80
2YHUYLHZ
< %27 7UGT U /CPWCN
%86$&.
Bus Acknowledge (output, active Low). Bus Acknowledge indicates to the requesting device that the CPU address bus, data bus, and control signals MREQ, IORQ RD, and WR have entered their high-impedance states. The external circuitry can now control these lines.
%865(4
Bus Request (input, active Low). Bus Request has a higher priority than NMI and is always recognized at the end of the current machine cycle. BUSREQ forces the CPU address bus, data bus, and control signals MREQ IORQ, RD, and WR to go to a high-impedance state so that other devices can control these lines. BUSREQ is normally wired-OR and requires an external pull-up for these applications. Extended BUSREQ periods due to extensive DMA operations can prevent the CPU from properly refreshing dynamic RAMS.
''
Data Bus (input/output, active High, tristate). D7D0 constitute an 8-bit bidirectional data bus, used for data exchanges with memory and I/O.
+$/7
HALT State (output, active Low). HALT indicates that the CPU has executed a HALT instruction and is waiting for either a non-maskable or a maskable interrupt (with the mask enabled) before operation can resume. During HALT, the CPU executes NOPs to maintain memory refresh.
, 17
Interrupt Request (input, active Low). Interrupt Request is generated by I/O devices. The CPU honors a request at the end of the current instruction if the internal software-controlled interrupt enable flip-flop (IFF) is enabled. INT is normally wired-OR and requires an external pull-up for these applications.
80
2YHUYLHZ
< %27 7UGT U /CPWCN
, 254
Input/Output Request (output, active Low, tristate). IORQ indicates that the lower half of the address bus holds a valid I/O address for an I/O read or write operation. IORQ is also generated concurrently with M1 during an interrupt acknowledge cycle to indicate that an interrupt response vector can be placed on the data bus.
0
Machine Cycle One (output, active Low). M1, together with MREQ, indicates that the current machine cycle is the opcode fetch cycle of an instruction execution. [. . . ] ORQJ DQG FDQ EH PRYHG IURP DQ\ ORFDWLRQ LQ PHPRU\ WR DQ\ RWKHU ORFDWLRQ )XUWKHUPRUH WKH EORFNV FDQ EH RYHUODSSLQJ EHFDXVH WKHUH DUH QR FRQVWUDLQWV RQ WKH GDWD XVHG LQ WKH WKUHH UHJLVWHU SDLUV 7KH LDD DQG LDDR LQVWUXFWLRQV DUH YHU\ VLPLODU WR WKH LDI DQG LDIR 7KH RQO\ GLIIHUHQFH LV WKDW UHJLVWHU SDLUV +/ DQG '( DUH GHFUHPHQWHG DIWHU HYHU\ PRYH VR WKDW D EORFN WUDQVIHU VWDUWV IURP WKH KLJKHVW DGGUHVV RI WKH GHVLJQDWHG EORFN UDWKHU WKDQ WKH ORZHVW 7DEOH VSHFLILHV WKH 2S &RGHV IRU WKH IRXU EORFN VHDUFK LQVWUXFWLRQV 7KH ILUVW CPI &RPSDUH DQG , QFUHPHQW FRPSDUHV WKH GDWD LQ WKH DFFXPXODWRU ZLWK WKH FRQWHQWV RI WKH PHPRU\ ORFDWLRQ SRLQWHG WR E\ UHJLVWHU +/ 7KH UHVXOW RI WKH FRPSDUH LV VWRUHG LQ RQH RI WKH IODJ ELWV DQG WKH +/ UHJLVWHU SDLU LV WKHQ LQFUHPHQWHG DQG WKH E\WH FRXQWHU UHJLVWHU SDLU %& LV GHFUHPHQWHG 7KH LQVWUXFWLRQ CPIR LV PHUHO\ DQ H[WHQVLRQ RI WKH CPl LQVWUXFWLRQ LQ ZKLFK WKH FRPSDUH LV UHSHDWHG XQWLO HLWKHU D PDWFK LV IRXQG RU WKH E\WH FRXQWHU UHJLVWHU SDLU %& EHFRPHV ]HUR 7KXV WKLV VLQJOH LQVWUXFWLRQ FDQ VHDUFK WKH HQWLUH PHPRU\ IRU DQ\ ELW FKDUDFWHU 7KH CPD &RPSDUH DQG 'HFUHPHQW DQG CPDR &RPSDUH 'HFUHPHQW DQG 5HSHDW DUH VLPLODU LQVWUXFWLRQV WKHLU RQO\ GLIIHUHQFH LV WKDW WKH\ GHFUHPHQW +/ DIWHU HYHU\ FRPSDUH VR WKDW WKH\ VHDUFK WKH PHPRU\ LQ WKH RSSRVLWH GLUHFWLRQ 7KH VHDUFK LV VWDUWHG DW WKH KLJKHVW ORFDWLRQ LQ WKH PHPRU\ EORFN 7KHVH EORFN WUDQVIHU DQG FRPSDUH LQVWUXFWLRQV DUH H[WUHPHO\ SRZHUIXO LQ VWULQJ PDQLSXODWLRQ DSSOLFDWLRQV
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
7DEOH %ORFN 7UDQVIHU *URXS 'HVWLQDWLRQ 6RXUFH
(HL) (ED) A0 (ED) B0 (ED) A8 (ED) B8 LDI - Load (DE) (HL) Inc HL and DE, Dec BC LDIR, - Load (DE) (HL) Inc HL and DE, Dec BC, Repeat until BC = 0 LDD - Load (DE) (HL) Inc HL and DE, Dec BC LDDR - Load (DE) (HL) Dec HL and DE, Dec BC, Repeat until BC = 0
Note: Reg HL points to source Reg DE points to destination Reg BC is byte counter
Reg. Indir.
7DEOH %ORFN 6HDUFK *URXS 6HDUFK /RFDWLRQ
Reg. (HL) (ED) A1 (ED) B1 (ED) A9 (ED) B9 CPI Inc HL, Dec BC CPRI. Inc HL, Dec BC Repeat until) BC = 0 or find match WD Dec HL and BC CPDR Dec HL and BC Repeat until BC = 0 or find match
Note: HL points to location in memory to be compared with accumulator contents BC Is byte counter
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
$ULWKPHWLF DQG /RJLFDO
7DEOH OLVWV DOO WKH ELW DULWKPHWLF RSHUDWLRQV WKDW FDQ EH SHUIRUPHG ZLWK WKH DFFXPXODWRU DOVR OLVWHG DUH WKH LQFUHPHQW INC DQG GHFUHPHQW DEC LQVWUXFWLRQV , Q DOO WKHVH LQVWUXFWLRQV H[FHSW INC DQG DEC WKH VSHFLILHG ELW RSHUDWLRQ LV SHUIRUPHG EHWZHHQ WKH GDWD LQ WKH DFFXPXODWRU DQG WKH VRXUFH GDWD 7KH UHVXOW RI WKH RSHUDWLRQ LV SODFHG LQ WKH DFFXPXODWRU ZLWK WKH H[FHSWLRQ RI FRPSDUH CP WKDW OHDYHV WKH DFFXPXODWRU XQFKDQJHG $OO WKHVH RSHUDWLRQV HIIHFW WKH IODJ UHJLVWHU DV D UHVXOW RI WKH VSHFLILHG RSHUDWLRQ INC DQG DEC LQVWUXFWLRQV VSHFLI\ D UHJLVWHU RU D PHPRU\ ORFDWLRQ DV ERWK VRXUFH DQG GHVWLQDWLRQ RI WKH UHVXOW :KHQ WKH VRXUFH RSHUDQG LV DGGUHVVHG XVLQJ WKH LQGH[ UHJLVWHUV WKH GLVSODFHPHQW PXVW IROORZ GLUHFWO\ :LWK LPPHGLDWH DGGUHVVLQJ WKH DFWXDO RSHUDQG IROORZV GLUHFWO\ )RU H[DPSOH WKH LQVWUXFWLRQ AND 07H LV
Address A A+1 E6 07 Op Code Operand
$VVXPLQJ WKDW WKH DFFXPXODWRU FRQWDLQHG WKH YDOXH )+ WKH UHVXOW RI 03H LV SODFHG LQ WKH DFFXPXODWRU $FFXPXODWRU EHIRUH RSHUDWLRQ1111 0011 2SHUDQG
0000 0111 07H 03H F3H
5HVXOW WR $FFXPXODWRU0000 0011
7KH $GG LQVWUXFWLRQ ADD SHUIRUPV D ELQDU\ DGG EHWZHHQ WKH GDWD LQ WKH VRXUFH ORFDWLRQ DQG WKH GDWD LQ WKH DFFXPXODWRU 7KH 6XEWUDFW SUB SHUIRUPV D ELQDU\ VXEWUDFWLRQ :KHQ WKH $GG ZLWK &DUU\ LV VSHFLILHG ADC RU WKH 6XEWUDFW ZLWK &DUU\ SBC WKHQ WKH &DUU\ IODJ LV DOVR DGGHG RU VXEWUDFWHG UHVSHFWLYHO\ 7KH IODJV DQG GHFLPDO DGMXVW LQVWUXFWLRQ DAA LQ WKH = DOORZ DULWKPHWLF RSHUDWLRQV IRU
80
Multiprecision packed BCD numbers Multiprecision signed or unsigned binary numbers Multiprecision two's complement signed numbers
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
2WKHU LQVWUXFWLRQV LQ WKLV JURXS DUH ORJLFDO DQG AND ORJLFDO RU OR H[FOXVLYH RU XOR DQG FRPSDUH CP )LYH JHQHUDOSXUSRVH DULWKPHWLF LQVWUXFWLRQV RSHUDWH RQ WKH DFFXPXODWRU RU FDUU\ IODJ 7KHVH ILYH DUH OLVWHG LQ 7DEOH 7KH GHFLPDO DGMXVW LQVWUXFWLRQ FDQ DGMXVW IRU VXEWUDFWLRQ DV ZHOO DV DGGLWLRQ PDNLQJ %&' DULWKPHWLF RSHUDWLRQV VLPSOH 1RWH WKDW WR DOORZ IRU WKLV RSHUDWLRQ WKH IODJ 1 LV XVHG 7KLV IODJ LV VHW LI WKH ODVW DULWKPHWLF RSHUDWLRQ ZDV D VXEWUDFW 7KH QHJDWH DFFXPXODWRU NEG LQVWUXFWLRQ IRUPV WKH WZRV FRPSOHPHQW RI WKH QXPEHU LQ WKH DFFXPXODWRU )LQDOO\ QRWLFH WKDW D UHVHW FDUU\ LQVWUXFWLRQ LV QRW LQFOXGHG LQ WKH = EHFDXVH WKLV RSHUDWLRQ FDQ EH HDVLO\ DFKLHYHG WKURXJK RWKHU LQVWUXFWLRQV VXFK DV D ORJLFDO $1' RI WKH DFFXPXODWRU ZLWK LWVHOI 7DEOH OLVWV DOO WKH ELW DULWKPHWLF RSHUDWLRQV EHWZHHQ ELW UHJLVWHUV 7KHUH DUH ILYH JURXSV RI LQVWUXFWLRQV LQFOXGLQJ DGG ZLWK FDUU\ DQG VXEWUDFW ZLWK FDUU\ ADC DQG SBC DIIHFW DOO WKH IODJV 7KHVH WZR JURXSV VLPSOLI\ DGGUHVV FDOFXODWLRQ RSHUDWLRQV RU RWKHU ELW DULWKPHWLF RSHUDWLRQV
7DEOH %LW $ULWKPHWLF DQG /RJLF
Tpr
Srtvr6qqrvt
SrtDqv
Dqrrq
Drq
A ADD 87
B 80
C 81
D 82
E 83
F 84
L 85
(HL) 88
(IX+d) DD 86 d DD 8E d DD 96 d DD 9E d DD A6 d
(lY+d) FD 86 d FD 8E d FD 96 d FD 9E d FD A6 d
n C6 n CE n D6 n DE n E6 n
ADD W CARRY ADC SUBTRACT SUB SUB w CARR SBC AND
8F
88
89
8A
8B
8C
8D
8E
97
90
91
92
93
94
95
96
9F
98
99
9A
9B
9C
9D
9E
A7
A0
A1
A2
A3
A4
A5
A6
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
7DEOH %LW $ULWKPHWLF DQG /RJLF
Tpr
Srtvr6qqrvt
SrtDqv
Dqrrq
Drq
XOR
AF A8
A9
AA AB AC AD AE
DD AE d DD B6 d DD BE d DD 34 d DD 35 d
FD AE d FD B6 d FD BE d FD 34 d FD 35 d
EE n F6 n FE n
OR
B7
B0
B1
B2
B3
B4
B5
B6
COMPARE CP INCREMENT INC DECREMENT DEC
BF B8
B9
BA BB BC BD BE
3C
04
0C
14
1C
24
2C
34
3D
05
0D
15
1D
25
2D
35
7DEOH *HQHUDO3XUSRVH $) 2SHUDWLRQ
Decimal Adjust Acc, DAA Complement Acc, CPL Negate Acc, NEG (2's complement Complement Carry Flag, CCF Set Carry Flag, SCF 27 2F ED 44 3F 37
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
7DEOH %LW $ULWKPHWLF 6RXUFH
BC Destination ADD HL 09 DE 19 HL 29 SP 39 DD DD 39 29 FD 39 ED 6A ED 62 23 2B ED 7A ED 72 33 DD FD 23 23 FD 29 IX IY
IX DD DD 09 19 IY FD 09 FD 19 ED 5A ED 52 13 1B
ADD with carry and set flags ADC SUB with carry and set flags SBC Increment INC Decrement DEC
HL ED 4A HL ED 42 03 DB
3B DD FD 2B 2B
5RWDWH DQG 6KLIW
$ PDMRU IHDWXUH RI WKH = LV WR URWDWH RU VKLIW GDWD LQ WKH DFFXPXODWRU DQ\ JHQHUDOSXUSRVH UHJLVWHU RU DQ\ PHPRU\ ORFDWLRQ $OO WKH URWDWH DQG VKLIW 2S &RGHV DUH GHSLFWHG LQ )LJXUH $OVR LQFOXGHG LQ WKH = DUH DULWKPHWLF DQG ORJLFDO VKLIW RSHUDWLRQV 7KHVH RSHUDWLRQV DUH XVHIXO LQ D ZLGH UDQJH RI DSSOLFDWLRQV LQFOXGLQJ LQWHJHU PXOWLSOLFDWLRQ DQG GLYLVLRQ 7ZR %&' GLJLW URWDWH LQVWUXFWLRQV RRD DQG RLD DOORZ D GLJLW LQ WKH DFFXPXODWRU WR EH URWDWHG ZLWK WKH WZR GLJLWV LQ D PHPRU\ ORFDWLRQ SRLQWHG WR E\ UHJLVWHU SDLU +/ 6HH )LJXUH 7KHVH LQVWUXFWLRQV DOORZ IRU HIILFLHQW %&' DULWKPHWLF
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
7DEOH 5RWDWHV DQG 6KLIWV
Tpr
Type A of Rotate Shift RCL
B
CD
E
F
L
(HL) (IX+d) (lY+d)
A
CY
b7
b0
Rotate Left Circular
CB CB CB CB CB CB CB CB 07 00 01 02 03 04 06 0E
DD CB d 06 DD CB d 0E DD CB d 16 DD CB d 1E DD CB d 26 DD CB d 2E DD CB d 3E
FD CB d 06 FD CB d 0E FD CB d 16 FD CB d 1E FD CB d 26 FD CB d 2E FD CB d 3E
RLCA D7
Rotate Right Circular
RRC
CB CB CB CB CB CB CB CB 0F 08 09 0A 06 0C 0D 0E
RRCA 0F
Rotate Left
RL
CB CB CB CB CB CB CB CB 17 10 11 12 13 14 15 16
RLA
17
Rotate Right
RR
CB CB CB CB CB CB CB CB 1F 18 19 1A 1B 1C 1D 1E
RRA
1F
CY
Shift Left Arithmetic
Shift Right Arithmetic
SLA
CB CB CB CB CB CB CB CB 27 20 21 22 23 24 25 26
Shift Right Logical 0 b3-b0 ACC Rotate b7-b4 b3-b0 (HL) Digit Left
SRA
CB CB CB CB CB CB CB CB 2F 28 29 2A 2B 2C 2D 2E
SRL
CB CB CB CB CB CB CB CB 3F 38 39 3A 3B 3C 3D 3E
ED 6F ED 67
(HL) ACC
Rotate Digit Right
%LW 0DQLSXODWLRQ
7KH DELOLW\ WR VHW UHVHW DQG WHVW LQGLYLGXDO ELWV LQ D UHJLVWHU RU PHPRU\ ORFDWLRQ LV QHHGHG LQ DOPRVW HYHU\ SURJUDP 7KHVH ELWV PD\ EH IODJV LQ D JHQHUDOSXUSRVH VRIWZDUH URXWLQH LQGLFDWLRQV RI H[WHUQDO FRQWURO
80 = &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
FRQGLWLRQV RU GDWD SDFNHG LQWR PHPRU\ ORFDWLRQV PDNLQJ PHPRU\ XWLOL]DWLRQ PRUH HIILFLHQW 7KH = FDQ VHW UHVHW RU WHVW DQ\ ELW LQ WKH DFFXPXODWRU DQ\ JHQHUDO SXUSRVH UHJLVWHU RU DQ\ PHPRU\ ORFDWLRQ ZLWK D VLQJOH LQVWUXFWLRQ 7DEOH OLVWV WKH LQVWUXFWLRQV WKDW DUH DYDLODEOH IRU WKLV SXUSRVH 5HJLVWHU DGGUHVVLQJ FDQ VSHFLI\ WKH DFFXPXODWRU RU DQ\ JHQHUDOSXUSRVH UHJLVWHU RQ ZKLFK WKH RSHUDWLRQ LV WR EH SHUIRUPHG 5HJLVWHU LQGLUHFW DQG LQGH[HG DGGUHVVLQJ DUH DYDLODEOH WR RSHUDWH RQ H[WHUQDO PHPRU\ ORFDWLRQV %LW WHVW RSHUDWLRQV VHW WKH =HUR IODJ = LI WKH WHVWHG ELW LV D ]HUR
-XPS &DOO DQG 5HWXUQ
7DEOH OLVWV DOO WKH MXPS FDOO DQG UHWXUQ LQVWUXFWLRQV LPSOHPHQWHG LQ WKH = &38 $ MXPS LV D EUDQFK LQ D SURJUDP ZKHUH WKH SURJUDP FRXQWHU LV ORDGHG ZLWK WKH ELW YDOXH DV VSHFLILHG E\ RQH RI WKH WKUHH DYDLODEOH DGGUHVVLQJ PRGHV , PPHGLDWH ([WHQGHG 5HODWLYH RU 5HJLVWHU , QGLUHFW 1RWLFH WKDW WKH MXPS JURXS KDV VHYHUDO FRQGLWLRQV WKDW FDQ EH VSHFLILHG EHIRUH WKH MXPS LV PDGH , I WKHVH FRQGLWLRQV DUH QRW PHW WKH SURJUDP PHUHO\ FRQWLQXHV ZLWK WKH QH[W VHTXHQWLDO LQVWUXFWLRQ 7KH FRQGLWLRQV DUH DOO GHSHQGHQW RQ WKH GDWD LQ WKH IODJ UHJLVWHU 7KH LPPHGLDWH H[WHQGHG DGGUHVVLQJ LV XVHG WR MXPS WR DQ\ ORFDWLRQ LQ WKH PHPRU\ 7KLV LQVWUXFWLRQ UHTXLUHV WKUHH E\WHV WZR WR VSHFLI\ WKH ELW DGGUHVV ZLWK WKH ORZ RUGHU DGGUHVV E\WH ILUVW IROORZHG E\ WKH KLJK RUGHU DGGUHVV E\WH )RU H[DPSOH DQ XQFRQGLWLRQDO MXPS WR PHPRU\ ORFDWLRQ 3E32H LV
Address A A+1 A+2 C3 32 3E Op Code Low Order Address High Order Address
7KH UHODWLYH MXPS LQVWUXFWLRQ XVHV RQO\ WZR E\WHV WKH VHFRQG E\WH LV D VLJQHG WZRV FRPSOHPHQW GLVSODFHPHQW IURP WKH H[LVWLQJ 3& 7KLV GLVSODFHPHQW FDQ EH LQ WKH UDQJH RI WR DQG LV PHDVXUHG IURP WKH DGGUHVV RI WKH LQVWUXFWLRQ 2S &RGH
80
= &38 , QVWUXFWLRQ 'HVFULSWLRQ
< %27 7UGT U /CPWCN
7KUHH W\SHV RI UHJLVWHU LQGLUHFW MXPSV DUH DOVR LQFOXGHG 7KHVH LQVWUXFWLRQV DUH LPSOHPHQWHG E\ ORDGLQJ WKH UHJLVWHU SDLU +/ RU RQH RI WKH LQGH[ UHJLVWHUV ; RU , < GLUHFWO\ LQWR WKH 3& 7KLV IHDWXUH DOORZV IRU SURJUDP MXPSV WR EH D IXQFWLRQ RI SUHYLRXV FDOFXODWLRQV $ FDOO LV D VSHFLDO IRUP RI D MXPS ZKHUH WKH DGGUHVV RI WKH E\WH IROORZLQJ WKH FDOO LQVWUXFWLRQ LV SXVKHG RQWR WKH VWDFN EHIRUH WKH MXPS LV PDGH $ UHWXUQ LQVWUXFWLRQ LV WKH UHYHUVH RI D FDOO EHFDXVH WKH GDWD RQ WKH WRS RI WKH VWDFN LV SRSSHG GLUHFWO\ LQWR WKH 3& WR IRUP D MXPS DGGUHVV 7KH FDOO DQG UHWXUQ LQVWUXFWLRQV DOORZ IRU VLPSOH VXEURXWLQH DQG LQWHUUXSW KDQGOLQJ 7ZR VSHFLDO UHWXUQ LQVWUXFWLRQ DUH LQFOXGHG LQ WKH = IDPLO\ RI FRPSRQHQWV 7KH UHWXUQ IURP LQWHUUXSW LQVWUXFWLRQ RETI DQG WKH UHWXUQ IURP QRQPDVNDEOH LQWHUUXSW RETN DUH WUHDWHG LQ WKH &38 DV DQ XQFRQGLWLRQDO UHWXUQ LGHQWLFDO WR WKH 2S &RGH C9H 7KH GLIIHUHQFH LV WKDW RETI FDQ EH XVHG DW WKH HQG RI DQ LQWHUUXSW URXWLQH DQG DOO = SHULSKHUDO FKLSV UHFRJQL]H WKH H[HFXWLRQ RI WKLV LQVWUXFWLRQ IRU SURSHU FRQWURO RI QHVWHG SULRULW\ LQWHUUXSW KDQGOLQJ 7KLV LQVWUXFWLRQ FRXSOHG ZLWK WKH = SHULSKHUDO GHYLFHV LPSOHPHQWDWLRQ VLPSOLILHV WKH QRUPDO UHWXUQ IURP QHVWHG LQWHUUXSW :LWKRXW WKLV IHDWXUH WKH IROORZLQJ VRIWZDUH VHTXHQFH LV QHFHVVDU\ WR LQIRUP WKH LQWHUUXSWLQJ GHYLFH WKDW WKH LQWHUUXSW URXWLQH LV FRPSOHWHG
Disable Interrupt Prevent interrupt before routine is exited. [. . . ]