[comp.sys.ibm.pc] Microsoft QuickBASIC incompatibility

ghull@raider (Gordon Hull) (07/05/88)

It looks like Microsoft has introduced a potentially dangerous, and certainly 
exasperating, undocumented incompatibility between QuickBASIC 2.x - 3.0 and 
4.0 regarding external assembly language routines.  Here's a quick rundown of 
the situation and my analysis of same: 
  
One of the modules of a program I'm working on uses an assembly language 
routine (that I wrote) to quickly side-scroll characters on the CGA medium 
res. screen (320x200, 4 color).  The routine is no big deal; it just computes 
some addresses and does a REPNZ MOVSW instruction for each scan line 
involved, with the direction flag cleared (forward move, for a left scroll), 
or set (backwards move, for a right scroll).  The routine appeared to be 
working fine under 3.0.  Then, several months later, as I was porting the 
module to 4.0, the right scroll suddenly and inexplicably caused the machine 
to crash.  Cold.  The left scroll still worked fine. 
  
I tried everything I could think of - recompiling the routine, re-linking it, 
and going over the code by hand several times.  I could not find a bug. 
Frustrated and confused, I tried the BLOCKMOVE routine in ADVBAS 3.4 and a 
QuickBASIC routine to accomplish the scrolling; again, the right scroll 
hung the machine and the left scroll worked (albeit slowly). 
  
Then, a flash of inspiration hit me.  I added a PUSHF instruction to the 
right scroll, and everything worked fine. 
  
The only conclusion that I can come to is that QB4 must have not have the 
direction flag set at the end of a machine language routine; it keeps it 
cleared and then doesn't bother to execute a CLD before its string moves. 
The manual, of course, says nothing about this. 
  
Has anybody else experienced the same problem? 
  
________________________ 
Gordon Hull 
  
   USENET: ghull@raider.UUCP 
   FIDO:   Gordon Hull at 1:116/12 
   USMAIL: Gordon Hull, 907 Kay St. Murfreesboro, TN 37130 
  
   FROM CommStuff IMPORT StdDisclaimer; 
________________________ 

---
 * Origin: Raiders Roost: Mid TN's FIRST FIDO<->UUCP GATEWAY ! (Opus 1:116/12)
SEEN-BY: 116/12

--  
     ______
    /     / * Middle Tennessee's FIDO<->UUCP Gateway *      (615) 896-7964
   /_____/   ___   o  ___   ___   ___          * Murfreesboro, Tennessee *
  /   \     /__/  /  /  /  /__   /__/        Bob Reineri - System   Operator
_/     \___/  /__/__/__/__/__ __/  \_        Mark Bailey - UUCP Project Mgr.
UUCP: !{ames,osu-cis,rutgers,decwrl,mit-eddie}!killer!raider  FIDO: 1:116/12