IT DOS 3.0 INT 62H, BX PSP, PSP. COM- ------------------------------------------------------------ EXE-, COM- . COM- , DOS "" , - COM. IBM PC. 22 38 , COM- EXE- . INT 20H ( DOS). COM- DOS PSP. 64 (.FFFE) , . . .100 ( PSP). CS:IP, .. PSP. COM- . RET IP , . CS:IP PSP, INT 20H. COMMAND.COM. ( INT 20H RET, COMMAND.COM). EXE- ------------------------------------------------------------ EXE-, , : 1) - , 2) . , , , . : 00 .4D5A. EXE-. 02 EXE-. 04 512 EXE-, . 06 . 08 16- () , ( , ). OA , . OC . , . . .0000 , .FFFF - . , . IBM PC. 22 39 OE . 10 , SP . 12 - ( ) . 14 , IP . 16 . CS. 18 . 1A : , EXE-. 1C , , 06. 512 , . 06 , . , 1C , . COMMAND.COM, . COMMAND.COM : . ( 04 08) . ( OE). SS SP . DS ES . CS PSP ( 16) CS. PSP, 256 (.100). CS:IP , .. . CS SS , DS ( ES) : 1. PUSH DS ; PSP 2. SUB AX,AX ; IBM PC. 22 40 3. PUSH AX ; 4. MOV AX,datasegname ; DX 5. MOV DS,AX ; RET IP , . CS:IP , PSP, INT 20H. , DOS. EXE- ------------------------------------------------------------ (MAP) : Start Stop Length Name Class 00000H 0003AH 003BH CSEG CODE 00040H 0005AH 001BH DSEG DATA 00060H 0007FH 0020H STACK STACK Program entry point at 0000:0000 MAP ( ) . H . , , . MAP CSEG 00000 - . .003B . DSEG .00040 .001B. .00040 CSEG , (.. .10). , STACK, .00060 - DSEG, . DEBUG , DOS . , ( ), . ( ). 00 .4D5A. 02 : 5B00. 04 512 , : 0200 (.0002512=1024). IBM PC. 22 41 06 , : 0100, .. 0001. 08 16 : 2000 (.0020=32 3216=512). 0C : .FFFF. 0E : 6000 . 60. 10 SP: 2000 .20. 14 IP: 0000. 16 C CS: 0000. 18 C : 1E00 .1E. DEBUG : SP = 0020 DS = 138F ES = 138F SS = 13A5 CS = 139F IP = 0000 EXE- DS ES , , IP, SS SP - . SP .20 . , 16 DUP (?), .. 16 32 (.20) . SP . CS DS , PSP .138F(0). PSP .100 , , PSP, .138F0+100= 139F0. CS. , CS (CSEG). D CS:0000 DEBUG . LST , R. SS SS : PSP (.DS) 138F0 PSP 100 IBM PC. 22 42 60 13A50 DS DS PSP. , DS : 0004 B8 ---- R MOV AX,DSEG 0007 8E D8 MOV DS,AX DSEG, . DEBUG : B8 A313 A313 DS 13A3. CS 139F0 00 DS 13A30 40 SS 13A50 60 DEBUG : PUSH DS IP SP SUB AX,AX IP AX ( ) PUSH AX IP SP MOV AX,DSEG IP AX MOV DS,AX IP DS DS . D DS:00 DSEG D SS:00 . ------------------------------------------------------------ , . .4B . ASCIIZ- DX, IBM PC. 22 43 BX ( ES:BX). AL 0 3: AL=0. . , Cntrl/Break . , SP, , . , ES:BX, : 0 . 2 PSP+80H. 6 FCB PSP+5CH. 10 FCB PSP+6CH. AL=3. . , PSP . . ES:BX : 0 . 2 . , AX: 01, 02, 05, 08, 10 11. .22.2 DOS DIR D. , EXE-. ( PC Magazine ). ------------------------------------------------------------ ------------------------------------------------------------ .22.2. DIR . IBM PC. 23 55  23. BIOS DOS ------------------------------------------------------------ BIOS DOS : , BIOS DOS. ------------------------------------------------------------ , . : , - (, ). BIOS (Basic Input/Output System) ROM . - . BIOS- DOS-, IN OUT. ------------------------------------------------------------ IBM PC ROM FFFF0H. , , CS FFFFH, IP - . FFFF:0 FFFF0, BIOS. BIOS . BIOS ( 0) , , INT 11H ( ) INT 12H ( ). BIOS DOS. , BIOS INT 19H , . , IBMBIO.COM, IBMDOS.COM COMMAND.COM . : BIOS IBMBIO.COM IBMDOS.COM COMMAND.COM IBM PC. 23 56 COMMAND.COM RAM () ROM BASIC ROM BIOS INTR . , IF 1 ( ), ( ) , IF 0 ( ). , , INT 12H, , . , 0000. 256 , 1024 .0 .3FF. , CS IP . . 23.1. , CS IP. , 12H ( AX ) .0048 (.12 4 = .48). . 0048 IP SS. , CS:IP, BIOS, . IRET (Interrupt Return), CS IP , . BIOS ------------------------------------------------------------ BIOS. INT 05H ( ). . INT 05H , .. , Ctrl/PrtSc . . ------------------------------------------------------------ () () 0-3 0 4-7 1 ( DEBUG) IBM PC. 23 57 8-B 2 (NMI) C-F 3 ( DEBUG) 10-13 4 14-17 5 18-1F 6,7 20-23 8 24-27 9 28-37 A,B,C,D AT 38-3B E 3C-3F F 40-43 10 (.. 8, 9, 10) 44-47 11 (..9) 48-4B 12 (..2) 4C-4F 13 - (..18) 50-53 14 54-57 15 . AT 58-5B 16 (..9) 5C-5F 17 (..19) 60-63 18 BASIC, ROM 64-67 19 68-6B 1A 6C-6F 1B 70-73 1C 74-77 1D 78-7B 1E 7C-7F 1F 80-83 20 (DOS) 84-87 21 DOS 88-8B 22 (DOS) 8C-8F 23 Ctrl/Break (DOS) 90-93 24 (DOS) 94-97 25 (DOS) 98-9B 26 (DOS) 97-9F 27 (DOS) AO-FF 28-3F DOS 100-1FF 40-7F 200-217 80-85 BASIC 218-3C3 86-F0 BASIC- 3C4-3FF F1-FF : 00-1F BIOS, 20-FF DOS BASIC. ------------------------------------------------------------ .23.1. . BIOS ------------------------------------------------------------ BIOS. IBM PC. 23 58 INT 05H . . INT 05H , Ctrl/PrtSc - . . INT 10H . , 9. INT 11H . , AX. AX .410. AX: 15,14 13 12 11-9 RS232 7,6 , 0=1: 00=1, 01=2, 10=3 11=4 5,4 : 00 = 01 = 4025 10 = 8025 11 = 8025 - 1 1 0 1 INT 12H . AX , , .200 512 . . INT 13H -. - , 16. INT 14H . - RS232. DX (0 1) RS232. , AH, AX . INT 15H - AT. - , AT. IBM PC. 23 59 INT 16H . , 9. INT 17H . . 19. INT 18H BASIC, ROM. BASIC-, ROM. INT 19H . 1 0 ( 0, 7C00) . , INT 18H ROM BASIC. ROM BASIC, . INT 1AH . AH. 0, . 18,2 . AH : AH=00 . CX , DX - . 24 , AL . AH=01 . CX ( ) DX ( ). 02 06 AT. INT 1FH . 128-255 1 , . 128 ASCII- ( 0 127). DOS ------------------------------------------------------------ BIOS DOS: IBMBIO.COM IBMDOS.COM. DOS , DOS , BIOS . IBMBIO.COM BIOS . - . IBM PC. 23 60 IBMDOS.COM , . INT 21H, IBMDOS . IBMDOS IBMBIO, BIOS. : ROM +-----------+ +----------+ +----------+ || | DOS | | DOS | +----+ +----------+ | / ||IBMDOS.COM||IBMBIO.COM||BIOS||| +-----------+ +----------+ +----------+ +----+ +----------+ , .20 .62 DOS. : INT 20H . DOS. . INT 21H DOS. DOS, AH. DOS . INT 22H . (.INT 24H). INT 23H Ctrl/Break. (.INT 24H). INT 24H . , , . DOS. INT 25H . ..17. INT 26H . ..17. INT 27H , . COM- . " ". DOS INT 21H ------------------------------------------------------------ IBM PC. 23 61 DOS INT 21H. AH: 00 ( INT 20H). 01 . 02 . 03 . . 04 . . IBM PC. 1 1 ----------------------------------------------------------- ASCII- 128 ASCII-. BASIC 128 . , .20 . 2 ------------------------------------------------------------ - . . A7B8 42936, - 42936 . A7B8. --------------------------------------------------------- . A7B8 , . (A), 16 . , . A F 10 15. : A (10) 10 16 *16 160 , 7 7 167 16 *16 2672 , B (11) 11 2683 16 *16 42928 , 8 8 42936 . . A7B8 (8) 1, (B) 2, (7) 3 (A) 4. B-1 . : 1 (8), 1 8 1 (8), 1 176 1 (8), 1 1792 1 (8), 1 40960 IBM PC. 2 42936 --------------------------------------------------------- 42936 42936 16; , , (6) . 16 (11 B) . , 0, . . 42936 / 16 2683 8 8 ( ) 2683 / 16 167 11 B 167 / 16 10 7 7 10 / 16 0 10 A ( ) B-1. 42936 , . 42936 : . . 42936 40960 A000 1976 1792 700 184 176 B0 8 8 . 7 A7B8 3 ------------------------------------------------------------ ( - ): AH BH CH DH CS SS BP AL BL CL DL DS SI SP IBM PC. 3 AX BX CX DX ES DI AAA DIV JLE JS OR SBB AAD ESC JMP JZ OUT SCAS AAM HLT JNA LAHF POP SHL AAS IDIV JNAE LDS POPF SHR ADC IMUL JNB LEA PUSH STC ADD IN JNBE LES PUSHF STD AND INC JNE LOCK RCL STI CALL INT JNG LODS RCR STOS CBW INTO JNGE LOOP REP SUB CLC IRET JNL LOOPE REPE TEST CLD JA JNLE LOOPNE REPNE WAIT CLI JAE JNO LOOPNZ REPNZ XCHG CMC JB JNP LOOPZ REPZ XLAT CMP JBE JNS MOV RET XOR CMPS JCXZ JNZ MOVS ROL CWD JE JO MUL ROR DAA JG JP NEG SAHF DAS JGE JPE NOP SAL DEC JL JPO NOT SAR ASSUME END EXTRN IFNB LOCAL PURGE COMMENT ENDIF GROUP IFNDEF MACRO RECORD DB ENDM IF IF1 NAME REPT DD ENDP IFB IF2 ORG SEGMENT DQ ENDS IFDEF INCLUDE OUT STRUC DT EQU IFDIF IRP PAGE SUBTTL DW EVEN IFE IRPC PROC TITLE ELSE EXITM IFIDN LABEL PUBLIC BYTE FAR LENGTH MOD PRT THIS COMMENT GE LINE NE SEG TYPE CON GT LT NEAR SHORT WIDTH DUP HIGH LOW NOTHING SIZE WORD EQ LE MASK OFFSET STACK IBM PC. . 9 . . . . . . 0000 0 0 1000 8 8 0001 1 1 1001 9 9 0010 2 2 1010 10 A 0011 3 3 1011 11 B 0100 4 4 1100 12 C 0101 5 5 1101 13 D 0110 6 6 1110 14 E 0111 7 7 1111 15 F +======================+ I D O S I I I +---------+ - - - - - - - - - - - + SS | +------->I I | + - - - - + I I | DS | +----+ - - - - - - - - - - - | - + - - - - + +-->I I | CS | +---+ I I | +---------+ | - - - - - - - - - - - | +--->I I | I I | - - - - - - - - - - - + I I I I I I I I +======================+ IBM PC. . 10 | : | : | | +--------+--------+ | | AH | AL | | +--------+--------+ | | BH | BL | | +--------+--------+ | | CH | CL | | +--------+--------+ | | DH | DL | | +--------+--------+ | +-----------------+ | SP | | | CS | +-----------------+ | +-----------------+ | BP | | | DS | +-----------------+ | +-----------------+ | SI | | | SS | +-----------------+ | +-----------------+ | DI | | | ES | +-----------------+ | +-------+---------+ | | | | | +-------+ V | V | -| ====================================>| |<==> 8088 | | | | | | +-------+ V | | +-----------------+ | +---+---+ | : -| | +---+ 1 | | | | | +-------+ | | | | | 2 | ( ) +->+ - - - - - - - - + | | +-------+ | | : | | | | 3 | | | | | | +-------+ | + - - - - - - - - + | | | 4 | | | | | | +-------+ | +-----------------+ | | | | | | +-----------------+ | | +--+ |<--+--+ | | | +-----------------+ | | IBM PC. . 11 . . +-----------------------------+ 0K 00000 | RAM 256K - | | | +-----------------------------+ 256K 40000 | RAM 384K - | | I/O | +-----------------------------+ 640K A0000 | RAM 128K /- | | | +-----------------------------+ 768K C0000 | ROM 192K | | | +-----------------------------+ 960K F0000 | ROM 64K | | | +-----------------------------+ IBM PC. . 12 D>DEBUG -E CS:100 B8 23 01 05 25 00 -E CS:106 8B D8 03 D8 8B CB -E CS:10C 2B C8 2B C0 90 CB -R AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0100 NV UP EI PL NZ NA PO NC 13C6:0100 B8230 MOV AX,0123 -T AX=0123 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0103 NV UP EI PL NZ NA PO NC 13C6:0103 052500 ADD AX,0025 -T AX=0148 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0106 NV UP EI PL NZ NA PE NC 13C6:0106 8BD8 MOV BX,