www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/07/20:10:24

Comments: Authenticated sender is <kbaca AT bluesky DOT skygames DOT com>
From: Kevin Baca <kbaca AT skygames DOT com>
Organization: BlueSky Software
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Mon, 7 Aug 1995 16:22:50 +0000
Subject: CLI asm instruction

Here's another assembly question.  I have an inner loop portion of my 
code in assembly (inline).  For lack of registers I use the stack 
pointer (SS:ESP) to point to one of the buffers I need to update.  

This works fine until an interrupt hits and saves the register state 
on the "stack" which now points to my buffer.  Then a portion of my 
buffer gets trashed.  So, I execute a PUSHF; CLI at the beginning of 
the loop to turn off interrupts and a POPF at the end of the loop to 
restore the previous interrupt mask state.

This works great under plain DOS, but under Windows it's about 20%
slower.  If I remove the CLI, the performance goes back up, but then 
my buffer gets trashed.  Anyone have any idea why the CLI slows 
performance under Windows?

Here's my config:  DJGPP 1.12 m4, Pentium 90, Windows 3.11

-Kevin
kbaca AT skygames DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019