Advertisement
Ham62

UpdateScreen.C

Aug 21st, 2017
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.93 KB | None | 0 0
  1. // Old UpdateScreen with bad CGA snow
  2. /* extern void UpdateScreen(void);
  3. #pragma aux UpdateScreen =  \
  4.     "mov si, ScreenBuff"    \
  5.     "mov di, 00h"           \
  6.     "mov ax, [ScreenSeg]"   \
  7.     "mov es, ax"            \
  8.     "mov cx, SCREEN_SIZE"   \
  9.     "rep movsw"             \
  10.     modify [ax cx si di es]; */
  11.  
  12. // This one should reduce CGA snow
  13. extern void UpdateScreen(void);
  14. #pragma aux UpdateScreen =  \
  15.     "mov si, ScreenBuff"    \
  16.     "mov di, 00h"           \
  17.     "mov ax, [ScreenSeg]"   \
  18.     "mov es, ax"            \
  19.     "mov cx, SCREEN_SIZE"   \
  20.     "mov dx, 03DAh"         \
  21.     "_blk:"                 \
  22.     "in al, dx"             \
  23.     "test al, 9"            \
  24.     "jz _blk"               \
  25.     "movsw"                 \
  26.     "movsw"                 \
  27.     "movsw"                 \
  28.     "movsw"                 \
  29.     "sub cx, 4"             \
  30.     "jnz _blk"              \
  31.     modify [ax cx dx si di es];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement