Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions iss_tim.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@

Implementation

Var IntStack : array[0..4095] of byte;

Var TimerSpeed : DWord;
OldTimer : TSegInfo;
OldTimerCnt : DWord;
Expand Down Expand Up @@ -96,7 +98,16 @@
PUSH FS
PUSH GS
PUSHAD

{ with DPMI, the stack is not DS/ES, but a minimal 4K locked pm stack dedicated for interrupts, switch to DS }
MOV CX, SS
MOV EDX, ESP
MOV AX,CS:[BackupDS]
MOV SS, AX
LEA ESP, IntStack+4096
PUSH CX
PUSH EDX

MOV DS,AX
MOV ES,AX
MOV AX,DosMemSelector
Expand Down Expand Up @@ -129,6 +140,13 @@
MOV DX,$20 { � Interrupt request acknowledge � }
MOV AL,$20
OUT DX,AL

{restore old stack}
POP EDX
POP CX
MOV SS, CX
MOV ESP, EDX

POPAD
POP GS
POP FS
Expand Down