ΠΡΡΠ΅ΠΌΠ±Π»Π΅Ρ ΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅
ΠΠΈΡΠ΅Ρ ΠΠ±Π΅Π»Ρ. ΠΡΡΠ΅ΠΌΠ±Π»Π΅Ρ ΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π΄Π»Ρ IBM PC. ΠΠΈΡΠ½ΠΈΡΠΊΠΈΠΉ Π. — ΠΡΡ ΠΈΡΠ΅ΠΊΡΡΡΠ° IBM PC ΠΈ ΡΠ·ΡΠΊ ΠΡΡΠ΅ΠΌΠ±Π»Π΅ΡΠ°. ΠΠ°Π΄Π°Π½ΠΈΠ΅ ΠΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΊΠ° — ΠΊΡΡΡΠΎΠ²ΠΎΠ΅ Π·Π°Π΄Π°Π½ΠΈΠ΅, Π²Π°ΡΠΈΠ°Π½Ρ 1. Str1 db 'Registr AX soderzhit 11 0000b, a registr DX soderzhit 100 0100b', 10,13,'$'. 783.99, 659.26, 659.26, 880.00, 1046.50, 987.77, 880.00, 1046.50, 880.00, 987.77, 880.00,. Float snd = {659.26, 880.00, 1046.50, 987.77, 880.00, 1046.50… Π§ΠΈΡΠ°ΡΡ Π΅ΡΡ >
ΠΡΡΠ΅ΠΌΠ±Π»Π΅Ρ ΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ (ΡΠ΅ΡΠ΅ΡΠ°Ρ, ΠΊΡΡΡΠΎΠ²Π°Ρ, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½Π°Ρ)
Π‘ΠΎΠ΄Π΅ΡΠΆΠ°Π½ΠΈΠ΅ ΠΠ°Π΄Π°Π½ΠΈΠ΅ 2
1. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 1 3
2. ASM 1 4
3. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 2 7
4. ASM 2 8
5. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 3 11
6. ASM 3 12
7. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 4 16
8. ASM 4 17
9. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 5 19
10. ASM 5 20
11. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 6 23
12. ASM 6 24
13. KOMP. CPP 26
14. Π ΡΠΊΠΎΠ²ΠΎΠ΄ΡΡΠ²ΠΎ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ 36
Π‘ΠΏΠΈΡΠΎΠΊ Π»ΠΈΡΠ΅ΡΠ°ΡΡΡΡ
39
ΠΠ°Π΄Π°Π½ΠΈΠ΅ ΠΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΊΠ° — ΠΊΡΡΡΠΎΠ²ΠΎΠ΅ Π·Π°Π΄Π°Π½ΠΈΠ΅, Π²Π°ΡΠΈΠ°Π½Ρ 1
Π’ΡΠΈ Π±Π°ΠΉΡΠΎΠ²ΡΠ΅ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ A, B, ΠΈ C ΡΠΎΠ΄Π΅ΡΠΆΠ°Ρ ΡΠ΅Π»ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ. Π£ΠΏΠΎΡΡΠ΄ΠΎΡΠΈΡΡ ΡΡΠΈ Π·Π½Π°ΡΠ΅Π½ΠΈΡ ΠΏΠΎ Π²ΠΎΠ·ΡΠ°ΡΡΠ°Π½ΠΈΡ ΡΠ°ΠΊ, ΡΡΠΎΠ±Ρ A ΡΠΎΠ΄Π΅ΡΠΆΠ°Π»Π° ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅, Π° Π‘ — ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ΅.
ΠΠ°Π΄Π°Π½ Π±Π°ΠΉΡΠΎΠ²ΡΠΉ ΠΌΠ°ΡΡΠΈΠ² ΠΈΠ· N ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ² Π² Π½Π΅ΡΠΏΠ°ΠΊΠΎΠ²Π°Π½Π½ΠΎΠΌ BCD ΡΠΎΡΠΌΠ°ΡΠ΅. ΠΠ°ΠΏΠΈΡΠ°ΡΡ ΠΏΡΠΎΡΠ΅Π΄ΡΡΡ ΠΏΡΠ΅ΠΎΠ±ΡΠ°Π·ΠΎΠ²Π°Π½ΠΈΡ ΠΈΡΡ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΌΠ°ΡΡΠΈΠ²Π° ΠΠ°Π΄Π°Π½ Π±Π°ΠΉΡΠΎΠ²ΡΠΉ ΠΌΠ°ΡΡΠΈΠ² ΠΈΠ· N ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ². ΠΠ°ΠΏΠΈΡΠ°ΡΡ ΠΏΡΠΎΡΠ΅Π΄ΡΡΡ, ΠΎΡΡΡΠΊΠΈΠ²Π°ΡΡΡΡ: Π½ΠΎΠΌΠ΅Ρ ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΈ ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ³ΠΎ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ², Π° ΡΠ°ΠΊΠΆΠ΅ ΡΠ°Π·Π½ΠΎΡΡΡ ΠΌΠ΅ΠΆΠ΄Ρ ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½ΡΠΌ ΠΈ ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½ΡΠΌ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ°ΠΌΠΈ.
ΠΠ°ΠΏΠΈΡΠ°ΡΡ ΠΏΡΠΎΡΠ΅Π΄ΡΡΡ Π½ΠΎΡΠΌΠ°Π»ΠΈΠ·Π°ΡΠΈΠΈ Π·Π½Π°ΡΠ΅Π½ΠΈΡ, ΡΠΎΠ΄Π΅ΡΠΆΠ°ΡΠ΅Π³ΠΎΡΡ Π² AX. ΠΠΎΡΠΌΠ°Π»ΠΈΠ·Π°ΡΠΈΡ Π·Π°ΠΊΠ»ΡΡΠ°Π΅ΡΡΡ Π² ΡΠ΄Π²ΠΈΠ³Π΅ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ³ΠΎ AX Π²Π»Π΅Π²ΠΎ Π΄ΠΎ ΡΠ΅Ρ ΠΏΠΎΡ, ΠΏΠΎΠΊΠ° ΡΡΠ°ΡΡΠΈΠΉ ΠΈΠ· Π±ΠΈΡΠΎΠ², ΠΈΠΌΠ΅ΡΡΠΈΡ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ 1, Π½Π΅ ΠΏΠΎΠΏΠ°Π΄Π΅Ρ Π² 15-ΠΉ ΡΠ°Π·ΡΡΠ΄. ΠΡΠ»ΠΈ ΠΆΠ΅ ΡΡΠ°Π·Ρ (AX)=0 ΠΈΠ»ΠΈ 15-ΠΉ ΡΠ°Π·ΡΡΠ΄ ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ 1, ΡΠΎ ΠΏΡΠΎΡΠ΅Π΄ΡΡΠ° Π½Π΅ Π΄ΠΎΠ»ΠΆΠ½Π° Π²ΡΠΏΠΎΠ»Π½ΡΡΡΡΡ. ΠΡΠΈ Π²ΡΡ ΠΎΠ΄Π΅ ΠΈΠ· ΠΏΡΠΎΡΠ΅Π΄ΡΡΡ ΡΠ΅Π³ΠΈΡΡΡ BX Π΄ΠΎΠ»ΠΆΠ΅Π½ ΡΠΎΠ΄Π΅ΡΠΆΠ°ΡΡ ΡΠΈΡΠ»ΠΎ, ΡΠ°Π²Π½ΠΎΠ΅ ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²Ρ Π²ΡΠΏΠΎΠ»Π½Π΅Π½Π½ΡΡ ΡΠ΄Π²ΠΈΠ³ΠΎΠ².
Π‘ΡΠΈΡΠ°Ρ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ ΡΠ΅Π³ΠΈΡΡΡΠΎΠ² DX: AX 32-Π±ΠΈΡΠ½ΠΎΠΉ Π²Π΅Π»ΠΈΡΠΈΠ½ΠΎΠΉ, Π½Π°ΠΏΠΈΡΠ°ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, Π·Π°Π³ΡΡΠΆΠ°ΡΡΡΡ Π² ΡΠ΅Π³ΠΈΡΡΡ DL Π½ΠΎΠΌΠ΅Ρ ΡΠ°ΠΌΠΎΠ³ΠΎ ΠΌΠ»Π°Π΄ΡΠ΅Π³ΠΎ Π±ΠΈΡΠ°, ΡΠΎΠ΄Π΅ΡΠΆΠ°ΡΠ΅Π³ΠΎ 1.
ΠΠ½Π΄ΠΈΠ²ΠΈΠ΄ΡΠ°Π»ΡΠ½ΠΎΠ΅ Π·Π°Π΄Π°Π½ΠΈΠ΅: ΠΎΠΏΡΠ΅Π΄Π΅Π»ΠΈΡΡ ΡΠ°Π·ΠΌΠ΅Ρ ΡΠ°ΠΉΠ»Π° ΠΈΠ· DTA.
1. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 1
2. ASM 1
mes macro msg
mov ah, 9
lea dx, msg
int 21h
endm
abc macro char
add char,'0'
mov dl, char
mov ah, 2
int 21h
sub char,'0'
endm
d_seg segment
a db 5
b db 9
c db 3
str db 'Ishodnie dannie:', 10,13,'$'
str2 db 'Resultat sortirovki po vozrastaniyu', 10,13,'$'
str3 db 'Press any key…$'
enter db 10,13,'$'
space db ' ','$'
strA db 'A=','$'
strB db 'B=','$'
strC db 'C=','$'
d_seg ends
c_seg segment
assume ds: d_seg, cs: c_seg
start:mov ax, d_seg
mov ds, ax
mes enter
mes str
mes enter
mes strA
abc a
mes space
mes strB
abc b
mes space
mes strC
abc c
mes enter
mov al, a
mov bl, b
mov cl, c
cmp al, bl
jl continue
xchg al, bl
continue:
cmp al, cl
jl continue2
xchg al, cl
continue2:
cmp bl, cl
jl continue3
xchg bl, cl
continue3:
mov a, al
mov b, bl
mov c, cl
mes enter
mes str2
mes enter
mes strA
abc a
mes space
mes strB
abc b
mes space
mes strC
abc c
mes enter
mes enter
mes str3
mov ah, 1
int 21h
mov ah, 4ch
int 21h
c_seg ends
end start
3. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 2
4. ASM 2
mes macro msg
mov ah, 9
lea dx, msg
int 21h
endm
dseg segment
k dw 10
mdb10
masdb1,3,6,8,9,1,4,7,2,3,7,9,4,5,8,9
str db 'Ishodnii massiv elementov v neupakovannom BCD formate:', 10,13,'$'
str1 db 10,13,'Poluchenii massiv elementov v ypakovannom BCD formate:', 10,13,'$'
str2 db 10,13,'Press any key…', 10,13,'$'
enter db 10,13,'$'
space db ' $'
dseg ends
cseg segment
assume cs: cseg, ds: dseg
vivod proc
xor cx, cx
k_del:
mov dx, 0
div k
add dx,'0'
push dx
inc cx
cmp ax, 0
jne k_del
k3:
pop dx
mov ah, 2
int 21h
loop k3
ret
vivod endp
abcproc
xorsi, si
xordi, di
movbx, 16
movcx, 16
decbx
m2:
moval, mas[si]
mulm
incsi
addal, mas[si]
movmas[di], al
cmpsi, bx
jem1
incdi
incsi
loop m2
m1:
ret
abcendp
start:
movax, dseg
movds, ax
mes enter
mes str
mes enter
mov bx, 0
met2: mov al, mas[bx]
mov ah, 0
call vivod
mes space
inc bx
cmp bx, 15
jle met2
call abc
mes enter
mes str1
mes enter
mov bx, 0
met1: mov al, mas[bx]
mov ah, 0
call vivod
mes space
inc bx
cmp bx, 7
jle met1
mes enter
mes str2
mov ah, 1
int 21h
movah, 4ch
int21h
cseg ends
end start
5. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 3
6. ASM 3
char1 macro b
add b,'0'
mov dl, b
mov ah, 2
int 21h
sub b, '0'
endm
char macro a
xor dx, dx
mov ax, a
mov bx, 10
div bx
add dl,'0'
mov ah, 2
int 21h
endm
mes macro str
mov ah, 9
lea dx, str
int 21h
endm
d_seg segment
mindb0
maxdb0
n_mindw1
n_maxdw1
razdb0
adb2,6,4,1,7,9,3
n=$-a
enter db 10,13,'$'
str db 10,13,'Ishodnii massiv: $'
str1 db 10,13,'Resultat: $'
str2 db 10,13,'Number min chisla: $'
str3 db 10,13,'Number max chisla: $'
str4 db 10,13,'Raznost mezhdu max i min chislami: $'
str5 db 10,13,'Press any key…$'
space db ' $'
d_seg ends
c_seg segment
assume cs: c_seg, ds: d_seg
start:
movax, d_seg
movds, ax
xorsi, si
moval, a[si]
movmin, al
movmax, al
incsi
m3:
moval, a[si]
cmpal, max
jlem1
movmax, al
movbx, si
incbx
movn_max, bx
m1:
cmpal, min
jgem2
movmin, al
movbx, si
incbx
movn_min, bx
m2:
incsi
cmpsi, n
jlm3
moval, max
subal, min
movraz, al
mes str
mes enter
xor si, si
povtor:
char1 a[si]
mes space
inc si
cmp si, n
jne povtor
mes enter
mes str1
mes enter
mes str2
char n_min
mes enter
mes str3
char n_max
mes enter
mes str4
char1 raz
mes enter
mes enter
mes str5
mov ah, 1
int 21h
movah, 4ch
int21h
c_seg ends
end start
7. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 4
8. ASM 4
mes macro str
mov ah, 9
lea dx, str
int 21h
endm
dseg segment
str db 10,13,'AX soderzhit znachenie 2345h$'
str1 db 10,13,'Posle normalizacii znacheniya AX, BX soderzhit chislo vipolnenih sdvigov$' $'
str2 db 10,13,'BX = $'
str3 db 10,13,'Press any key…$'
enter db 10,13,'$'
x dw 2345h
dseg ends
cseg segment
assume cs: cseg, ds: dseg
start: mov ax, dseg
mov ds, ax
mov ax, x
push ax
xor dx, dx
cmp ax, dx
je exit
xor si, si
cont: mov cx, 2
mov dx, 100 000 000 000 0000b
mov bx, ax
or bx, dx
cmp bx, ax
je exit
inc si
shl ax, 1
loop cont
exit: mes str
mes enter
mes str1
mes enter
mes str2
mov bx, si
xor dx, dx
push bx
mov ax, bx
mov bx, 10
div bx
add dx,'0'
mov ah, 2
int 21h
pop ax
pop bx
mes enter
mes str3
mov ah, 1
int 21h
mov ah, 4ch
int 21h
cseg ends
end start
9. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 5
10. ASM 5
mes macro msg
mov ah, 9
lea dx, msg
int 21h
endm
d_seg segment
k dw 10
str1 db 'Registr AX soderzhit 11 0000b, a registr DX soderzhit 100 0100b', 10,13,'$'
str2 db 'Nomer samogo mladshego bita, soderzhaschego 1', 10,13,'$'
str3 db 10,13,'Press any key…', 10,13,'$'
enter db 10,13,'$'
d_seg ends
c_seg segment
assume ds: d_seg, cs: c_seg
vivod proc
xor cx, cx
k_del:
sub dx, dx
div k
add dx,'0'
push dx
inc cx
cmp ax, 0
jne k_del
k3:
pop dx
mov ah, 2
int 21h
loop k3
ret
vivod endp
start:
mov ax, d_seg
mov ds, ax
mov ax, 11 0000b
mov dx, 100 0100b
nachalo:
clc
rcr ax, 1
inc bx
jc vivod1
cmp ax, 0
jne nachalo
mov bx, 7
m1:
clc
rcr dx, 1
inc bx
jc vivod1
cmp dx, 0
jne m1
vivod1:
mes enter
mes str1
mes enter
mes str2
mes enter
mov dl, bl
mov ax, dx
call vivod
mes enter
mes str3
mov ah, 1
int 21h
mov ah, 4ch
int 21h
c_seg ends
end start
11. ΠΠ»ΠΎΠΊ-ΡΡ Π΅ΠΌΠ° ΠΊ Π·Π°Π΄Π°Π½ΠΈΡ 6
12. ASM 6
mes macro str
mov ah, 9
lea dx, str
int 21h
endm
dseg segment
ten dw 10
filename db 8 dup (0)
dta db 2ch dup (' '), 0,10,13,'$'
error db 10,13,'File not found', 10,13,'$'
exit db 10,13,'Press any key…$'
inp db 'Input filename:', 10,13,'$'
out1 db 10,13,10,13,'Size file in DTA:', 10,13,10,13,'$'
out2 db 'FILE_NAME — $'
out3 db 'FILE_SIZE — $'
out4 db ' bytes', 10,13,'$'
dseg ends
cseg segment
assume cs: cseg, ds: dseg
start: mov ax, dseg
mov ds, ax
mes inp
mov ah, 1ah
lea dx, dta
int 21h
xor si, si
povtor: mov ah, 1
int 21h
cmp al, 13
je ok
mov filename[si], al
inc si
jmp povtor
ok:mov ah, 4eh
lea dx, filename
mov cx, 0
int 21h
jc err
mes out1
mes out2
mes dta[1eh]
mes out3
mov dx, word ptr dta[1ah]+2
mov ax, word ptr dta[1ah]
mov cx, 0
jmp next
l1:mov dx, 0
next:div ten
push dx
inc cx
cmp ax, 0
jne l1
n: pop dx
add dx,'0'
mov ah, 2
int 21h
loop n
mes out4
jmp quit
err:mes error
quit:mes exit
mov ah, 1
int 21h
mov ah, 4ch
int 21h
cseg ends
end start
13. KOMP. CPP
#include
#include
#include
#include
#include
#include
#include
#include
void pomehi (int x, int y, int i)
{
setcolor (i);
line (x-100,y-60,x-80,y-60);
line (x-60,y-50,x-40,y-50);
line (x-20,y-60,x, y-60);
line (x+20,y-50,x+40,y-50);
line (x+60,y-60,x+80,y-60);
line (x-100,y-20,x-80,y-20);
line (x-60,y-10,x-40,y-10);
line (x-20,y-20,x, y-20);
line (x+20,y-10,x+40,y-10);
line (x+60,y-20,x+80,y-20);
line (x-100,y+20,x-80,y+20);
line (x-60,y+30,x-40,y+30);
line (x-20,y+20,x, y+20);
line (x+20,y+30,x+40,y+30);
line (x+60,y+20,x+80,y+20);
line (x-100,y+60,x-80,y+60);
line (x-60,y+70,x-40,y+70);
line (x-20,y+60,x, y+60);
line (x+20,y+70,x+40,y+70);
line (x+60,y+60,x+80,y+60);
}
void komp (int x, int y)
{
int i;
///////////////monitor////////////////
i=8;
setcolor (i);
rectangle (x-120, y-100, x+120, y+100);
setfillstyle (SOLID_FILL, i);
floodfill (x-115,y-95,i);
i=0;
setcolor (i);
rectangle (x-110, y-90, x+110, y+90);
setfillstyle (SOLID_FILL, i);
floodfill (x, y, i);
i=0;
setcolor (i);
line (x-120, y-100, x-110, y-110);
line (x+120, y+100, x+130, y+90);
line (x+120, y-100, x+130, y-110);
line (x-110, y-110, x+130, y-110);
line (x+130, y-110, x+130, y+90);
line (x+20, y+110, x+20, y+100);
line (x-20, y+110, x-20, y+100);
rectangle (x+60, y+110, x-60, y+120);
line (x+60, y+110, x+70, y+100);
line (x+60, y+120, x+80, y+100);
line (x-60, y+110, x-50, y+100);
line (x+20, y+110, x+30, y+100);
circle (x+110,y+95,3);
circle (x+100,y+95,2);
circle (x+90,y+95,2);
///////////////sistemnik//////////////
i=0;
setcolor (i);
rectangle (x-130, y+120, x-200, y-100);
line (x-200, y-100, x-110, y-190);
line (x-130, y-100, x-40, y-190);
line (x-110, y-190, x-40, y-190);
line (x-130, y+120, x-110, y+100);
line (x-40, y-190, x-40, y-110);
rectangle (x-190, y-90, x-140, y-80);
rectangle (x-190, y-70, x-140, y-60);
rectangle (x-190, y-50, x-140, y-40);
rectangle (x-190, y-30, x-140, y-20);
rectangle (x-180, y-10, x-150, y);
rectangle (x-180, y+10, x-150, y+20);
rectangle (x-190, y+100, x-140, y+110);
circle (x-165,y+80,5);
circle (x-165,y+60,4);
line (x-165,y+80,x-165,y+84);
circle (x-165,y+80,2);}
void kolonki (int x, int y, int i)
{int k;
//////////////left//////////////////
k=i;
i=15;
setfillstyle (INTERLEAVE_FILL, i);
i=k;
setcolor (i);
rectangle (x-210, y+120, x-260, y+60);
line (x-210, y+120, x-200, y+110);
line (x-210, y+60, x-200, y+50);
line (x-260, y+60, x-240, y+40);
line (x-240, y+40, x-200, y+40);
i=k;
setcolor (i);
pieslice (x-235, y+90, 0, 180, 20);
rectangle (x-255, y+90, x-215, y+110);
floodfill (x-245,y+95,i);
//////////////right/////////////////
rectangle (x+140, y+120, x+190, y+60);
line (x+190, y+120, x+210, y+100);
line (x+190, y+60, x+210, y+40);
line (x+140, y+60, x+160, y+40);
line (x+160, y+40, x+210, y+40);
line (x+210, y+100, x+210, y+40);
i=k;
setcolor (i);
pieslice (x+165, y+90, 0, 180, 20);
rectangle (x+145, y+90, x+185, y+110);
floodfill (x+155,y+95,i);
circle (x+165,y+115,4);
circle (x+155,y+115,3);
circle (x+175,y+115,3);
arc (x+165,y+40,0,150,40);
}
void main ()
{int dr=DETECT, mod;
float snd[] = {659.26, 880.00, 1046.50, 987.77, 880.00, 1046.50, 880.00, 987.77, 880.00,
698.46, 783.99, 659.26, 659.26, 880.00, 1046.50, 987.77, 880.00, 1046.50, 880.00, 987.77, 880.00,
659.26, 622.25, 587.33, 587.33, 698.46, 880.00, 987.77, 587.33, 698.46,
830.61, 880.00, 440.00, 523.25, 698.46, 698.46, 659.26, 783.95, 698.46, 698.46,
659.26, 493.88, 523.25, 440.00, 987.77, 987.77, 932.33, 880.00, 987.77, 987.77,
880.00, 783.99, 698.46, 659.26, 659.26, 783.99, 659.26, 587.33, 587.33,
698.46, 587.33, 493.88} ;
int x, y, err, i, ki, key, r, h, c, x1,x2,y1,y2;
char s, str[80]={'K','U','R','S','O','V','A','Y','A',' ','R','A','B','O','T','A'};
initgraph (&dr,&mod," «);
err=graphresult ();
if (err){
cout<<" error initgraph" <
exit (1); }
snachala:
cleardevice ();
i=7;
x=getmaxx ()/2;
y=getmaxy ()/2;
setfillstyle (SOLID_FILL, i);
floodfill (x, y, i);
setcolor (4);
outtextxy (400,70," Press any key for STOP Music");
outtextxy (400,80," Press 'P' for PLAY Music");
outtextxy (400,90," Press 'M' for GOTO MENU");
outtextxy (400,100," Press 'Esc' for exit");
settextstyle (0,0,3);
setcolor (2);
outtextxy (150,15,str);
settextstyle (0,0,2);
setcolor (6);
outtextxy (330,380," KAFEDRA: EVM");
setcolor (5);
outtextxy (330,420," SPECIALNOST: VMKSiS");
setcolor (4);
outtextxy (30,380," VIPOLNIL:");
settextstyle (0,0,1);
setcolor (1);
outtextxy (180,380," STUDENT FITU 1−2a");
settextstyle (0,0,1);
setcolor (0);
outtextxy (180,390," XLINTCEV A.G.");
settextstyle (0,0,2);
setcolor (4);
outtextxy (30,420," PROVERIL:");
settextstyle (0,0,1);
setcolor (1);
outtextxy (180,420," KOLOMEICEVA T.G.");
settextstyle (0,0,1);
setcolor (0);
outtextxy (180,430," BELIKOV I.Yu.");
komp (x, y); m1:
for (r=0;r<62;r++)
{
if (kbhit ()) break;
i=15;
pomehi (x, y, i);
delay (100);
i=7;
kolonki (x, y, i);
i=0;
kolonki (x, y-10, i);
i=0;
pomehi (x, y, i);
delay (100);
sound (snd[r]/1.5);
if (r==11 ^ r==23 ^ r==27 ^ r==31 ^ r==43) { delay (1500); nosound (); delay (600); }
else if (r==53 ^ r==57 ^ r==61) { delay (300); nosound (); delay (1400); }
else if (r==47) { delay (500); nosound (); delay (700); }
else delay (50);
i=7;
kolonki (x, y-10,i);
i=0;
kolonki (x, y, i);
}
nosound ();
setcolor (RED);
m:
s=getch ();
if (s==27) exit (1);
if (s=='p') {setfillstyle (SOLID_FILL, 0); floodfill (getmaxx ()/2,getmaxy ()/2,8); goto m1;}
if (s≠'m') goto m;
cleardevice ();
i=15;
setcolor (i);
setfillstyle (SOLID_FILL, i);
floodfill (x, y, i);
settextstyle (0,0,2);
setcolor (RED);
outtextxy (150,30," MENU");
settextstyle (0,0,1);
setcolor (2);
outtextxy (20,100," Zadanie po assembleru #1″);
setcolor (3);
outtextxy (20,135," Zadanie po assembleru #2″);
setcolor (4);
outtextxy (20,170," Zadanie po assembleru #3″);
setcolor (5);
outtextxy (20,205," Zadanie po assembleru #4″);
setcolor (6);
outtextxy (20,240," Zadanie po assembleru #5″);
setcolor (0);
outtextxy (20,275," Zadanie po assembleru #6″);
setcolor (8);
outtextxy (20,310," Zadanie po programmirovaniu");
setcolor (9);
outtextxy (20,345," Back to previos display");
setcolor (12);
outtextxy (20,380," Exit");
ki=1; x1=14; y1=95; x2=250; y2=115;
rectangle (x1,y1,x2,y2);
sled:
key=bioskey (0);
switch (key)
{
case 18 432:{setcolor (15);
rectangle (x1,y1,x2,y2);
if (y1==95) {y1=375;y2=395; ki=9;}
else {y1=y1−35; y2=y2−35; ki—;}
setcolor (RED);
rectangle (x1,y1,x2,y2);
break; }
case 20 480:
{setcolor (15);
rectangle (x1,y1,x2,y2);
if (y1==375) {y1=95;y2=115; ki=1;}
else {y1=y1+35; y2=y2+35; ki++;}
setcolor (RED);
rectangle (x1,y1,x2,y2);
break; }
case 7181: switch (ki)
{ case 1: spawnl (P_WAIT, «1.EXE», NULL); break;
case 2: spawnl (P_WAIT, «2.EXE», NULL); break;
case 3: spawnl (P_WAIT, «3.EXE», NULL); break;
case 4: spawnl (P_WAIT, «4.EXE», NULL); break;
case 5: spawnl (P_WAIT, «5.EXE», NULL); break;
case 6: spawnl (P_WAIT, «6.EXE», NULL); break;
case 7: spawnl (P_WAIT, «CPP.EXE», NULL); break;
case 8: goto snachala;
case 9: closegraph (); exit (1); }
}
goto sled;
}
14. Π ΡΠΊΠΎΠ²ΠΎΠ΄ΡΡΠ²ΠΎ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ ΠΠ»Ρ Π·Π°ΠΏΡΡΠΊΠ° ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΡ Π²ΠΎΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ΡΡ ΡΠ°ΠΉΠ»ΠΎΠΌ KOMP.EXE.Π ΡΠ»ΡΡΠ°Π΅ Π²ΠΎΠ·Π½ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΈΡ ΠΎΡΠΈΠ±ΠΊΠΈ «Error initialization» ΡΠ±Π΅Π΄ΠΈΡΠ΅ΡΡ, ΡΡΠΎ Π² ΠΏΠ°ΠΏΠΊΠ΅ Ρ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ ΡΠ°ΠΊΠΆΠ΅ Π΅ΡΡΡ ΡΠ°ΠΉΠ» Π³ΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ Π΄ΡΠ°ΠΉΠ²Π΅ΡΠ° egavga. bgi ΠΈ Π΅Π³ΠΎ ΠΏΡΡΡ Π² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅ ΡΠΊΠ°Π·Π°Π½ ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΠΎ.
ΠΠ»Ρ Π½ΠΎΡΠΌΠ°Π»ΡΠ½ΠΎΠ³ΠΎ ΡΡΠ½ΠΊΡΠΈΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΡ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ Π½Π°Π»ΠΈΡΠΈΠ΅ Π² ΠΏΠ°ΠΏΠΊΠ΅ ΡΠ»Π΅Π΄ΡΡΡΠΈΡ ΡΠ°ΠΉΠ»ΠΎΠ²:
KOMP.EXE
1.EXE
2.EXE
3.EXE
4.EXE
5.EXE
6.EXE
EGAVGA.BGI
TRIP.CHR
SANS.CHR
LITT.CHR
INPUT.ASM
ΠΡΠ±ΠΎΠΉ ΡΠ°ΠΉΠ» ΡΠ°Π·ΠΌΠ΅ΡΠΎΠΌ < 1 ΠΌΠ΅Π³Π°Π±Π°ΠΉΡΠ° (ΠΏΠΎΡΡΠ΅Π±ΡΠ΅ΡΡΡ Π΄Π»Ρ ΠΈΠ½Π΄ΠΈΠ²ΠΈΠ΄ΡΠ°Π»ΡΠ½ΠΎΠ³ΠΎ Π·Π°Π΄Π°Π½ΠΈΡ) ΠΡΠΈ Π·Π°ΠΏΡΡΠΊΠ΅ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ ΠΎΡΠΎΠ±ΡΠ°ΠΆΠ°Π΅ΡΡΡ Π³ΡΠ°ΡΠΈΡΠ΅ΡΠΊΠ°Ρ Π·Π°ΡΡΠ°Π²ΠΊΠ°, ΡΠΎΠΏΡΠΎΠ²ΠΎΠΆΠ΄Π°Π΅ΠΌΠ°Ρ ΠΌΠ΅Π»ΠΎΠ΄ΠΈΠ΅ΠΉ ΠΈ Π°Π½ΠΈΠΌΠ°ΡΠΈΠ΅ΠΉ, Π° ΡΠ°ΠΊΠΆΠ΅ ΡΠΎΠ΄Π΅ΡΠΆΠ°ΡΠ°Ρ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎΠ± Π°Π²ΡΠΎΡΠ΅.
ΠΠ°ΠΆΠΌΠΈΡΠ΅ «M» Π΄Π»Ρ ΠΎΡΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ ΠΌΠ΅Π½Ρ ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΡ. ΠΡΡ ΠΎΠ΄ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΡΡ Ρ ΠΏΠΎΠΌΠΎΡΡΡ ΠΊΠ»Π°Π²ΠΈΡΠΈ Esc. ΠΡΠΈ Π½Π°ΠΆΠ°ΡΠΈΠΈ Π»ΡΠ±ΠΎΠΉ Π΄ΡΡΠ³ΠΎΠΉ ΠΊΠ»Π°Π²ΠΈΡΠΈ ΠΎΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΡΡΡ ΠΌΠ΅Π»ΠΎΠ΄ΠΈΡ ΠΈ Π°Π½ΠΈΠΌΠ°ΡΠΈΡ.
ΠΠ»Ρ Π·Π°ΠΏΡΡΠΊΠ° Π·Π°Π΄Π°Π½ΠΈΡ, Π½Π°Π²Π΅Π΄ΠΈΡΠ΅ ΠΊΡΡΡΠΎΡ Π½Π° Π·Π°Π΄Π°Π½ΠΈΠ΅ ΠΊΠΎΡΠΎΡΠΎΠ΅ Π²Π°ΠΌ Π½ΡΠΆΠ½ΠΎ ΠΈ Π½Π°ΠΆΠΌΠΈΡΠ΅ Enter. ΠΠ°ΠΏΡΡΠΊΠ°Π΅ΡΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° ΠΈΠ· ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΡ, ΠΏΠΎΡΠ»Π΅ Π²ΡΡ ΠΎΠ΄Π° ΠΈΠ· Π½Π΅Ρ, ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΠΏΠ΅ΡΠ΅ΠΉΠ΄ΡΡ Π² ΠΌΠ΅Π½Ρ Π ΠΈΠ½Π΄ΠΈΠ²ΠΈΠ΄ΡΠ°Π»ΡΠ½ΠΎΠΌ Π·Π°Π΄Π°Π½ΠΈΠΈ ΠΏΠΎΡΡΠ΅Π±ΡΠ΅ΡΡΡ Π²Π²Π΅ΡΡΠΈ ΠΈΠΌΡ ΡΠ°ΠΉΠ»Π°, ΠΏΠΎΡΠ»Π΅ ΡΠ΅Π³ΠΎ Π½Π°ΠΆΠ°ΡΡ ENTER.
ΠΡΡΡΠΎΠ²Π°Ρ ΡΠ°Π±ΠΎΡΠ° ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π»Π°ΡΡ Π½Π° ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΎΠ½Π½ΡΡ ΡΠΈΡΡΠ΅ΠΌΠ°Ρ MS DOS ΠΈ Microsoft Windows 95/2000/XP, Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° Π½Π° ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΎΠ½Π½ΡΡ ΡΠΈΡΡΠ΅ΠΌΠ°Ρ Windows Π±ΠΎΠ»Π΅Π΅ Π²ΡΡΠΎΠΊΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ ΠΏΠΎΡΡΠ΅Π±ΡΠ΅ΡΡΡ ΡΠΏΠ΅ΡΠΈΠ°Π»ΡΠ½ΠΎΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΠΎΠ΅ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠ΅Π½ΠΈΠ΅.
1. ΠΠ°Π»Π°ΡΠ½ΠΈΠΊΠΎΠ² Π. «ΠΡΡΠ΅ΠΌΠ±Π»Π΅Ρ? ΠΡΠΎ ΠΏΡΠΎΡΡΠΎ!»
2. ΠΠΈΡΠ΅Ρ ΠΠ±Π΅Π»Ρ. ΠΡΡΠ΅ΠΌΠ±Π»Π΅Ρ ΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π΄Π»Ρ IBM PC
3. ΠΡΡΡ Π»Π΅ΠΊΡΠΈΠΉ ΠΏΠΎ ΠΏΡΠ΅Π΄ΠΌΠ΅ΡΡ «ΠΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΊΠ°»
4. ΠΠ΅ΡΠΎΠ΄ΠΈΡΠ΅ΡΠΊΠΈΠ΅ ΡΠΊΠ°Π·Π°Π½ΠΈΡ ΠΊ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ Π»Π°Π±ΠΎΡΠ°ΡΠΎΡΠ½ΡΡ ΡΠ°Π±ΠΎΡ ΠΏΠΎ ΠΏΡΠ΅Π΄ΠΌΠ΅ΡΡ «ΠΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΊΠ°»
5. ΠΡΡΠΏΠ½ΠΈΠΊ Π. — ΠΡΡΠ΅ΠΌΠ±Π»Π΅Ρ Π‘Π°ΠΌΠΎΡΡΠΈΡΠ΅Π»Ρ
6. ΠΡΡΠΏΠ½ΠΈΠΊ Π. — ΠΠ·ΡΡΠ°Π΅ΠΌ Π°ΡΡΠ΅ΠΌΠ±Π»Π΅Ρ
7. ΠΠΈΡΠ½ΠΈΡΠΊΠΈΠΉ Π. — ΠΡΡ ΠΈΡΠ΅ΠΊΡΡΡΠ° IBM PC ΠΈ ΡΠ·ΡΠΊ ΠΡΡΠ΅ΠΌΠ±Π»Π΅ΡΠ°
8. ΠΠΎΠ»ΡΠ±Ρ Π. — ΠΡΠΊΡΡΡΡΠ²ΠΎ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π½Π° ΠΡΡΠ΅ΠΌΠ±Π»Π΅ΡΠ΅