- 8, 16 32 . -, , . -. - , 216, 65 536, -.
, - 8-, 16- 32- , -. -. . 1 .
BIOS *
- | ||||
. 1.
, BIOS, . . BIOS, .
.
, , . , , , . , , , ( ) ( ) . , :
in <>,<_> <_>;
out <_>,<> <_>.
. , , MS-DOS. Windows . Windows. , Windows , 86.
, . . , , , .
|
|
, . . , , . , BIOS .
- MS-DOS, Windows. Windows 95/98 , Windows NT/2000/XP . , , Windows NT/2000/XP - . Windows NT/2000/XP API , IN OUT. Windows NT/2000/XP . , , MS-DOS, , . ( ), IN OUT , MS-DOS. , / , .
, . :
SS () 8255;
, : - 8 ,- (latch register) ^- (counter register), 16 . - . - . , . - - ( -). - 2 - 42h. -, , - . :
0 : 0 , 1 - (BCD) . , -; , 0.
1-3 . , 011.
|
|
4-5 : 00 - ( , - ), 10 - , 01 - - , 11 - - , . 11. 16- - 8- - : , - -, . , - IN OUT.
6-7 . 10.
. - -, -. - . . . - . ( 61h). - , . , 61h, 1, 2. 2 - ( , ) -. - . -, - 2. . , 1 1,19 . , 2 , , . 1 61h.
, , ( ).
1. 43h , .
2. , 1 61h.
3. , 42h, .
, . delay, , . , , - . , , DS . 37-38 2, ( 43h) OB6h. 0 1 61h. . , 0 1, 61h. , - , . , . cnt, 1 5. cnt = 5, . , , JNE . for, . for. , for
|
|
/, , , . / , . / ..
model small
stack 100h
delay macro time
Local ext, ter
Push cx
Mov ex.time
ext:
push cx
mov cx,5O00
iter:
loop ter
pop cx
loop ex
Pop cx
Endm
.data;
tonelow dw 2651; 450
cnt db 0;
temp dw 7;
. code;
man:;
mov ax, @data; ds
mov ds, ax;
mov ax,0;
- 10110110b(0B6h) ( 43h),
raovaL0B6h
out 43h,al
in al,61h
or al,3
out 61h,al
mov cx,2083
musicup:
addtonelow.l delay 1
mov dx,tonelow
bop music
mOV CX.2083
rausicdown:
mov ax,temp
out 42h,al
mov al,ah
out 42h,al
sub temp.l
delay 1
loop
musicdown
nosound:
in al,61h
and al,0FCh
out 61h,al
mov dx,2651
mov inc
cmp
jne
exit: mov int
end main
tonelow.dx
cnt
cnt,5
go