📄 temp9.asm
字号:
mov area+2,100
mov ah,40h
mov bx,01
mov cx,7
lea dx,time2
int 21h
call scroll
call inoutr
mov ah,40h
mov bx,01
mov cx,24
lea dx,outputr
int 21h
call scroll
call showtimef
call cal
finalr: ret
tempr endp
;------------------------------------------------------
tempw proc near
mov ah,3ch
mov cx,0
lea dx,pathnamew
int 21h
jc ew
mov handlew,ax
jmp nw
ew: ;inc row
;call cursor
mov ah,40h
mov bx,01
mov cx,22
lea dx,err2
int 21h
call scroll
jmp finalw
nw: ;inc row
;call cursor
mov ah,40h
mov bx,01
mov cx,14
lea dx,succ2
int 21h
call scroll
call showtimes
tranw: call inoutw
cmp word ptr areat,100
jne returnw
mov ah,areat+2
mov count,ah
call sysr
mov ah,40h
mov bx,handlew
mov cx,100
lea dx,areat+3
int 21h
jmp tranw
returnw: mov ah,40h
mov bx,01
mov cx,7
lea dx,time2
int 21h
call scroll
mov ah,40h
mov bx,handlew
mov cx,word ptr areat
lea dx,areat+3
int 21h
mov ah,3eh
mov bx,handlew
int 21h
;inc row
;call cursor
mov ah,40h
mov bx,01
mov cx,26
lea dx,outputw
int 21h
call scroll
call showtimef
call cal
finalw: ret
tempw endp
;------------------------------------------------------
inoutr proc near
mov di,0
repeatr: mov dx,3fdh
in al,dx
test al,00011110b
jnz errorr
test al,00100000b
jz repeatr
cmp di,103
jz lastr
mov al,area[di]
mov dx,3f8h
out dx,al
inc di
jmp repeatr
errorr: ;inc row
;call cursor
mov ah,40h
mov bx,01
mov cx,4
lea dx,err
int 21h
call scroll
ret
lastr: ret
inoutr endp
;------------------------------------------------------
inoutw proc near
mov di,0
repeatw: mov dx,3fdh
in al,dx
test al,00011110b
jnz errorw
test al,00000001b
jz repeatw
cmp di,103
jz lastw
mov dx,3f8h
in al,dx
mov areat[di],al
inc di
jmp repeatw
errorw: ;inc row
;call cursor
mov ah,40h
mov bx,01
mov cx,4
lea dx,err
int 21h
call scroll
ret
lastw: ret
inoutw endp
;------------------------------------------------------
showtimes proc near
mov ah,40h
mov bx,01
mov cx,11
lea dx,ts
int 21h
call scroll
mov ah,2ch
int 21h
mov h1,ch
mov m1,cl
mov s1,dh
mov bl,10
mov ah,0
mov al,ch ;hour
div bl
add al,30h ;remaind
add ah,30h
mov times,al
mov times+1,ah
mov ah,0
mov al,cl ;min
div bl
add al,30h
add ah,30h
mov times+3,al
mov times+4,ah
mov ah,0
mov al,dh
div bl
add al,30h
add ah,30h
mov times+6,al
mov times+7,ah
mov ah,40h
mov bx,01
mov cx,8
lea dx,times
int 21h
call scroll
ret
showtimes endp
;------------------------------------------------------
showtimef proc near
mov ah,40h
mov bx,01
mov cx,12
lea dx,tf
int 21h
call scroll
mov ah,2ch
int 21h
mov h2,ch
mov m2,cl
mov s2,dh
mov bl,10
mov ah,0
mov al,ch ;hour
div bl
add al,30h ;remaind
add ah,30h
mov timef,al
mov timef+1,ah
mov ah,0
mov al,cl ;min
div bl
add al,30h
add ah,30h
mov timef+3,al
mov timef+4,ah
mov ah,0
mov al,dh
div bl
add al,30h
add ah,30h
mov timef+6,al
mov timef+7,ah
mov ah,40h
mov bx,01
mov cx,8
lea dx,timef
int 21h
call scroll
ret
showtimef endp
;------------------------------------------------------
cal proc near
mov ah,s1
cmp s2,ah
jb next1
sub s2,ah
jmp next2
next1: sub s2,ah
add s2,60
mov carry1,1
next2: mov ah,carry1
add m1,ah
mov ah,m1
cmp m2,ah
jb next3
sub m2,ah
jmp next4
next3: sub m2,ah
add m2,60
mov carry2,1
next4: mov ah,carry2
add h1,ah
mov ah,h1
cmp h2,ah
jb next5
sub h2,ah
jmp next6
next5: sub h2,ah
add h2,24
next6: mov bl,10
mov ah,0
mov al,h2 ;hour
div bl
add al,30h ;remaind
add ah,30h
mov inter,al
mov inter+1,ah
mov ah,0
mov al,m2 ;min
div bl
add al,30h
add ah,30h
mov inter+3,al
mov inter+4,ah
mov ah,0
mov al,s2
div bl
add al,30h
add ah,30h
mov inter+6,al
mov inter+7,ah
mov ah,40h
mov bx,01
mov cx,19
lea dx,ti
int 21h
call scroll
mov ah,40h
mov bx,01
mov cx,8
lea dx,inter
int 21h
call scroll
ret
cal endp
;------------------------------------------------------
tolen proc near
mov ah,42h
mov al,2
mov bx,handler
mov cx,0
mov dx,0
int 21h
mov filelen,ax
mov ah,42h
mov al,0
mov bx,handler
mov cx,0
mov dx,0
int 21h
ret
tolen endp
;------------------------------------------------------
sysr proc near
mov bl,10
mov ah,0
mov al,count
div bl
add al,30h
add ah,30h
mov time1,al
mov time1+1,ah
mov ah,40h
mov bx,01
mov cx,6
lea dx,time1
int 21h
call cursor
ret
sysr endp
;------------------------------------------------------
end main
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -