Advertisement
Guest User

Untitled

a guest
May 26th, 2021
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; -----------------------------------------------------------------------------------
  2. ;;
  3. ;;      Copyright 2008, 2009, 2012, 2013, 2021 Shane Tyler Yorks, Jure Sah
  4. ;;
  5. ;;      This stub is a part of LearnerKernel
  6. ;;
  7. ;;      LearnerKernel is free software: you can redistribute it and/or modify
  8. ;;      it under the terms of the GNU General Public License as published by
  9. ;;      the Free Software Foundation, either version 3 of the License, or
  10. ;;      (at your option) any later version.
  11. ;;
  12. ;;      Please refer to the README file for additional information.
  13. ;;
  14. ; -----------------------------------------------------------------------------------
  15. flipISR:
  16.         pushf   ;Preserve flags register
  17.         cli ;Disable interrupts incase they were enabled
  18. @@:     mov dx, 0x3DA   ;Move the hardware address of VGA Input Status Register #1 to dx register
  19.         in al, dx   ;Read the value of the VGA Input Status Register #1 into the al register.
  20.         and al, 1000b   ;Check if bit 3 (VRetrace/Vertical Retrace in progress)
  21.         je @b       ;If happening, retry until it is not happening
  22. @@:     in al, dx   ;Read again
  23.         and al, 1000b   ;Check if is or isn't happening
  24.         jne @b      ;If it's not happening, go back until it it is happening
  25.         mov esi, dblBufLoc  ;Load the string source register with the back buffer
  26.         mov edi, dword [VESAInfo+0x28]  ;Move the string destination register with the location of the front buffer the video card is sending to the screen
  27.         mov ecx, scrsz/4    ;Load the size of the buffers (divided by 4, since we'll send 4 bytes at a time) into ECX
  28.         rep movsd   ;Move 4 bytes from source to the data of destination until ECX is empty
  29.         popf    ;restore the flags register (including interrupts if they were enabled)
  30.         iret    ;Return to our regularly scheduled program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement