
лабораторная работа / лабораторные работы по ASSAMBLER / спо4
.docLAB SEGMENT PARA 'CODE'
ASSUME CS:LAB; DS:LAB; SS:LAB
ORG 100H
AD: JMP ASD
FLOT1 DB 30 DUP (' ')
ASD PROC
CLD
CALL W3
CLL W4
CALL W2
MOV CX,10
LEA DX,FLOT1
M0: MOV AL,'S'
REPNE SCASB
JNE M3
dec di
MOV AL,'$'
STOSB
M3:INC DX
LOOP M0
CALL W5
CALL W1
RET
ASD ENDP
W3 PROC
MOV AX,0600H
MOV BH,07
MOV CX,0000
MOV DX,184FH
INT 10H
RET
W3 ENDP
W4 PROC
MOV AH,00
INT 16H
CMP AL,00
JNE EXIT
CMP AH,47H
JNE EXIT
MOV AH,02
MOV BH,00
MOV DX,1647
INT 10H
EXIT: RET
W4 ENDP
W2 PROC
MOV AH,3FH
MOV BX,00
MOV CX,10
LEA DX,FLOT1
INT 21H
RET
W2 ENDP
W5 PROC
MOV AH,02
MOV BH,00
MOV DH,01
MOV DL,15
INT 10H
RET
W5 ENDP
W1 PROC
MOV AH,40H
MOV BX,01
MOV CX,10
LEA DX,FLOT1
INT 21H
RET
W1 ENDP
LAB ENDS
END AD
LAB SEGMENT PARA 'CODE'
ASSUME CS:LAB; DS:LAB; SS:LAB
3 ORG 100H
4 0100 EB 1F 90 AD: JMP ASD
5 0103 1E*(20) FLOT1 DB 30 DUP
6 0121 ASD PROC
7 0121 FC CLD
8 0122 E8 0020 CALL W3
9 0125 E8 002B CALL W4
10 0128 E8 003F CALL W2
11 012B B9 000A MOV CX,10
12 012E BA 0103r LEA DX,FLOT1
13 0131 B0 4E M0: MOV AL,'s'
14 0133 F2> AE REPNE SCASB
15 0135 75 04 JNE M3
16 0137 4F dec di
17 0138 B0 24 MOV AL,'$'
18 013A AA STOSB
19 013B 42 M3:INC DX
20 013C E2 F3 LOOP M0
21 013E E8 0037 CALL W5
22 0141 E8 003F CALL W1
23 0144 C3 RET
24 0145 ASD ENDP
25 0145 W3 PROC
26 0145 B8 0600 MOV AX,0600H
27 0148 B7 07 MOV BH,07
28 014A B9 0000 MOV CX,0000
29 014D BA 184F MOV DX,184FH
30 0150 CD 10 INT 10H
31 0152 C3 RET
32 0153 W3 ENDP
33 0153 W4 PROC
34 0153 B4 00 MOV AH,00
35 0155 CD 16 INT 16H
36 0157 3C 00 CMP AL,00
37 0159 75 0E JNE EXIT
38 015B 80 FC 47 CMP AH,47H
39 015E 75 09 JNE EXIT
40 0160 B4 02 MOV AH,02
41 0162 B7 00 MOV BH,00
42 0164 BA 066F MOV DX,1647
43 0167 CD 10 INT 10H
44 0169 C3 EXIT: RET
45 016A W4 ENDP
46 016A W2 PROC
47 016A B4 3F MOV AH,3FH
48 016C BB 0000 MOV BX,00
49 016F B9 000A MOV CX,10
50 0172 BA 0103r LEA DX,FLOT1
51 0175 CD 21 INT 21H
52 0177 C3 RET
53 0178 W2 ENDP
54 0178 W5 PROC
55 0178 B4 02 MOV AH,02
56 017A B7 00 MOV BH,00
57 017C B6 01 MOV DH,01
Turbo Assembler Version 3.1 24/04/04 09:04:03 Page 2
4.ASM
58 017E B2 0F MOV DL,15
59 0180 CD 10 INT 10H
60 0182 C3 RET
61 0183 W5 ENDP
62 0183 W1 PROC
63 0183 B4 40 MOV AH,40H
64 0185 BB 0001 MOV BX,01
65 0188 B9 000A MOV CX,10
66 018B BA 0103r LEA DX,FLOT1
67 018E CD 21 INT 21H
68 0190 C3 RET
69 0191 W1 ENDP
70 0191 LAB ENDS
71 END AD