home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,108 of 2,978   
   Klaus Jorgensen to Jim Leonard   
   Re: Multi-dimensional array access via i   
   04 Apr 06 19:30:38   
   
   From: kj@no.spam   
      
   Jim Leonard wrote :   
   > Klaus Jorgensen wrote:   
   >>> AL is destroyed in the retrace check, and AL is what is loaded by   
   >>> LODSB.  Hence the save/restore using XCHG.  And I used XCHG because   
   >>> XCHG AX,reg16 is a 1-byte opcode while the others are 2 bytes and on   
   >>> 8088, size = speed :-)   
   >>   
   >> But why put the LODSB before the retrace check where it is of no use?   
   >> It's not needed until just before the STOSB.   
   >   
   > Because LODSB takes 11 cycles but XCHG AX,BX only takes 3.  If I use   
   > LODSB right after the retrace check, it takes too long and I see CGA   
   > "snow" on the screen.  So I grab the source character before the   
   > retrace check and hold it in a register, since register operations are   
   > obviously faster than memory operations.   
   >   
      
   The code you linked to is no longer available, so I can't see if your   
   retrace check just waits for a (horizontal?) retrace to occur. Does it   
   exit the loop if a retrace is already in progress? In that case what if   
   the retrace ends just after that? In my own lib, I added code to wait   
   for the horizontal retrace to actually begin instead of just checking   
   if a retrace is in progress. Furthermore, if a vertical retrace is in   
   progress, one knows for sure that there would be at least a couple of   
   horizontal retraces ahead - thus no need to check for horizontal   
   retrace.   
      
   I also had a look in the IBM XT Technical Reference. In that listing,   
   code is added to switch off the video signal when writing to video   
   memory.   
      
      
   /klaus   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca