home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazin 1997 January
/
CD_01_97.ISO
/
game
/
settimer.asm
< prev
next >
Wrap
Assembly Source File
|
1993-11-20
|
1KB
|
78 lines
data segment word public
assume ds:data
;extrn frametime:dword
;extrn frametimeb:dword
data ends
code segment byte public
assume cs:code
.386
frametime DW ?
frametimeb DW ?
waitborder PROC NEAR
push ax
push dx
mov dx,3dah
wbr1: in al,dx
test al,8
jnz wbr1
wbr2: in al,dx
test al,8
jz wbr2
pop dx
pop ax
ret
waitborder ENDP
settimer PROC near
public settimer
; cli
; xor ax,ax
; mov es,ax
; mov ax,es:[INTER*4]
; mov WORD PTR cs:oldint8,ax
; mov ax,es:[INTER*4+2]
; mov WORD PTR cs:oldint8[2],ax
; mov ax,OFFSET intti8
; mov es:[INTER*4],ax
; mov es:[INTER*4+2],cs
; sti
call waitborder
;reset ints now!
mov al,36h
out 43h,al
mov al,0
out 40h,al
mov al,0
out 40h,al
call waitborder
xor al,al
out 43h,al
in al,40h
mov ah,al
in al,40h
xchg al,ah
neg ax
shr ax,1
mov cs:frametime,ax
mov dx,ax
mov al,ah
xor ah,ah
sub dx,ax
; shl dx,1 ;kaksin kertaistetaan eli menee 2:n frameen
mov cs:frametimeb,dx
mov al,36h
out 43h,al
mov al,dl
out 40h,al
mov al,dh
out 40h,al
ret
settimer ENDP
code ENDS
END