Assembler






- ,
. ,

.
, .
A B,
,
.
.
FCB . FCB
DOS. FCB
,
, .. , FCB
, ,
DOS. FCB ,
DOS .
DOS .
 
,
.
IBM STRUC,
.
.
, ,
, , ENDS.
.
STRUC .

.
STRUC ,
MACRO.
, .
. . 6.14
STRUC.

Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:03:36
. 6.14 Page 1-1
 
PAGE ,132
TITLE . 6.14
 
FCB STRUC
0000 00 DRIVE DB 0 ;
0001 20 20 20 20 20 20 20 FILE_NAME DB ' ' ;
20
0009 20 20 20 FILE_EXT DB ' ' ;
000C 0000 CURRENT_BLOCK DW 0 ;
000E 0080 RECORD_SIZE DW 80H ;
0010 00000000 FILE_SIZE DD 0 ;
0014 0000 DATE DW 0 ;
 
. 6.14 ()
0016 000A[ RESERVED DB 10 DUP (?) ;
??
]
0020 00 SEQ_NUMBER DB 0 ;
0021 00000000 RANDOM_NUMBER DD 0 ;
;
0025 FCB ENDS
 
0000 STACK SEGMENT STACK
0000 0040[ DW 64 DUP (?)
????
]
0080 STACK ENDS
 
0000 CODE SEGMENT
ASSUME CS:CODE
 
0000 01 INPUT FCB <1,'FIG6-14','INP'>
0001 464947362D313420
0009 494E50
000C 0000
000E 0080
0010 00000000
0014 0000
0016 000A[
??
]
0020 00
0021 00000000
 
0025 02 OUTPUT FCB <2,'EXAMPLE','TST'>
0026 4558414D504C4520
002E 545354
0031 0000
0033 0080
0035 00000000
0039 0000
003B 000A[
??
]
0045 00
0046 00000000
 
 
004A STRUCTURES PROC FAR
004A 1E PUSH DS ;
004B B8 0000 MOV AX,0
004E 50 PUSH AX
004F 0E PUSH CS ; DS CODE
0050 1F POP DS
ASSUME DS:CODE
0051 8D 16 0000 R LEA DX,INPUT ;
 
. 6.14 ()
0055 B4 0F MOV AH,0FH
0057 CD 21 INT 21H
 
0059 8D 16 0025 R LEA DX,OUTPUT ;
005D B4 16 MOV AH,16H
005F CD 21 INT 21H
 
0061 8D 1E 0000 R LEA BX,INPUT
0065 C7 47 0E 0010 MOV [BX].RECORD_SIZE,16 ;
006A C6 47 20 01 MOV [BX].SEQ_NUMBER,1 ;
 
006E C7 06 0033 R 0010 MOV OUTPUT.RECORD_SIZE,16 ;
;
0074 8D 16 0000 R LEA DX,INPUT ;
0078 B4 14 MOV AH,14H
007A CD 21 INT 21H
 
007C 8D 16 0025 R LEA DX,OUTPUT ;
0080 B4 15 MOV AH,15H
0082 CD 21 INT 21H
 
0084 B4 10 MOV AH,10H ;
0086 CD 21 INT 21H
 
0088 CB RET
0089 STRUCTURES ENDP
0089 CODE ENDS
END
 
Microsoft (R) Macro Assembler Version 4.00 4/16/89 23:15:19
 
. 6.14 Symbols-1
 
Structures and Records:
 
N a m e Width # fields
Shift Width Mask Initial
 
FCB . . . . . . . . . . . . . . 0025 000A
DRIVE . . . . . . . . . . . . 0000
FILE_NAME . . . . . . . . . . 0001
FILE_EXT . . . . . . . . . . . 0009
CURRENT_BLOCK . . . . . . . . 000C
RECORD_SIZE . . . . . . . . . 000E
FILE_SIZE . . . . . . . . . . 0010
DATE . . . . . . . . . . . . . 0014
RESERVED . . . . . . . . . . . 0016
SEQ_NUMBER . . . . . . . . . . 0020
RANDOM_NUMBER . . . . . . . . 0021
 
. 6.14 ()
 
. 6.14 ,
DOS. DOS
A:,
B:. ,
-
- ,
FCB.
 
. 6.14
FCB. STRUC
. FCB
. FCB.
,
. ,
,
.
.
 
, , FCB
.
CODE FCB.
INPUT. FCB
. ,
FCB . ,
.
 
FCB
INPUT, ,
.
DRIVE 0, INPUT - 1.
INPUT 1.
0.
,
. INPUT
.
INPUT
FCB.
 
FCB,
.

FCB, RESERVED.
10 , .
,
 
DB 10,20
 
.
, . ,
,
. FILE_NAME
, ,
.
 
, , ,
, ,
.
, ,
. ,
FILE_NAME CURRENT_BLOCK,
DRIVE FILE_EXT,
FCB :
 
EXAMPLE FCB <,NEWNAME,,12>
 
,
. NEWNAME
. FILE_EXT
, , CURRENT_BLOCK
12.
 
. 6.14
FCB OUTPUT .

FCB.
 

.
INPUT OUTPUT ,
. , ,
INPUT
 
LEA DX,INPUT
 
FCB.
 

.
- . ,
BX FCB INPUT.
RECORD_SIZE SEQ_NUMBER .
BX FCB,
.
 
[BX].RECORD_SIZ
 
, ,
, RECORD_SIZE
, BX.
, ,
RECORD_SIZE (0EH) SEQ_NUMBER (20H). "."
.
 

.
RECORD_SIZE FCB OUTPUT.
OUTPUT.RECORD_SIZE. OUTPUT
, RECORD_SIZE -
.
 
, , ,
. . 6.14
.
.
,
. "Structures and records"
(" ").
FCB , 25H
0AH .
, .
.
, "width"
() "#dfields" ( ).
. ,
, .
 
, . 6.14,
. , .
STRUC.

.

. ,

. ,

.