Assembler

-






.
.
,
(RECORD). RECORD
STRUC MACRO. RECORD
.
.
. STRUC RECORD
,
. RECORD
. RECORD
16 .
 
. . 6.15
,
.
16- ,
.
DOS FCB
. 16-
, . . 6.15
RECORD .
Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:03:43
. 6.15 Page 1-1
 
PAGE ,132
TITLE . 6.15
 
DATE_WORD RECORD YEAR:7,MONTH:4,DAY:5
 
0000 STACK SEGMENT STACK
0000 0040[ DW 64 DUP (?)
????
]
0080 STACK ENDS
 
0000 CODE SEGMENT
ASSUME CS:CODE
 
0000 FCB LABEL BYTE
0000 01 DRIVE DB 1 ;
0001 46 49 47 36 2D 31 35 FILE_NAME DB 'FIG6-15 ' ;
20
0009 41 53 4D FILE_EXT DB 'ASM' ;
000C 0000 CURRENT_BLOCK DW 0 ;
000E 0080 RECORD_SIZE DW 80H ;
0010 00000000 FILE_SIZE DD 0 ;
0014 0000 DATE DATE_WORD <> ;
0016 000A[ RESERVED DB 10 DUP (?) ;
??
]
0020 00 SEQ_NUMBER DB 0 ;
0021 00000000 RANDOM_NUMBER DD 0 ;
 
0025 RECORDS PROC FAR
0025 1E PUSH DS ;
0026 B8 0000 MOV AX,0
0029 50 PUSH AX
002A 0E PUSH CS ; DS CODE
002B 1F POP DS
ASSUME DS:CODE
002C 8D 16 0000 R LEA DX,FCB ;
0030 B4 0F MOV AH,0FH
0032 CD 21 INT 21H
 
0034 A1 0014 R MOV AX,DATE
0037 25 FE00 AND AX,MASK YEAR ;
003A B1 09 MOV CL,YEAR ;
003C D3 E8 SHR AX,CL
003E 8A F8 MOV BH,AL ; BH
 
0040 A1 0014 R MOV AX,DATE
0043 25 01E0 AND AX,MASK MONTH
0046 B1 05 MOV CL,MONTH
0048 D3 E8 SHR AX,CL
004A 8A D8 MOV BL,AL ; BL
 
. 6.15 ()
004C A1 0014 R MOV AX,DATE
004F 25 001F AND AX,MASK DAY ; AL
 
0052 CB RET
0053 RECORDS ENDP
0053 CODE ENDS
END RECORDS
 
. 6.15 ()
 
. 6.15 DATE_WORD.
RECORD , DATE_WORD
. 7 (YEAR), 4
- (MONTH) 5 - (DAY). ,
MACRO,
, DATE_WORD.
RECORD ,

.
 
DATE FCB
DATE_WORD. DATE ,
DATE_WORD 16- .
,
.

.
 
. 6.15
RECORD, ,
.
, FCB.
FCB
8088.
 
-, FCB
: DATE AX,
AND , .
MASK YEAR. YEAR
- , MASK ,
YEAR.
0FE00H. 7 - ,
. ,
YEAR .

YEAR.
 
YEAR
. YEAR , ,

. . 9
AL. ( ,
DOS 0 119.
1980 2099).
 

MONTH. MASK ,
DATE_WORD.
DAY.
 
,

DOS.
.
BH, BL AL,
.
, ,
ASCII .
,
.
 
RECORD,
. . 6.15
.
,
.
: "Shift Width Mask Initial" (
"). ,
DATE_WORD 16 .
. ,
. ,
,
. . 1
,
.
 
.

WIDTH. ,
 
MOV AL,WIDTH YEAR
 
AL , .
 

,
. ,
.
.
RECORD
. DATE_WORD ,
1 1983 , :
 
DATE_WORD RECORD YEAR:7=3, MONTH:4=1, DAY:5=1
 
,
. ,
. ,
5 1984 ,
:
 
DATE DATE_WORD <4,,5>
 
,
-. ,
, ,
, RECORD.
 
, . 6.15
FCB, STRUC,
. STRUC,

DEFINE.
. ,
. 6.15, -
.
.
,
, ,
RECORD.
DATE_WORD, DATE
. , ,
. .
DATE_WORD
.
 
STRUC.
,
.
FCB
05CH . FCB
,
.
. 6.16 6.15, ,
. . 6.16 FCB
DEFINE, STRUC.
,
DATE_WORD, FCB:
.

Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:03:49
. 6.16 Page 1-1
 
PAGE ,132
TITLE . 6.16
 
DATE_WORD RECORD YEAR:7,MONTH:4,DAY:5
 
FCB STRUC
0000 00 DRIVE DB 0 ;
0001 20 20 20 20 20 20 20 FILE_NAME DB ' ' ;
 
. 6.16 ()
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 ;
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 RECORDS PROC FAR
0000 1E PUSH DS ;
0001 B8 0000 MOV AX,0
0004 50 PUSH AX
ASSUME DS:CODE ; DS PSP
0005 BA 005C MOV DX,05CH ; FCB PSP
0008 B4 0F MOV AH,0FH ;
000A CD 21 INT 21H
 
000C BB 005C MOV BX,05CH ; FCB
000F 8B 47 14 MOV AX,[BX].DATE
0012 25 FE00 AND AX,MASK YEAR ;
0015 B9 0009 MOV CX,YEAR ;
0018 D3 E8 SHR AX,CL
001A 8A F0 MOV DH,AL ; DH
 
001C 8B 47 14 MOV AX,[BX].DATE
001F 25 01E0 AND AX,MASK MONTH
0022 B9 0005 MOV CX,MONTH
0025 D3 E8 SHR AX,CL
0027 8A D0 MOV DL,AL ; DL
 
0029 8B 47 14 MOV AX,[BX].DATE
002C 25 001F AND AX,MASK DAY ; AL
 
002F CB RET
0030 RECORDS ENDP
0030 CODE ENDS
END RECORDS
 
. 6.16 ()
.
,
.
STRUC,
.
.
.
MASK ,
RECORD.
 

,
.
.

,
: ,
.
.
, , ,

INCLUDE:
.
, .









-