ʶһѵ¡ͧ CPU 8086

çҧʶһѵ¡ͧ CPU 8086 (8086 block diagram)
8086 ʹ 20 ҧʹ֧ 1,045,576 亵 ( 1 亵) ҡ 16 ͧҴ 8 Ե data bus Ҵ 16 Ե 8086 ö¡ 1 2 亵ѧѺҹ CPU ҹ Ѻػóҹѹ 8086

ٻʴ block diagram ͧ CPU 8086

Register ͧ CPU 8086

ըͧ 8086 СͺըѺشʧ, ը flag ૡ ը ըҹѺҧ address ʴʶҹͧͧ Ѻ fetch
ôըͧ 8086 ը좹Ҵ 16 Ե ը AX Сͺ AH AL AX ˹ٳը ǡѺԹصҵص AL ˹ӹdz ٳ ҹǡѺԹص ҵط ŧ ѴӹdzŢ ҹԺẺ 8 Ե ǹ AH ըٳ BX ŧ CX ѴǡѺʵԧ CL Ѻ͹ԵعԵ DX ٳ ٻҧԹصҵصẺ SP Ѻᵡ SI DI ѺǡѺʵԧ

ٻʴը 8086

ըҹͧ 8086

ը 8086 Сͺ ըҧ source ը ҧ destination BX(base) , SP (stack pointer), BP (base pointer), SI (source index) DI (destination index) öҧ address ѧٻ

ٻʴçҧըͧ 8086 Ѻӹdzʹ

ը좹Ҵ 16 Ե AX (accumulator) , BX (base) , CX (counter) DX (data) ѧ١͡ (AH, BH, CH DH) ҧ (AL, BL, CL DL) ըҨҹѡɳ  ը ը pointer index ѡ ҧ address ѧá ҧԵ ʵͨԡ
ը BP SP ѡ˹ address Ѻҡ ѡ͹ᵡͧ CPU 8 Ե ǹ BP Ѻ ǡ ա˹ Ըӹдǡ ҹҧ ᵡ ͧҧ ը SI DI Դ͡Ѻ˹ ҹǡ ʵԧ ҹ block §çҧẺ array
fetch ͧ 8086 IP (instruction pointer) Ҵ 16 Ե ˹ address ͧ Ѵ١ҹ ԧ IP ˹˹ç ӹdz͹
8086 flag ʶҹӹǹ 6 Ե flag Ǻӹǹ 3 Եèը좹Ҵ 16 Ե


ٻʴ flag ͧ 8086 ͺҹͧ CPU

flag ١͡ʴͧáҧԵʵͨԡʶҹ ͧ flag ͧʶҹ ١ ૵ 1١ 0 硵 (carry flag) ʴ ѡɳ͡ ͧԵ٧شͧѾ , 硾Ե (parity flag) ʴӹǹͧŢ 1 ը flag ١ 1, 硷 (auxiliary carry flag) ҹẺ "decimal adjust", ٹ (zero flag) 1 Ѿٹ , ͧ (sign flag) Ѻ ѾŢź , (OF) ʴԴҴ ӹdz ͧҡͧͧѾ   ǡŢ +127 Ѻ +2 ѾԴӹdzͧͺ -127 Դ ѡɳ Դ 1
硤Ǻҧͧ 8086 (direction flag)˹ҧͧǡѺʵԧ ҹҡʹҡ ҡʹҡͧ , ԹѾ (IE) Ѻ 1

ʴѺԹѾҡ͡ Tap flag (TF) 8086 ҹ Ẻ

ը

4 CS(code segment) , DS(data segment) , SS(stack segment), ES(extra segment) ѡ͡ʹͧ 8086 ˹ ѺѴǹ˭ code (ش) , (Ţ ѡ) ᵡѺʹѺ׹ҡ ͧѹѺʹ ֧˹ ¡ѹ
8086 ͧѡɳͧ˹ ˹ ٻͧ ૡ ˹ ૡ֧ 64 亵 ૡ ʴʹ ͧ˹Դ ѧٻ CS èʴʹͧ DS data segment SS ES ˹ segment ͧ¡ global data segment

ʴ͹ paragraph ͹ҧ 4 Ե ˹ ҧ ʹú 20 شͧ paragraph ͧ 4 Ե ѧش 0 00000H, 00010H , 00020H
ҡٻ ͧ SS ˹ͧ D89F0 ѧࡵǹ ͧ˹ Ҩ Ѻdzѹͧ˹

Դ͡Ѻ˹亵˹ 8086 Ϳ૵ ҧ ˹觵 شͧʹ ˹ ҡǡ ૡ ըѺͧͿ૵ 16 Ե

E89F Ϳ૵ 0003H ҧʹ 89F3
ૡըͿ૵ѺԴͧ ѧʴҧ
      Դͧҧ˹
      ͡
      Ϳ૵ 
      CS
      -
      IP
      SS
      -
      SP
      ˹
      DS
      CS,ES,SS
      ʹ˹
      ʵçҧ
      DS
      CS,ES,SS
      SI
      ʵԧҧ
      ES
      -
      DI
      ը BP
      SS
      CS,ES,SS
      ʹ˹

Ѵͧ 8086

8086 § 40 ʹ multiplex Ѻ 16 AD0 - AD15ѧʹ ա 4 A16 - A19 multiplex Ѻ S3 - S6 ͡ҡ ѭҳǺ Ѵ ʴѧٻ

ͧҡ 8086 ʢҴ 16 Ե ѧԴ͡Ѻѡɳ亵 ѧ 16 Ե ֧亵٧亵 çҧ͡Ѻ˹֧¡ /BHE ѭҳ͡亵٧
        ˹
        Դ
        AD0 - AD15 ʹ 2 ҧẺͨԡʶҹ
        A16/S3 - A17/S4 ʹ/͡ ҵصẺͨԡʶҹ
        A18/S5 ʹ/ԹѾ ҵطẺͨԡʶҹ
        A19/S6 ʹ/Եʴʶҹ ҵصẺͨԡʶҹ
        /BHE/S7 ͡亵캹/Եʴʶҹ ҵصẺͨԡʶҹ
        RD ԵǺҹ ҵصẺͨԡʶҹ
        READY ԵǺѧ Wait Թص
        /TEST ͡Ѻͺ Թص
        INTR ԹѾ Թص
        NMI ͹ԹѾ Թص
        RESET Թص
        CLK ѭҳԡ Թص
        MN/MX 0 ֧кԴ 

        maximum system

        S0S1S2 ͡ʶҹ machine cycle ҵصẺͨԡʶҹ
        /RQ/GTO,/RQ/GTI ԵǺѺӤѭͧ ͧҧ
        GSO,QSI Եʴͧ ҵص
        /LOCK ʤǺ hold ҵصẺͨԡʶҹ
        M/IO ͡˹Թصҵص ҵصẺͨԡʶҹ
        /WR ¹ ҵصẺͨԡʶҹ
        /ALE ŷʹ ҵص
        DT/R Ѻ ҵصẺͨԡʶҹ
        /DEN Ţ ҵصẺͨԡʶҹ
        /INTA  ͺѺԹѾ ҵص
        HOLD ͡ hold Թص
        HOLDA ͺѺ hold ҵص
        Vcc GND ground

ԹѾͧ 8086

ԹѾͧ 8086 öҡ ԹѾҨ ҡ ػó ͡ ҧ software ҡ 8086 ͧ ԹѾҡػó͡ ҧ 2 INTR(interrupt

request) NMI(non-maskable interrupt) INTR ١˹ҹ IE(interrupt enable flag) ǹ˹ͧ 8086 flag flag IE ١ 8086 öѺԹѾҡ INTR
IF ١ 8086 ѺԹѾҡ INTR ǹ NMI ԹѾöش ѡ óԴ˵óӤѭԴԴҴͧԵͧ ˹ (memory parity) Դ
INTO (interrupt overflow) ԹѾͧ 8086 ԴҡԴҴͧ ҹ ԴҴҡ (divide error) ԴͧҡͧҨҡ

Ѿ ҨԴҡŢ 0 ҨԴŢ 1 Ţҡ ǹѡɳͧҹ (single step) ԹѾ Դͧҡ execute ˵óԴͧҡ TF (trap flag) ը硶١ 1
ԴԹѾԴ˵óҧԹѾ ҡ͡ شش١ execute ͹ (¡ MOV POP execute ͹

֧ش) ԹѾء ͧը 8086 ૵ IF TF 0 ͧѹ INTR Թص ͧѹԴҹ
ԹѾ ͧҡ硶١ѧҡԹѾ شҧ ١֧Ѻҹ ҡ 8086 ͧ CS IP ŧ˹
ͧʹѺ (return address) ѡɳ Ѻ far CALL ͹ش CS IP ١ҹҡ ҧͧ interrupt vector (鹡ѺŢԹѾ) ҧͧ interrupt vector ͺೢͧ
ͧ˹ ʹ 0000 ӹǹ ˹亵ѧʴٻ

ԹѾѧ˹͹ ö֧˹ ѵѵ ԴԹѾҡѡɳͧ divide error ԴԹѾ 0, single-step ԹѾ 1,

ԹѾẺ non- maskable ẺԹѾ 2 , bread-oint ԴԹѾ 3 , Դ over flow ԹѾ 4 ǹ Թ Ѿ 5 ֧ 31 Ѻ ˹ͧѧ ǹԹѾҨ Ǻ INTR INT
Ѻ INTR ͺѺѭҳԹѾҡ͡ ǹ INT Ѻ ͧ 8086 öѺԴͧԹѾ ٳ 4 ͧ Ѿ͡˹ͧҧ

ԹѾ ͧҧ١ѧ CS IP ҧ ҧ ͧ ˹˹ͧͧͿ ૵ ʴ˹ͧ ԹѾ ¡ҧ ԹѾʹ 0 ֧ 3 ͧ ˹͡ʹ CS IP չͧ divide error
ԹѾ ͧͧըҧ ͹ Һ ԴԹѾ֧ش ͧ ը ҧ ͧ Դչ IRET ҹ͹ RET ҹͧ͡ ҡᵡ
INT öǨͺ˹˹Ţ ʴԹ Ѿ ¡ҹдǡ
INTO ԹѾǨͺ͹ over flow ԴԹѾ Ţ 4 OF 1 0 ԹѾ execute Ѵ
2 Ǩͺ INT 3 ѧ˹͡شش execute ֧ѧԹѾ չҨըҧ ŧ˹˹ ˹
աԸ˹Ǩͺ (debug) Ҩ૵ (trap flag) 1 8086 ѴԴ INT 1 (single-setp) ء¡ MOV POP Դ͡Ѻը


Ǻҡ ¹ Online Ԫ 204323 С͡Ẻä .׹ ó