Advertisement
Ham62

DrawBuff.asm

Jan 26th, 2017
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ORG 0h
  2.  
  3. %define _ScreenSize (80*25)
  4. %define _ScreenSeg 0B800h
  5.  
  6. %define _BuffSeg  BP+(6+18+2)
  7. %define _BuffAddr BP+(6+18+0)
  8.  
  9. Start:
  10.     PUSHA
  11.     PUSH ES
  12.     PUSH DS
  13.     MOV BP, SP
  14.  
  15.     MOV DS, WORD [_BuffSeg]  ;Buffer segment
  16.     MOV SI, WORD [_BuffAddr] ;Buffer Address
  17.                              ;Buffer is DS:SI
  18.  
  19.     MOV DI, 00h              ;Start drawing at 0
  20.     MOV AX, _ScreenSeg       ;Set screen segment
  21.     MOV ES, AX               ;Screen is ES:DI
  22.  
  23.     MOV CX, _ScreenSize
  24.  
  25.     REP MOVSW                ;Write buffer to screen
  26.  
  27. End:
  28.     POP DS
  29.     POP ES
  30.     POPA
  31.     RETF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement