You are on page 1of 10

9

.

,
.
.

.

,
.


(, ,
, ).
..
CPU, ,
. PIC8259A
, CPU,
, IRQ .


,
INT.
-,
.
: DOS
BIOS .
, DOS - ,
, BIOS . BIOS
-, , (
),
( ).

1. -
1.1.

21H Interruption
DOS .
: Int 21H
TASM ,
.
,
AH.
- :
02H - ; 09H - ();
40H - /
- :
01H - ; 0AH -
; 3FH - /
-

: FCB
.
FCB Method
0FH (Open file); 14H (Sequential
reading) ; 15H (Sequential writing); 16H
(Create file); 21H - (Random reading); 22H
(Random writing).
(Handles)
3CH (Create file); 3DH (Open file); 3EH
(Close file driver); 3FH / (Reading from
file/device); 40H / (Writing in file/device);
42H
(Move pointer of
reading/writing in file).
21H:
02H FUNCTION
.
AH, , DL:
AH = 02H
DL = Value of the character to display.
,
DL .
09H FUNCTION
:
AH = 09H
DS:DX = Address of the beginning of a chain of characters.
,
DS:DX $,
.
40H FUNCTION

AH = 40H
BX = ,
CX = ,
DS:DX =
:
CF = 0
AX =
CF = 1
AX =
BX
1, MS-DOS.
01H FUNCTION
1 :
AH = 01H
:
AL =

AL .
0AH FUNCTION
:
AH = 0AH
DS:DX =
BYTE 0 =
BYTE 1 =
BYTE 2 BYTE 0 + 2 =
.
,
.
.

.
[ENTER].
3FH FUNCTION
:
AH = 3FH
BX = ,
CX = ,
DS:DX =
:
CF = 0 AX = .
CF = 1 AX .
1.2.
10h Interruption
BIOS video
: Int 10H
, video .

Ah .
10h
02H Function, .
09H Function, ,
.
0AH Function, , .
02h Function
:
AH = 02H
BH = Video page, .
DH = row ()
DL = Column ()
,
0,0 79,24. ,

0,0,

79,24.
, DH DL
.

09h Function
:
AH = 09H
AL = ,
BH = Video page, .
BL =
CX =
, ()
CX,
0Ah Function
:
AH = 0AH
AL =
BH = Video page, .
BL = ( ).
CX =
,
.
0EH Function

.
AH = 0EH
AL =
BH = Video page, .
BL = ( ).
1.3. 16H interruption
.
.
00H Function
. AH
:
AH = 00H
:
AH = Scan code
AL = ASCII ,

. AH scan ,
ASCII AL. Scan
ASCII ( ).
01h function
:
AH = 01H
:
, ,
.
1.4. 17H Interruption

.
: Int 17H
,
.
16h:
00H Function, ASCII
01H Function,
02H Function,
00H Function
.
:
AH = 00H
AL =
DX = .
:
AH = .
DX, : LPT1 = 0,
LPT2 = 1, LPT3 = 2 ...
:

1/0

---------------------------------------0
1

1
2
3
1
/
4
1

5
1

6
1

7
1

1 2
01h Function

:
AH = 01H
DX = .
:
AH = .
.
02h Function
.
:
AH = 02H
DX = .
:
AH = .
.
2.

.
"FCB"
, .
CPM ,
DOS,
. ,
.
FCB ,
- - .
FCB
FCB, , 37
44 . FCB .
FCB
.
().
FCB :

00H
1

01H
8

09H
3

0CH
2

0EH
2

10H
4

14H
2

16H
2

18H
8

20H
1

21H
4

: A = 1; B = 2; ..
0 .

(8 ). .

. 128 .
0. 0,
127.

21H, -.

FCB 0FH 21H .
:
AH = 0FH
DS:DX = FCB
:
AL = 00H 0FFH .

. DX

(FCB). FFH AH ,
.
DOS 0,
128
.

FCB 16H 21H .
:
AH = 1FH
DS:DX = FCB
:
AL = 00H 0FFH .
DX ,
, .

1AH
21H. 1AH
, 15H, .

.
14H 21H.
AL . AL 1 3
, . 2 , FCB
. AL 0.
.
21H 22H 21H
.
.
AL
.

10H 21H.
AL FFH ,
,
.


, .
.

,
, DOS.

, ()
.


FCB .
3.
-

,


.
.
,

.

, ,
,
.
IP
( ) ,
CS:IP
():
CALL NameOfTheProcedure
:
-
-
- Return
-
, AH AL
BX :
Adding Proc Near ;
Mov Bx, 0 ;
Mov B1, Ah
Mov Ah, 00
Add Bx, Ax
Ret ; Return
Add Endp ;
Adding,
Proc. Near , .
Ret IP
.
Add Endp .

Near FAR.
:
Call Adding
-
-
.


,
. ,
(
TASM , ).
,
.
, ,

.
.
(Call),
.
TOP

:



:
NameMacro MACRO [parameter1, parameter2...]
NameMacro , MACRO

. .
ENDM .

:
Position MACRO Row, Column
PUSH AX
PUSH BX
PUSH DX
MOV AH, 02H
MOV DH, Row
MOV DL, Column
MOV BH, 0
INT 10H
POP DX
POP BX
POP AX
ENDM

:
Position 8, 6

,
, .
.
.
Include NameOfTheFile,
.
, MACROS.TXT,
:
;Beginning of the program

Include MACROS.TXT
.MODEL SMALL
.DATA
;The data goes here
.CODE
Beginning:
;The code of the program is inserted here
.STACK
;The stack is defined
End beginning
;Our program ends

You might also like

  • Неолиберализмът
    Неолиберализмът
    Document15 pages
    Неолиберализмът
    Stanil Stoev
    No ratings yet
  • NMAP
    NMAP
    Document20 pages
    NMAP
    Stanil Stoev
    No ratings yet
  • NMAP
    NMAP
    Document20 pages
    NMAP
    Stanil Stoev
    No ratings yet
  • NMAP
    NMAP
    Document20 pages
    NMAP
    Stanil Stoev
    No ratings yet
  • Fundirane
    Fundirane
    Document152 pages
    Fundirane
    Stanil Stoev
    No ratings yet
  • Using Excel
    Using Excel
    Document20 pages
    Using Excel
    Stanil Stoev
    No ratings yet
  • Lect 08
    Lect 08
    Document12 pages
    Lect 08
    Stanil Stoev
    No ratings yet
  • Lect 03
    Lect 03
    Document8 pages
    Lect 03
    Stanil Stoev
    No ratings yet
  • Lect 04
    Lect 04
    Document5 pages
    Lect 04
    Stanil Stoev
    No ratings yet