Codes SEGMENT para 'code'
org 100h
assume cs:Codes,ds:Codes,ss:Codes

movcur macro
mov ah,02h
mov bh,0
int 10h
endm


print macro x
mov ah,09h
mov dx,offset x
int 21h
endm

press macro
print pressanykey
xor ax,ax
int 16h
endm

clrscr macro
mov ax,0700h
mov bx,0700h
xor cx,cx
mov dx,184fh
int 10h
endm

Begin proc far
jmp StartMe

input label byte
maxln db 2
realln db ?
inparg db ?
pressanykey db 10,13,10,13,'H????? ???? ??????? ??? ?p?????????...$'
ann db 10,13,' ?HH??????',10,13,' ?????? ?p??p???? ???????? ????????? ???p?????? ??:',10,13,' - ???p ?????? - ??????? ?p???? ?? ??????????? ?? ?? ???p??????',10,13,'$'
ann1 db ' - ???? ????? - ???????? ?p???p?? ????? ?? p???????????',10,13,'$'
ann2 db ' ?????? "???p ??????" ??p??? ???p???? ? ?????? ???p?????:',10,13,' - ? COM-??p??,',10,13,'$'
ann3 db ' - ? ???. ?p????p?,',10,13,' - ? ????????,',10,13,' - ? LPT - ??p??,',10,13,' - ? CD-ROM ?p??????,',10,13,' - ? ????p????? ?p??????? ?????p???????,',10,13,' - ? ????????p? "????"$'
StartMe:
;*************** MAIN ROUTINE *************
clrscr
xor dx,dx
movcur
print ann
print ann1
print ann2
print ann3
press


Start:
call ShowQuestion

mov ah,0Ah
mov dx,offset input
int 21h

mov al,inparg

cmp al,31h
je Sved

cmp al,32h
je TestComp

cmp al,33h
je StopProgramm
jmp Start

StopProgramm:
mov ah,4ch
int 21h
Sved:
call SborSved
press
jmp Start
TestComp:
call TestMem
press
jmp start
Begin endp


;**************** SUBROUTINES *************



ShowQuestion proc near
jmp l1
system db '1 - ???????? ? ????',10,13,'$'
tst db '2 - ???? ?????',10,13,'$'
quit db '3 - ???$',10,13,'$'
Choice db '??? ??p ? : $'
l1:
clrscr
mov dx,0418h
movcur
print system
mov dx,0518h
movcur
print tst
mov dx,0618h
movcur
print quit
mov dx,0A18h
movcur
print Choice
ret
ShowQuestion endp




SborSved proc near
jmp @@MD
MathProc db '???????? ?p????p : $'
prisuts db '?p???????',10,13,'$'
otsuts db '????????',10,13,'$'
comports db '???????? ??????? ?????????? COM-??p? : $'
kolvocomports db '??????? ?????????? COM - ??p? : $'
kolvolptports db '??????? ?????????? LPT - ??p? : $'
drive1 db '??p?? ?????? : $'
drive2 db '??p?? ?????? : $'
k360 db '360Kb',10,13,'$'
k720 db '720Kb',10,13,'$'
m12 db '1.2Mb',10,13,'$'
m144 db '1.44Mb',10,13,'$'
CDROM db '??????? ??????????? CD-ROM ?p?????? : $'
APM db '????p????? ?p??????? ?????p??????? (ATX) : $'
APMON db ',??????' ,10,13,'$'
APMOFF db ',?????',10,13,'$'
est db '?p????????$'
net db '?????????$'
baks db ' ',10,13,'$'
mouse db '????????p ???? : $'
@@MD:

; ???p????p......
clrscr
xor dx,dx
movcur
print MathProc
int 11h
mov bx,ax
and al,02h
cmp al,02h
je have
print otsuts
jmp @next
have:
print Prisuts
@next:
and ah,0Eh
shr ah,1
add ah,30h
mov baks[0],ah
print comports
print baks

mov cx,4
xor bl,bl
xor si,si
xor dx,dx

mov ax,0040h ; ?????????
mov es,ax ; ??????? p?????p? ES ?? ??p?? ?????? BIOS

@@MF:
mov ax,[es]:[si]
cmp ax,0000h
je @@L
inc bl
@@L:
inc si
inc si
loop @@MF

add bl,30h
print kolvocomports
mov baks[0],bl
print baks


;LPT - ??p??.....

xor bl,bl
mov cx,3
@@@MF:
mov ax,[es]:[si]
cmp ax,0000h
je @@@L
inc bl
@@@L:
inc si
inc si
loop @@@MF

add bl,30h
print kolvolptports
mov baks[0],bl
print baks

; ??????? .....

print drive1
mov al,10h
out 70h,al
jmp $+2
in al,71h
and al,00F0h
shr al,4
cmp al,01h
je @k360
cmp al,02h
je @m12
cmp al,03h
je @k720
cmp al,04h
je @m144
print otsuts
jmp @@ST
@k360:
print k360
jmp @@ST
@m12:
print m12
jmp @@ST
@m144:
print m144
jmp @@ST
@k720:
print k720
jmp @@ST
@@ST:


print drive2
mov al,10h
out 70h,al
jmp $+2
in al,71h
and al,000Fh


cmp al,01h
je @@k360
cmp al,02h
je @@m12
cmp al,03h
je @@k720
cmp al,04h
je @@m144
print otsuts
jmp @@@ST
@@k360:
print k360
jmp @@@ST
@@m12:
print m12
jmp @@@ST
@@m144:
print m144
jmp @@@ST
@@k720:
print k720
jmp @@@ST
@@@ST:

; CD-ROM........
xor bx,bx
mov ax,1500h
int 2fh
print CDROM
cmp bx,0
je @NOCD
add bx,30h
mov baks[0],bl
print baks
jmp @@JKH
@NOCD:
print otsuts
@@JKH:

; APM.... (Advanced Power Manager)
print APM
mov ax,5300h
xor bx,bx
int 15h
cmp ah,86h
je @@@NONE
print est
jmp @@@COOLS
@@@NONE:
print net
jmp @@@PLLL
@@@COOLS:
and cl,08h
cmp cl,08h
je @@@ASD
print APMON
jmp @@@PLLL
@@@ASD:
print APMOFF
@@@PLLL:


; Mouse....


print Mouse
xor ax,ax
int 33h
cmp ax,0FFFFh
je @QWE
print otsuts
jmp @@@Z
@QWE:
print prisuts
@@@Z:
ret
SborSved endp




TestMem proc near
jmp CHG
Testing db '???? ????? : $'
proid db '?p?????',10,13,'$'
no db '?? $'
CHG:
clrscr
xor dx,dx
movcur
print Testing

mov bp,cs
add bp,128

P:
xor si,si
PP:
mov byte ptr [bp][si],00h
cmp byte ptr [bp][si],00
jne bad
mov byte ptr [bp][si],0ffh
cmp byte ptr [bp][si],0ffh
jne bad

inc si
cmp si,0fh
jne PP

inc bp
cmp bp,0A000h
jne P
jmp good

bad:
print no
print proid
jmp JK
good:
print proid
JK:
ret
TestMem endp


Codes Ends
end Begin





Чтобы не видеть здесь видео-рекламу достаточно стать зарегистрированным пользователем.
Чтобы не видеть никакую рекламу на сайте, нужно стать VIP-пользователем.
Это можно сделать совершенно бесплатно. Читайте подробности тут.