, . -. , .
:
1) , . ;
2) - , ;
3) , . ;
4) , , . . ; .
1) :
s_s segment stack "stack";
dw 12 dup(?); 24
;
s_s ends;
d_s segment;
aa dw 7145h, 23h;, .. 7145h 23h
; +2 , ..
;
sum dw 0; , .. 0 sum
d_s ends;
c_s segment;
assume ss:s_s,ds:d_s,cs:c_s;, ,
;
;
;
begin:; pp
mov ax,d_s; (ds)
; , ..
;
mov ds,ax; ds
; ,
; ax, ..
;
mov ax,aa; ax ,
; , .. 7145h
add ax,aa+2; , ax
;, +2
;.. 23h ax
mov sum,ax; ax, ..
; sum
mov ah,4ch;
; ah - 4ch
int 21h; 21h
c_s ends;
end begin; .
; .
2) c :
s_s segment stack "stack";
dw 12 dup(?); 24
s_s ends;
d_s segment;
aa dw 5435h,4531h; , .. 5435h, 4531h
|
|
; +2 , ..
;
s1 dw 2h; s1 2
sum dw?; sum ( )
d_s ends;
c_s segment;
assume ss:s_s,ds:d_s,cs:c_s;
begin:;
mov ax,d_s
mov ds,ax
mov ax,aa; ax ,
; , .. 5435h
add ax,aa+2; , ax
;, +2, ..
; 4531h, ax
jno kof;, (OF=0)
mov ax,aa; OF=1 - ,
add ax,s1;
kof: mov sum,ax; ax, ..
; sum
mov ah,4ch;
; ah4ch
int 21h; 21h
c_s ends;
end begin;
3) 3 4 :
s_s segment stack "stack"
dw 12 dup(?)
s_s ends
d_s segment
a db 75h
sum db 0h
d_s ends
c_s segment
assume ss:s_s,ds:d_s,cs:c_s
begin:
mov ax,d_s
mov ds,ax
mov dl,aa; dl ,
; , .. 75h
and dl,11100111b; 3 4, ..
mov sum,dl; sum
mov ah,4ch
int 21h
c_s ends
End begin
4) p p :
s_s segment stack "stack"
dw 12 dup(?)
s_s ends
d_s segment
soob dw ʒ,0ah,0dh,$; , ,
; 0ah -p p,
; 0dh - p p, $ -
d_s ends
c_s segment
assume ss:s_s,ds:d_s,cs:c_s
begin:
mov ax,d_s
mov ds,ax
mov ah,9h; p p - 9h
lea dx,soob; dx - p p
int 21h; p
mov ah,4ch
int 21h
c_s ends
End begin
. LEA, MOV , , .
5) pp, :
d_s segment
aa dw 10
d_s ends
c_s segment
assume ss:s_s,ds:d_s,cs:c_s
begin:
mov ax,d_s
mov ds,ax;
cmp aa,10
jbe met1; met1,
; 10
;
met1: mov ah,4ch
int 21h
c_s ends
End begin
6) pp, - ( , )
d_s segment
sum db 0
d_s ends
c_s segment
assume ss:s_s,ds:d_s,cs:c_s
begin:
mov ax,d_s
mov ds,ax
mov al,14h; N (14 -
out 70h,al;) 70h (
; al)
in al,71h; 14 71h
test al,10b; 1 - , ,
;
jz no_c; 1 ,
................; ( 1),
..............;
mov sum, al
no_c: mov sum, ah;
mov ah,4ch
int 21h
c_s ends
End begin
7) pp, :
|
|
s_s segment stack "stack"
dw 12 dup(?)
s_s ends
d_s segment
aa dw 10
d_s ends
c_s segment
assume ss:s_s,ds:d_s,cs:c_s
begin:
mov ax,d_s
mov ds,ax
call pr1;
call pr1;
mov ah,4ch
int 21h
pr1 proc near; ( )
push ax;
mov ax, aa
pop ax;
ret;
;
pr1 endp;
c_s ends
End begin
, , .EXE. pp : 1) p, pp ; 2) p DS p . pp p pp. .COM p 64 .
, , 0.