?? rate8.asm
字號:
Bkcolor equ 102
Fcolor equ 1
code segment
org 100h
assume cs:code,ds:code
Start: push cs
pop ds
call initchar
mov ax,0a000h
mov es,ax
mov ax,0013h
int 10h
RateAgain:
mov StartPos,320*160+50
call RateBar
mov ah,01h
int 16h
jz RateAgain
mov ah,08h
int 21h
mov ax,0003h
int 10h
mov ah,4ch
int 21h
RateBar proc near
mov di,StartPos
mov cx,8
mov al,Bkcolor
BarBorder:
push cx
push di
mov cx,200
rep stosb
pop di
pop cx
add di,320
loop BarBorder
mov di,StartPos
add di,320*2
mov al,FColor
mov bx,0
BarLoop0:
mov cx,4
BarLoop1:
stosb
stosb
add di,320-2
loop BarLoop1
sub di,320*4-2
call Delay
call ShowBX
push ax
mov ah,01h
int 16h
pop ax
jnz ExitRate
inc bx
cmp bx,100
jnz BarLoop0
ExitRate:
ret
RateBar endp
Delay proc near
push ax
push cx
push dx
mov cx,030h
Delayloop:
push cx
mov cx,0ffffh
DelayLoop1:
loop DelayLoop1
pop cx
loop DelayLoop
pop dx
pop cx
pop ax
ret
Delay endp
initchar proc near
mov ax,1130h
mov bh,03h
int 10h
add bp,8*48
mov si,bp
lea di,NumBuff
mov ax,es
mov ds,ax
mov ax,cs
mov es,ax
mov cx,80
rep movsb
mov ax,cs
mov ds,ax
ret
initchar endp
ShowBX proc near
push ax
push bx
push di
mov ax,bx
aam
push ax
mov di,StartPos
sub di,20
mov al,ah
lea si,NumBuff
call ShowNum
pop ax
lea si,NumBuff
call ShowNum
pop di
pop bx
pop ax
ret
ShowBX endp
ShowNum proc near
mov bl,8
mul bl
add si,ax
mov bx,8
NumLoop0:
lodsb
mov ah,al
mov cx,8
NumLoop1:
rol ah,1
jc Dot
mov al,Bkcolor
jmp DotNext
Dot:
mov al,FColor
DotNext:
stosb
loop NumLoop1
add di,320-8
dec bx
jnz NumLoop0
sub di,320*8-8
ret
ShowNum endp
StartPos dw 320*160+75
NumBuff db 80 dup(0)
code ends
end Start
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -