pedraom2007

monitor.inc

Oct 5th, 2021 (edited)
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %ifndef __MONITOR_LIB__
  2. %define __MONITOR_LIB__
  3.  
  4. SystemName db "SimpleOS", 0
  5.  
  6. BackWidth dw 0000h
  7. BackHeight dw 0000h
  8. BackColor db 52
  9. Pagination db 0
  10. CursorX db 15
  11. CursorY db 12
  12.  
  13.  
  14. VGA.SetVideoMode:
  15.     mov ah, 00h
  16.     mov al, 13h
  17.     int 10h
  18.  
  19.     mov ax, 320
  20.     mov word[BackWidth], ax
  21.  
  22.     mov ax, 200
  23.     mov word[BackHeight], ax
  24.  
  25.     call DrawPixelConfig
  26. ret
  27.  
  28.  
  29. DrawPixelConfig:
  30.     mov ah, 0Ch
  31.     mov al, [BackColor]
  32.     mov cx, 0 ; Coluna (X)
  33.     mov dx, 0 ; Linha (Y)
  34. ret
  35.  
  36. ; Pinta fundo da tela
  37. DrawBackground:
  38.     int 10h
  39.     inc cx
  40.     cmp cx, word[BackWidth]
  41.     jne DrawBackground
  42.     mov cx, 0
  43.     inc dx
  44.     cmp dx, word[BackHeight]
  45.     jne DrawBackground
  46.     mov dx, 0
  47. ret
  48.  
  49. PrintMainString:
  50.     mov ah, 09h
  51.     mov bh, [Pagination]
  52.     mov bl, 44
  53.     mov cx, 1
  54.     mov al, [si]
  55.     print:
  56.         int 10h
  57.         inc si
  58.        
  59.         call MoveCursor
  60.         mov ah, 09h
  61.         mov al, [si]
  62.         cmp al, 0
  63.         jne print
  64. ret
  65.  
  66. MoveCursor:
  67.     mov ah, 02h
  68.     mov bh, [Pagination]
  69.     inc dl
  70.     int 10h
  71. ret
  72.  
  73. EffectInit:
  74.     start:
  75.         mov dh, [CursorY]
  76.         mov dl, [CursorX]
  77.         call MoveCursor
  78.         mov si, SystemName
  79.         call PrintMainString
  80. ret
  81.  
  82.  
  83. %endif
Add Comment
Please, Sign In to add comment