close

Вход

Забыли?

вход по аккаунту

?

МетодическиеУказанияОС

код для вставкиСкачать
!
«
"
-
«
(
)
. .
"# $% &#
+
#
' ! (
, +
"$+
# -$
2011
!
$)
,
$)!*" )
- "
$
"
»
.%
#
#
#
"#
&
&
#
2013
..#%#! #
' #
"
)
& "
#
"*+ ,
&& ,
)
&&
! , .(
(
(&
,,
! ,
#
(
&&
"*+ ,
, &" *,
#
,,
(! &
"
".
.
"* "
#
,
Windows XP,
*+ ,
,
)
(
&
.
*
"
& " #
&
Intel
&
"
& ,
&&
" Microsoft assembler (MASM)
Turbo assembler (TASM),
"# &
+ # Link (TLINK)
# TD.
(
& (
&
"*+ ,
&&
& + *
(
&
.- #
(
(
"
# #
, ) *
"
(
&
,,
" & ( ! #) "&
"*+ ,
&& .
$
&
"
,
"* " (
#
,
&
,
/ #
&
! &
MS Word 2003,
+ ,
#
&
(
, ! & )
#
,
*+
.
"
"
,
(
&
#
& ( )
* "
#
&& ,,
#
,
© All rights reserved. 2011
)
# (
2
.%
#
#
#
"#
&
&
#
2013
$ / # .#%#! (
+
"
(
$
+
"
$
!
+
& ) *,
&&
"
,
"
! ,
&&
&&
"
"
(
& (
"* "
#)
,
*+ * ! #) *
,
+
#)
& ,!
&
:
& !
#) ,,
*
)
,
#
"
*+ &
# ,
.
&. AH
#
& 21h. $
"
mov
DX,offset STRING ;
mov
AH,09h
;
int 21h
;
;
$
+
"
#) . 1 " /
0,
! #) "
AX
"#
#
!
#)
(
&
.2
"
&
2
AX
,
#
,
&
"#
125810 11 -
", #
#
" ! #) "
# :
& !
! ,
#
&
+
#
&
"#
&
#
-
"
!
. 2
&
# .-/ &
AX
"
#
.
" (RC)
&
1,
&&
&
)
#
+
".
CF=1
"!
,
#)
, ;
# ;
& 3 &
,
#
! & .
# #
&
& 21h.
"
&& . &
#
,
.
&
!
(
#
&
,
"
(
(.
(
& )
" "
& ,
# #
# ! #) "&
" "
#) . 0 &
!
"
(
"
!
& *
", #
;
&" ;
;
.
4
&
(#
"
;
TESTPC
#
&
!
#) "&
)
"*+ ,
(
&&
)
&
"
:
.COM
SEGMENT
ASSUME CS:TESTPC, DS:TESTPC, ES:NOTHING, SS:NOTHING
ORG
100H
JMP
BEGIN
START:
;
STRING
db
'
AX=
',0DH,0AH,'$'
; !"# $!
;----------------------------------------------------TETR_TO_HEX
PROC near
© All rights reserved. 2011
3
.%
#
#
#
"#
&
&
#
and
AL,0Fh
cmp
AL,09
jbe
NEXT
add
AL,07
NEXT:
add
AL,30h
ret
TETR_TO_HEX
ENDP
;------------------------------BYTE_TO_HEX
PROC near
;
%
AL
&
.
push
CX
mov
AH,AL
call
TETR_TO_HEX
xchg
AL,AH
mov
CL,4
shr
AL,CL
call
TETR_TO_HEX ; AL
&
pop
CX
; AH
&
ret
BYTE_TO_HEX ENDP
;------------------------------WRD_TO_HEX
PROC near
;
16 / 16;
AX , DI push
BX
mov
BH,AH
call
BYTE_TO_HEX
mov
[DI],AH
dec
DI
mov
[DI],AL
dec
DI
mov
AL,BH
call
BYTE_TO_HEX
mov
[DI],AH
dec
DI
mov
[DI],AL
pop
BX
ret
WRD_TO_HEX ENDP
;-------------------------------------------------BYTE_TO_DEC
PROC near
;
10 / , SI & %
push
CX
push
DX
xor
AH,AH
xor
DX,DX
mov
CX,10
loop_bd:
div
CX
or
DL,30h
mov
[SI],DL
dec
SI
xor
DX,DX
cmp
AX,10
jae
loop_bd
cmp
AL,00h
je
end_l
or
AL,30h
mov
[SI],AL
end_l:
pop
DX
pop
CX
ret
BYTE_TO_DEC
ENDP
;------------------------------; '"
© All rights reserved. 2011
2013
AX
4
.%
#
#
#
"#
&
&
#
2013
BEGIN:
. . . . . . . . . . . .
STRING
mov
DX,offset STRING
mov
AH,09h
int
21h
; (
; ( )
TESTPC
. . . . . . . . . . . .
DOS
xor
AL,AL
mov
AH,4Ch
int
21H
ENDS
END
START
;
)
, START -
4 H
!
&" ,
#
#)
#
"
" &"
&& (
.
! #) 4Ah
4Ah
# &
"
,
1 "/
/ , ! #) :
MOV
AH,4AH
MOV
BX,mem-size ;
INT
21H
BX
"
&
&"
&& .
2
&
,
&
BX
+
"
&
,
*+
+
:
MOV
AH,4AH
MOV
BX,0FFFFH
INT
21H
2
& " ! #) "
CF=1
AX
"#
# .
& *
"/ & &
*,
"
" 21h. $
&
&& ,
+
"#
)
! (, #
&" ,
&"
,
(
&
&&
,
! (. - / &
*&
;
*
"!
,
!
"
& ! , &.
1)
5
2)
! #
$
" !
,
&
&
MS Word2003
:
&
,
,! &
", . .
,
«$
#
,
" ! #) "(
& (
,
,.
»
#
"
3)
.$ #
,
(
&
& ) ,. "
0 # *
.
&
"
(
#
&&,
&
,
#
!
4)
$
1)
2)
© All rights reserved. 2011
"
,
,
",
(
&
,
" / #
,! &
&
&
,, &
&
"
.
! &
# )
(
"*+ ,
&& ,
,
,,
" & (
&,
# ( #
(
"(
,
,
" "
(
" " #
,
,
&
,
*+ ,
*+
.
,
"* ";
5
.%
#
3)
#
/ #
&
*+
#
"#
&
&
&
(
,
#
2013
,! & ,
! & )
.
+ ,
#
"
,
, (
&
* " "
gubkin_alexandr@mail.ru
$
&
"
"
,#
,
$
&
© All rights reserved. 2011
#
,
#
#
#
"
&
(
E-mail
(&
& &.
&
:
"
"
+ ,
.
6
.%
#
#
#
"#
&
$)
$)! ( )
1
«
,
2 3
:
. $" .#4#,
* &" .
#
$
! ,
#
&
#
(&
#
2013
$
1
01
-
(
(
,
(
»
#
&
(
,
#
#
», # #
.
*,
&
,
&
(! &
(&
,,
(
" # #
&
&&
"
"*+ "
&&
+ * "
& .
&
&&
" # *
# &
"
" #
&
(
",
,
&
), #
,
3 #
&
.
&
+ # (Linker)
#
3 #
(&
,,
,
&
,
# , ! #) " "
–
#, #
" & +
&&
*
&"
#
. - /
# &
*
"
"
"
( &
,
. 1 "
"
,
&
.
5 1.
#
(
. $" &
", #
,
"
*
& . 6
"
"
(, #
&
&&
"
&
,/
,
& # ,. 1 " (, #
#
"
&&
&
&
, /
( "
"
.
0
&
,
,
«
"».
(
&
"
&, # #
& *
! & ) *,
*+ &
.
&
"
&&
&
, ROM
BIOS,
) ,
" #
,
"
#
&
&
.2
#
&
&,
,#
"
&
*
# ,
+ *
)
"
/#
*+
+
".
0 &
" "
"
& .
&
"
&&
"&
AL
AH ! &
#
*
#
! &
xx.yy,
xx &
,
,
yy &
&
! # )
"
,
&
",
! &
#
, &
& & OEM
, &
& &
".
$
#
" " /# .
, (
,&
.
&
" /
«(
,» . $" &
,
#
(
&
«
( ,» .#4#,
,
(
#
" . $"
&
".
5 2.
#
(
.#4# &
", #
,
"
! #) ,
&
4
1
,
. 5 # &
&,
«(
,» .#4#.
5
3.
(
#
" . $"
.#4# &
,.
#
«
" (
( #
272
&&».
5 4. 0
FAR
# , (F3/F4) ! ,
&
" . $" ! ,
«
( » .#4#
)
&
. 0 & # , (F3/F4) ! ,
&
" «(
» .#4#
+ & ! , & .
#
«
"! &
! ,
272 &
,».
«
© All rights reserved. 2011
"
7
.%
#
#
5.
«0
" . $"
5
6.
5
&
#
7.
#
5
&
,–
"#
&
&
#
2013
# ,
#
# TD.EXE
. $".
#
&
"
* &" ». $
* &" .
# ,
# TD.EXE
«(
,» .#4#.
«0
# «(
» 272 &
"
* &" ».
! &
"& . . 1 " ! ,
(
)
&
, "
# .
%
5
BIOS.
#
#
(
#
IBM PC (
&
(
#
"
,
&
0F000:0FFFEh,
#
,
ROM
) :
PC
FF
PC/XT
FE,FB
AT
FC
PS2
30
FA
PS2
50
60
FC
PS2
80
F8
PCjr
FD
PC Convertible
F9
1 "
"
MS DOS
" ! #) , 30H
" 21H. -(
&
&
& " " " & ! #)
AH:
MOV AH,30h
INT 21h
- (
&
&
& " "* ":
AL - &
,
.2
0, < 2.0
AH - & &
! # )
BH , , & OEM (Original Equipment Manufacturer)
BL:CX - 24,
, , &
".
&
#
#
'1
!
1) # #
&
2) EXE&& ?
3)
#
#
4) ! &
# &
&& ?
COM"
#
COM&& ?
COM&& ?
&
!
#
#
1)
2)
#
3)
«
(
#
! , COM?
#
! , «
(
"
0?
#
! , «(
» EXE?
# #
» EXE?
"#
"#
» EXE? 8 &
"
?
# #
"
?8
! ,
#
1)
# ,! &
# &
" COM?
2) 8
"
0?
3)
#
" & *
&
#
* ?
4)
#
" "
#? # *
© All rights reserved. 2011
# #
"#
?
&"
# #
?
&"
&
?
#
?
8
.%
#
"
#
#
#
#
#
"#
&
&
#
2013
» !
«
1)
2)
3)
4)
#
" «(
,» EXE? #
*
DS ES?
" "
#?
" "
# ( ?
© All rights reserved. 2011
#
" & *
&
?
9
.%
#
#
#
"#
&
$)
$)! ( )
6
+
«
2
&
3
,. 6
# ,
&&
&
&
! ,
:
! ,
+
(PSP)
& +
&& (PSP)
&
2013
02
$
--
&
& ,
#
&&
&&
#
,
»
-
"*+ ,
# & ,
.5 #
,
$
#
(
.
&& .
#
5 1. 1 "
"
,
(
&
&& , &
.COM, #
,
! & ) *:
1)
&
,
, &" , " , PSP,
)
.
2)
&
,
,
& ,
&& ,
)
3) 7
# &
,
#
&
&
.
4)
&
&
&
.
5) $
&
&
".
(
,
&& ,,
# *
(
.
5
2. ! &
"& . #
# &
&&
& .
%
$
,
&
#
#
#
#
*
*
% &
& +
0
2
4
0Ah (10)
0Eh (14)
12h (18)
2Ch (44)
5Ch
6Ch
80h
81h
"*+
&
! #
! #
*+ *
&
&
.
# *
#
&& ! &
" PSP, #
,
& +
"
&& . PSP
&
256 ,
"
,
)
&
.$
# &
,
.COM
&
PSP. $
# &
"
.EXE
&
DS ES
PSP. &
/ ,
" / (
&
.EXE
" .
PSP:
1
"( , )
&
"
2
int 20h
2
&
,
,
,
&" . $
&&
&
! )
&
&"
/ &
&.
6
0
4
- #
" 22h (IP,CS)
4
- #
" 23h (IP,CS)
4
- #
" 24h (IP,CS)
2
&
,
,
& ,
&& .
! &
"# #
,
#
,
#
" ! , & (FCB)
! &
"# #
,
#
,
#
" ! , & (FCB).
$ #
",
FCB
5Ch #
.
1
8
&
(
# &
,
# .
7
# &
,
# &
&
&
&
".
© All rights reserved. 2011
#
10
.%
#
#
#
"#
&
&
#
2013
&
(
#
=
, &
,.
# #
" &" COMSPEC, #
"
"
# &
,
)
# COMMAND.COM.
*+
#
! & ) *,
& *# &
& PATH, PROMPT, SET.
#
" #
, &
,. 5 # &
&,
" "* "
# &# )
&
(
.0 &
, ,
01h,
#
(
"&
,
&& .
#
" , & 00h.
"
-
#
,
"
&
1)
2)
:
#
# # *
#
&"
& ,
(
,
+ ( 00h,
#
'2
#
/
, &" ?
&" ,
*
,
&& ?
/
3)
1) 8
2)
3)
#
#
© All rights reserved. 2011
&"
?
?
"
?$
" ! & ) ",
# &
& "
"
?
&"?
11
.%
#
#
#
"#
&
$)
«
2
: 1 "
3
&"
&" *
" ,
#.
-
"
,
,
*+
,
&" * "
)
,
,
#
#
#) "&
,
&
,
0
5
*
"
&
,
,
#
"
"
(
&
(
&
*+ *
# *
&" *.
)
! (.
.$
&
&
)
(
,
&"
-
" "# #
.
(
.
,
#
.
&,
, ! #) * 4 h
4 H»). $
/#
(
(
,
&
&" ,
&
" 21h (
,
& ,
&& ,,
"
" 21H. $
(
,
64
&"
,
,
(.
#
" ,
, &"
"
& +
#
#
&" * MCB (Memory Control Block). MCB
&
16 , (
!)
#
16 (
&
$)
(
"
&
&
# & &" , #
&
" .
MCB &
*+ *
#
:
© All rights reserved. 2011
3 &
&
# &
.1 "/
! #)
&
! )
*
&& .
&
+ &
.
# *
(
#
.
5 3. &
&& +
# &
&,
&" ,
&&
64
&" ! #) , 48H
/#
& ,
&
! )
*
&& .
& ,
&
+ (
(. (
&& ,,
# *
(
#
.
5 4. &
,
&& ,
! #) , 48H
" 21H
" &" . "
! #) , " ,
"" !
CF. (
&& ,,
# *
(
#
.
5 5. )
,
+ (
#
! &
.
%
& .
(
)
&
&&
«
#) ,
#
(
2.
!
&" .
&" .
&" *
"
&&
&& ,,
(
& .
"* "
!
"
#
,
"
.COM, #
)
+ -7 38»
#
1. 1 "
, &
*:
&
03
$
7
)
* "
$
5
&&
! & )
1)
2)
3) -
2013
&" *
(
&
,
&" ,
,
# & *
. ,
&
"
"
"
&
# &
& . 1 "
)
"
"
#
" (
(
#
&" . % #)
, &" *,
&
*
* /
/ &
"
#
$)! ( )
1 ,
+
"
"
)
&
#
"
"
12
.%
#
& +
00h
#
#
"#
1
&
#
2013
"( , )
1
01h
&
2
&
MCB:
5Ah,
4Dh,
&
,
,
"
# ,
,
PSP
)
#
&" ,
0000h ,
#,
0006h #
,
OS XMS UMB
0007h #" " " # *
,
( ,
&" *
,
0008h #
MS DOS
FFFAh #
"
"*+ &
# &
386MAX UMB
FFFDh #
#
386MAX
FFFEh #
386MAX UMB
03h
2
&
#
! (
05h
3
0
08h
8
"SC" #
MS DOS,
&
& ,#
"SD" #
MS DOS,
&
&
$
&
&
&
#
&" , #
&
/ & MCB
&
&
*+
MCB
# .
MCB (
"
,
#
MS DOS,
& , "List of
Lists" (
#
# ). 1
# #
*
/
#
&
"
! #) * 52h "Get List of Lists" int 21h. " / , ! #) ES:BX
#
#
# .
ES:[BX-2]
&
MCB.
&
,
&"
(
"
" ,# ( 30h, 31h CMOS. CMOS /
/
& "
&" ,
#
, (
"
! & ) "
# !
)
$6- .
3 &
&"
"
64
, .
&
,
&"
, ( &
+ " # " ,# & CMOS
*+ &
&:
mov AL,30h ;
*
%
CMOS
out 70h,AL
in AL,71h
;
&
%
mov BL,AL
;
&
%
mov AL,31h ;
*
%
CMOS
out 70h,AL
in AL,71h
;
&
%
;
&
%
&
#
#
1) 8
"
, 3 &
2)
#,
&&
3)
# ,
&
&"
&
© All rights reserved. 2011
'3
&" "?
# ?
&& #
&
?
13
.%
#
#
#
"#
&
&
$)
$)! ( )
«$
2
#
:-
3
&
(
#
# & *
#
#
#
&&
# & *
".
,
#
#
2013
$
+
04
+
»
*
,. - #
,. $
",
, (
#
*+ &
"
,
",
#
*+
".
-
,
,&
&
,
&
#
9 4
.6
"
#
* "
#
.5 # &
*+ ,
$
#
&,
,
#
&
!
#
,
,
#)
,
"
#
(
".
#
#
5 1. 1 "
"
,
(
&
&& , &
.#4#, #
,
"
*+ ! #) :
1) $
" ,
#
#
& 1 h.
2)
* ! #) * "
#
"
#
,,
,
+
" " (
! #) 4 h
" int 21h.
3) 2
,
"
*+
+
+
" " (
! #) 4 h
" int 21h.
4) #
"
*+ &
*
&
# &
,
# /un. #
"
#
,
&" ,
& & ,
&. 0 &
+
" " (
! #) 4 h
" int 21h.
1 "
,
#
", &
*+ &
&. $
,
,
#
". $
&,
/
#
# (
,
.
&,
&
& +
"
,
#
, # , #
,
! )
.
& #
&,
( "+ & "
, &
,
. 2
"
* ,
. 1
#
,,
,
&
"
&.
$
&&
#
&
"
,
)
.6
#
#
#
".
"
*+ ! #) :
1)
(
"
#
(
(
( .
2) $
)
#
+
&&
,
/# . 1 "
/#
int 10h, #
"
! & ) *
/# .
5 2. 0
*
&&
,
,
#
"1 h
.
"
"
/#
,
#
(
&
& +
"
&" . 1 " /
&&
. 3, #
"
#
&"
#
#
-. $
&
.
© All rights reserved. 2011
14
.%
#
#
#
"#
&
3. 0
5
*
"
,
&&
#
.
5
4. 0
,
&" ,
" "
. 3. $
5 5.
*
"
#
&
#
#
2013
+
,. $
&&
,
.1 "/
.
.
&
%
&
&
# * &
+
#
#
"
#
#
# ,
*
#
. .), #
"
&
,
" ",
&&
/#
#
* "
#
&&
,
, - /
,
*
&
,
"
)
&&
# *
"
&
(
#
, #
,&
,
".
#
+
,
&& .
&& (CS:IP)
&
"
# &
&!
.0 &
CS:IP
"
#
(
&&
#
"
" "
# .
#
"
#
"
#) , IRET
(
").
- #
" &
4 , .&(
"
IP,
&CS.
1024
,
&"
256 #
. - #
"
" 0
" " ,# 0000:0000, "
" 1 – " ,# 0000:0004 . .
#
-/
"
)
, & *+ "
*+ *
#
:
ROUT PROC FAR
PUSH AX
;
)
)
...
< %
>
POP AX
;
...
MOV AL, 20H
OUT 20H,AL
IRET
ROUT ENDP
1
#
(
&
"
"
#
,
# &
"& , &
#
.1 "
#
"
#
,
" ! #) " 25H
" 21H, #
"
#
"
#
,
.
PUSH DS
MOV DX, OFFSET ROUT ;
DX
MOV AX, SEG ROUT
;
MOV DS, AX
;
DS
MOV AH, 25H
;
MOV AL, 1CH
;
INT 21H
;
POP DS
$
&& ,
*+ "
#
,
#
,. % #) " 35
" 21H
"
#
", & + "
&
ES, & +
BX.
$
&&
*+
#) :
; -- )
%
KEEP_CS DW 0 ;
)
KEEP_IP DW 0 ;
© All rights reserved. 2011
15
.%
#
#
#
"#
&
&
#
2013
; -MOV
MOV
INT
MOV
MOV
AH, 35H
;
AL, 1CH
;
21H
KEEP_IP, BX
KEEP_CS, ES
;
;
%
; --
CLI
PUSH DS
MOV DX, KEEP_IP
MOV AX, KEEP_CS
MOV DS, AX
MOV AH, 25H
MOV AL, 1CH
INT 21H
;
POP DS
STI
1 "
,
)
"
,
" ! #) , DOS 31h
" 21h. 6
! #) "
&
#
, #
"
#
&
,
" ,,
+
"
(
DOS.
% #) " 31h int 21h
*+
&
:
AH 31h;
AL &
;
DX ),
%
.
:
mov DX,offset LAST_BYTE ;
% )
mov
shr
inc
mov
int
CL,4
DX,CL
DX
AH,31h
21h
/#
! & )
" 10h.
! #) ,
;
outputAL proc
push ax
push bx
push cx
mov ah,09h
mov bh,0
mov cx,1
int 10h
pop cx
pop bx
pop ax
ret
;
;
© All rights reserved. 2011
&" ,
"
*
&" ,
&"
%
;
)
;
# &
,
+
"
"
& + *
AL
;
;
;
;
*
%
+
*
,
16
.%
#
#
#
"#
&
&
#
2013
;
ES:BP
+
outputBP proc
push ax
push bx
push dx
push CX
mov ah,13h ;
mov al,1 ; sub function code
; 1 = use attribute in BL; leave cursor at end of string
mov bh,0 ;
mov dh,22 ; DH,DL =
,
(
mov dl,0
int 10h
pop CX
pop dx
pop bx
pop ax
ret
outputBP endp
;
; $
;
25
setCurs proc
push ax
push bx
push dx
push CX
mov ah,02h
mov bh,0
,
(
mov dh,22 ; DH,DL =
mov dl,0
int 10h ;
.
pop CX
pop dx
pop bx
pop ax
ret
;
; 03H
*
,
;
) : BH =
;
) : DH,DL =
,
;
CH,CL =
*
,
getCurs proc
push ax
push bx
push dx
push CX
mov ah,03h
mov bh,0
int 10h ;
.
;
) : DH,DL =
,
CH,CL =
*
,
;
pop CX
© All rights reserved. 2011
0)
0)
17
.%
#
#
#
"#
&
&
#
2013
pop dx
pop bx
pop ax
ret
&
1)
2)
#
#
#
© All rights reserved. 2011
& (
#
&
"
'4
"
?
?
18
.%
#
#
#
"#
$)
«
+ 79
2
#
,
3
#
#
&
#
2013
$)! ( ) $
05
+ 31
3
+
»
&
:
,
"
#
.
",
# -#
. 2
# -#
&
*.
$
5 1. 1 "
&& , &
. 4, &
:
1) $
" ,
2) 2
#
&
"
,
#
#
# -#
/ &
&
#
#
& ,
#
"
.#4#, #
. $
* (int 09h)
+
"
& , #
#
# ,
"
#
,
,
"
&
!
#)
,# #
&&
& 09h.
* ! #) * "
"
#
,.
# (
,
#
"
(
"
#
# .
+
" " (
! #) 4 h
" int 21h.
3) 2
,
"
*+
+
+
" " (
! #) 4 h
" int 21h.
#
"
*+ &
*
&
# &
,
# /un. #
"
#
,
&" ,
& & ,
&. 0 &
+
" "
(
! #) 4 h
" int 21h.
1 "
#
", &
*+ &
&. $
,
,
#
". $
&,
/
#
# (
,
.
&,
&
& +
"
,
#
, # , #
,
! )
.
& #
&,
( "+ & "
, &
,
. 2
"
* ,
. 1
#
,,
,
&
"
&.
$
&&
#
&
"
,
)
.6
#
#
#
".
"
*+ ! #) :
1)
(
"
#
(
(
( .
2) $
)
" # -# .
3) 2
/
#
&
(,
& ,#
"
! #
.
4) 2
/
#
&
(,
+
" "
"
&
#
".
5 2. 0
*
&&
,
,
#
" 09h
.
"
" "
&
(
&
,
& (
&
# &
&
# &.
5 3. 5 #
(
&
& +
"
&" . 1 " /
&& . 3, #
"
#
&"
#
#
-.
$
&
.
© All rights reserved. 2011
#
(
#
#
,
19
.%
#
#
#
"#
&
4. 0
5
*
"
,
*
"
#
&
&
#
%
&&
,
.1 "/
.
.
#
2013
+
,. $
&&
,
&
# * &
+
#
#
"
,
" ",
&&
/#
#
#
& #
#
#
$ )
&&
#
.
5
5. 0
,
&" ,
" "
. 3. $
5 6.
&
# -#
,
# /
#
)
& #
"
, #
( &
,
&
#
!
! ,
#
"
&
*+ , #
, (
" ",
& #
#
&
1. $
# -#
#
2. $
# -#
& #
# *
,.
3. $ &
# #
! #
.
5 # +
&
!
#
# )
.
&"
(
& (
+ -7
) 10040:001A
2
0040:001C
2
0040:001E
32
0040:0017
2
%
, (
" "
* " 1,
#
&.
!
&
#
"
,
#
,#
(
*+ ,
#
"
"
!
:
#
#
#
-
"&
(
) .
#
#
# (int 09h).
60h,
!
.
.
)
!
,
9 !
#
!
#
#
#
-./././././././.0./././././././.1
2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2
4/5/5/5/5/5/5/5/6/5/5/5/5/5/5/5/7
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4. Shift (
)
2 2 2 2 2 2 2 2 2 2 2 2 2 2 4... Shift (
)
2 2 2 2 2 2 2 2 2 2 2 2 2 4..... Ctrl (
2 2 2 2 2 2 2 2 2 2 2 2 4....... Alt (
2 2 2 2 2 2 2 2 2 2 2 4......... ScrollLock
2 2 2 2 2 2 2 2 2 2 4........... NumLock
2 2 2 2 2 2 2 2 2 4............. CapsLock
2 2 2 2 2 2 2 2 4............... Ins
2 2 2 2 2 2 2 4................. Ctrl (
)
2 2 2 2 2 2 4................... Alt (
)
2 2 2 2 2 4..................... SysReq
2 2 2 2 4.......................
.
8
"
"
2 2 2 4......................... ScrollLock
2 2 4........................... NumLock
2 4............................. CapsLock
4............................... Ins
- & &
" # -#
(
"
/
#
# &
, IN
(
# .0
© All rights reserved. 2011
,.
" "
*+ "
.
)
)
60h. $ / &
&
"
20
.%
#
#
#
"#
&
&
#
2013
" & #
61H,
)
0. 0 &
#
&,
.
6
1,
7 1,
&
&
&
#
.
# *
.6
&
&
# AT, ( "
&
( &
! ,
!
, 8255.
# -#
"
&
,
#
(#
")
+
(#
").
"
( , :
0F0H,
& # -# . - #
"
* ", # &
"
#
# *
,, " #
(
* "
*+
&
"
, ( (
.
,
,
#
"
* ". $
/ &
" &
& " " ,
#
# *
,. &
(#
,
"
,
,
,
& ,
# -# 30
&
( &
#
A. $
# #
,
&
! )
,
)
#
,
*+ , & #
ASCII
,# .$
,
&
# &#
#,
&
. + &
# -#
"* " / &
&
)
(,
#
"
"
#) , XLAT. XLAT
&
AL
0
255,
+
AL 1- ,
256- , ,
) ,
#
* #
DS:BX. 5
) &
(
"
&
(. 2
AL (
" # -# 30,
& +
)
,
& 30 (31-, , , # # #
"
"). 6
,
)
& 97,
" # ASCII " "a".
K
"
"
,A
"
) ,##
,
+
(
,
.
#
&
(
"
,
,
) ,
/ &
# # -#
"
& +
,
" &
&#
# *
,.
&
#
& +
! #
. $ )
, &
"
!
&
"
*+
&
. !
# #) #
# "
. : ,#
&" 0040:001A
#
! ,
0040:001C - #
(
.6
#
* & +
(
BIOS (#
"
"
&
40H)
( " "
30
60. H
&
"* " " ,#
!
&
& , #
( ""
) ,
*+ , &
"
,# ) ! .
!
,
#
(
2 &
#
"
- # &
", #
#
30 (
! ),
/ &
!
,#
#
(
60. 1 "
#
&
! ,
&
) *,
#
* #
(
!
&
#
(
2;
#
(
60,
&
30.
"
#
" 09H
push
ax
in
al,60H
;
*
,
cmp
al,REQ_KEY ;+
%
?
je
do_req
;
,
*
REQ_KEY
;
, %
)
%
pop
ax
jmp
cs:[int9_vect] ;
)
* %
do_req:
;
, %
)
in al,61H
;
*
%
mov ah,al
;
)
*
or al,80h
;
*
&
out 61H,al
;
, %
xchg ah,al
;
*
)
out 61H,al
;
*
61H
#
& #
"
© All rights reserved. 2011
21
.%
#
#
#
"#
&
mov
al,20H
out
20H,al
;-----*& &
! #
0
&
#
2013
*
;
;
"
"
% 8259
&
& + *!
#)
"
05h
16h:
mov ah,05h ; '
mov cl,'D' ;
&
mov ch,00h ;
int 16h ;
or al,al ;
jnz skip ;
;
*
*&
skip: ;
*
&
1)
#
2) 8 &
© All rights reserved. 2011
skip
*
#
#
'5
"
" #
#
?
#
ASCII?
22
.%
#
#
#
«
2 3
:
&
# ,
#
.&
"
,
#
. - / &
( " "
&#
2. $ "
&
.
"
*
&. 1
" int 21h. &
$
&
#
#
0
#
0
#
"#
&
&
$)
-
$)! ( )
7
-
#
2013
06
$
»
&
,
"
"+
#
+ (
# (&
&
,
,
#
! , &
"
#
&
# &
"
#
/
#
(
,,
&
"
#
"
,
&
*+ &
&
&
"
( " "
&
# ,
#
&
"
&
"
"
/ ,
,# #/
& & &
"&
" ! #) " 4B00h
& #
.
(
&
*
#
.
#
5 1. 1 "
"
,
(
&
&& , &
.#4#, #
,
" ! #) :
1) $
&
"
#
&
"
#
#
&
(
"
&. & & &
*
"
"
"
*+ & &
&
"# &
"
# .
2) & ,&
#
"
&
# .
3) $
#
" "
# ,
&
& ,
&& .
(
&
"
" ,
&
",
*+
+
.2
" 0,
"#
".
- #
& ,
&&
(
&
"
&& . 2, #
# &
*
# . 6
&&
&
! )
,
(
&
+
# ! #)
&
. "
AL
&
(
+
# ! #)
(
4 h
" int 21h.
5
2. 0
*
&& , #
# + & #
& " "
& &
"& . $
&&
*
&& , #
",
" &
#
.
, &
A-Z. $ &
" #
.
5
3. 0
*
&& , #
# + & #
& " "
& &
"& . $
&&
*
&& , #
",
" &
#
.
# &
) *
&
Ctrl-C. $ &
"
#
.
5 4. 0
*
&& , #
# + &#
&" " "# #
, #
,
,
,
#
&
"
&&
&
.
$
# &
) ,#
.0
.
5
5. 0
*
&& , #
&
( " "
(. 0
.
© All rights reserved. 2011
,
,
"
"
"
"
.
"
"
.
,-
(
23
.%
#
#
%
1 "
4B00h
#
"#
&
&
#
2013
#
#
" int 21h (
*+
,
&
,& &
#
"
,
). $
&&
,
" ! #) "
(
&
#
+
& # / , ! #)
":
1) $
&" . $
&
#
&& ,
" "
"
&" OS, / &
(
&
&
&" .
1 "/
&
! #) * 4Ah
" int 21h. 6 ! #) "
"
&
,
&&
# &" . $
& ! #)
3 & &" ,
(
& ,
&& . 6
-7
! ,
#
" "
&& . 2
! #) " 4Ah
&
,
"!
CF=1
7
"#
# :
7"*+ ,
# &" ;
8&"
"
" ! #) ;
9,
#
&" .
$ / &
" #
" int 21h
" !
CF=1.
2)
#
&
.
#
&
- / 14- ,
,
# &" ,
#
, & +
"
*+ " ! & ) ":
dw
%
dd
%
dd
FCB
dd
FCB
2
&
,
0,
& "
&&
*+ ,
&& . &
*+ "
&&
! &
&"
#
,
*+ * "
#
16
&
/
#
&
.
&
"
#
"
*+ & ! & :
, , #,
+ ,
&
# &
,
# ,
& &
# &
"
# ,
+ "
128 &
.
#
&
# ,
& ,
&&
#
ES:BX.
3) $
# ,
+ *
&"
& ,
&& . - # )
#
" # ASCII 0.
*
#
#
DS:DX.
4) (
&
SS SP
&
(. $
SS
SP
,
DS
(
&
#
.
"
#
,
"
# OS
*+ ,
*# & :
mov
AX,4B00h
int
21h
2
& "
&&
,
"!
CF=1
AX
"#
# :
1& ! #)
;
2! ,
, ;
5#
# ;
8& 3 &
&" ;
10 ,
#
;
11 ! & .
2
CF=0,
& "
&&
. 1 "/
(
&
" ! #) , 4Dh
" int 21h. #
! #) "
+
AH
,
AL #
".
$
"
AH
" "
*+ & # & :
© All rights reserved. 2011
24
.%
#
#
0123-
#
"#
&
&
#
2013
&
;
Ctrl-Break;
o
#
,
;
! #)
31h,
"*+ ,
"! &
"
& ,
&& ,
OS
& + * ! #) 4Ch
" int 21h.
- #
& ,
&&
)
* .
,
92, &
! )
(
&
&&
& ! #)
4Ch
#
&
&
, &
#
". 6 &
& + * ! #) 01h
mov
AH,01h
int
21h
, &
"
AL
&
" int 21h.
&
1)
#
2) - # # ,
3) - # # ,
#
&&
,.
(
AL
&
&& ,
&. $
*+ &
" int 21h
AL, #
" int 21h.
&
#
"!
#)
4Ch
'6
Ctrl-C?
#
#
" 0?
#
#
© All rights reserved. 2011
"
& "
&& ,
"
& "
&&
#
* Ctrl-C?
25
.%
#
#
#
&
&
$) $)! ( )
7
«
2 3
, ,
"
"#
:
#
.
, (
&
" ! #) " 4B03h
( " "
&#
.
- / ,
#
&
,,
/ &
&
&
.
#
2013
07
$
»
&
"
#
,
. 1 "
#
" int 21h. &
"
& + * "
$
"
&
&
&
#
,
&
&
,
"+
,
#
5 1. 1 "
"
,
(
&
&& , &
.#4#, #
,
" ! #) :
1)
&"
"
#
.
2) 8
& ! ,
"
3 & &" ,
,
# .
3) % ,
,
&
"
" ".
4)
" &" ,
" "
,
&
.
5) 0 & ,
" 1)-4)
"* " "
*+
,
&
.
5 2. 5 #
(
&
,
&
.
&
&
, #
,
.
5
3. 0
.
,
&
"
,
#
"
.
5
4. 0
#
. $
.
5
5. 0
, #
"
#
$
#
"
, .
5 6. 0
#
. ! &
"& .
%
!
#
1 "
#) " 4B03h
*+ * "
)
$
"
! #
&
AX=4B03h DS:DX ES:BX -
"
# # (
* "
#
#
"
"
,
,
.
#
&& ,
" int 21h. 6
&
,
,
&& (PSP)
& *+ ,
! #) "
, *
#
,
"
*
&& , ( "+ * " ! ,
&& / , ! #) ,
+
".
+
# ! #) 4B03h:
"
&" ,
# .
" "
;
ASCIIZ,
;
,
,
.
2
!
CF=1
AX
#
# . 0
) :
1+
*+ " ! #) ";
2-! ,
, ;
3-&
, ;
4# &&
#
(! ,
5;
8-&
&" ;
© All rights reserved. 2011
" !
#) ,
AX (
#
#
*+
;
26
.%
#
#
#
"#
&
&
#
2013
"
10 -
.
CF=0,
"
" int 21h. 0
2
!
,
&" .
$
# ,
*+ "
&&
&"
! #) 4Ah
&
&
". 6 &
& + * ! #)
4Eh
" 21h. $
+
& # ! #)
(
&
&"
& &
43
,
! DTA, #
* ! #) "
,
! ,
, .
% #) "
*+
&
:
CX ,
, #
"! ,
&
0;
DS:DX - #
#! , ,#
,
" ! &
# ASCIIZ.
2
!
CF=1
" ! #) ,
#
AX
#
# . 0
AX ( #
*+
) :
2-! ,
, ;
3-&
, .
2
CF=0,
&"
!
DTA
& +
& 1Ah
(
"
&
&
! , ,
& +
& 1Ch &
&"
, (.
$
,
& ! ,
! ,
&
"
)
! .0 &
(
&
&"
& + * ! #)
48h
" 21h. $
/
(
& ! &
&
" ! #)
4B03h
.
$
#
"
(
&
&"
& + * ! #) 49h
" int 21h.
+
# / , ! #)
*+
&
:
AH=49h ES -
;
.
, ,
&
" " "
&&
&
. $"
.#4#.
"
,#
,
& ,#
, ! & " "
&
# # ! #) "
# , (
0
+
" " # &
, RETF. 6
(
&
,
&
"
+
&& ,
"*+ *
, ,
& .2
! #)
(
4 h
"
int 21h,
&&
#
*
.
&
1)
#
#
#
&& ,
. $" &
© All rights reserved. 2011
'7
#
,
&
?
27
.%
#
#
#
"#
&
&
#
2013
.1
, .
#
&&
. - ., «%
», 1991 .
$. , %
. .: #
&
:
#
&&
% », 2001, 640 .
http://www.cyberdengi.com/FoundationsOfAssembler/Theme01.html
http://www.codenet.ru/progr/dos/int_0009.php
#
«1
© All rights reserved. 2011
". –
.;
28
Документ
Категория
Без категории
Просмотров
8
Размер файла
277 Кб
Теги
методическиеуказанияос
1/--страниц
Пожаловаться на содержимое документа