Assembler






, , ,
, .
,
. PUBLIC,
,
. , ,

. EXTRN,

, .
,

.
 
EXTRN . -,
,
. ,
, ,
, . , -
, ,
, .
.
, , -
, . ,
.
 
EXTRN ,
.
,
, .
. EXTRN
, .

NEAR, FAR, ,
. EXTRN
.
, EXTERN
, .
EXTRN,
. ,
, EXTERN
.
 
. 5.13 ,
EXTRN.
, . OUTPUT_CHARACTER
.
":BYTE" . NEAR
OUTPUT_ROUTINE ,
. . 5.13
, ,
. EXTRN
,
. ,
, ,
E.

icrosoft (R) Macro Assembler Version 5.00 4/2/89 16:06:36
. 5.13 Page 1-1
 
 
PAGE ,132
TITLE . 5.13
 
0000 STACK SEGMENT STACK
0000 0040[ DW 64 DUP (?) ;
????
]
 
0080 STACK ENDS
 
0000 CODE SEGMENT PUBLIC
 
EXTRN OUTPUT_ROUTINE:NEAR, OUTPUT_CHARACTER:BYTE
 
ASSUME CS:CODE
 
0000 START PROC FAR
 
0000 1E PUSH DS ;
0001 B8 0000 MOV AX, 0
0004 50 PUSH AX ;
0005 FC CLD ;
0006 8C C8 MOV AX, CS ;
0008 8E D8 MOV DS, AX
ASSUME DS:CODE ;
000A 8D 36 001D R LEA SI, MESSAGE ;
000E CLOOP:
000E AC LODSB ;
000F A2 0000 E MOV OUTPUT_CHARACTER, AL ;
0012 E8 0000 E CALL OUTPUT_ROUTINE ;
0015 80 3E 0000 E 0A CMP OUTPUT_CHARACTER, 10 ;
001A 75 F2 JNE CLOOP ;
 
001C CB RET ;
 
001D 9D E2 A0 20 AF E0 AE MESSAGE DB ' - ', 13, 10
A3 E0 A0 AC AC A0 20
2D 20 E2 A5 E1 E2 0D
0A
0033 START ENDP
0033 CODE ENDS
END START
 
. 5.13
Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:02:28
. 5.14 Page 1-1
 
 
PAGE ,132
TITLE . 5.14
 
0000 CODE SEGMENT PUBLIC
ASSUME CS:CODE,DS:CODE ;
 
PUBLIC OUTPUT_CHARACTER, OUTPUT_ROUTINE
 
0000 ?? OUTPUT_CHARACTER DB ?
 
0001 OUTPUT_ROUTINE PROC NEAR
0001 A0 0000 R MOV AL, OUTPUT_CHARACTER ;
0004 B4 0E MOV AH, 14 ; BIOS
0006 BB 0000 MOV BX, 0 ;
0009 BA 0000 MOV DX, 0
000C CD 10 INT 10H ;
000E C3 RET ;
 
000F OUTPUT_ROUTINE ENDP
000F CODE ENDS
END
 
. 5.14
 
.
? . 5.14
, ,
. 5.13. ,
, . 5.13,
PUBLIC. ,
.
,
PUBLIC, .
, ,
PUBLIC, . ,
,
, , ..

.
,
,
,
. , PUBLIC
:
.
LINK
PUBLIC,
.
, .
,
"E".
 
,
. . 5.13 5.14

CODE. EXTRN
OUTPUT_ROUTINE NEAR,
, .
PUBLIC SEGMENT
.
 
. 5.13 ,
. .EXE.
.EXE DOS
.
,
.EXE. .
, .

.
, ..
.
STACK, .5.13. STACK
STACK ,
. ,
, , ,
.