Guest User

Untitled

a guest
Feb 12th, 2017
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. FASM.
  2. boot.ASM:
  3.  
  4. org 0x7C00
  5.  
  6. start:
  7. cli
  8. xor ax,ax
  9. mov ds,ax
  10. mov es,ax
  11. mov ss,ax
  12. mov sp,0x7C00
  13. sti
  14. mov ax,2
  15. int 0x10
  16. mov dx,0
  17. call set_cursor_pos
  18. mov bp,msg
  19. mov cx,10
  20. call print_mes
  21. add dh,1
  22. call set_cursor_pos
  23. mov bp,con
  24. mov cx,14
  25. call print_mes
  26. cont:
  27. mov ah,0x10
  28. int 0x16
  29. cmp al,0xD
  30. jz kernel
  31. jmp cont
  32. kernel:
  33.  
  34. mov ax,0
  35. mov es,ax
  36. mov bx,0x7E00 ;dl'a chego????????!!?! mozhno zhe shto ugodno postavit'
  37. mov ch,0
  38. mov cl,2
  39. mov dh,0
  40. mov dl,0x80
  41. mov al,2
  42. mov ah,2
  43. int 0x13
  44. jmp 0x7E00
  45. print_mes:
  46. mov bl,3
  47. mov ax,0x1301
  48. int 0x10
  49. ret
  50. set_cursor_pos:
  51. mov ah,2
  52. xor bh,bh
  53. int 0x10
  54. ret
  55.  
  56. ;-------------------------------------------------
  57.  
  58. msg db 'loading...',0
  59. con db 'press Enter...',0
  60. finish: times 0x1FE-finish+start db 0
  61. db 0x55,0xAA
  62.  
  63. grf.ASM:
  64.  
  65. org 0x7E00
  66.  
  67. start:
  68. mov ax,0x13
  69. int 0x10
  70. mov ax,0xA000
  71. mov es,ax
  72.  
  73. mov di,9649
  74. mov ax,18150
  75. push di
  76. push ax
  77. dec di
  78. mov byte[es:di],47
  79. sub di,320
  80. mov byte[es:di],47
  81. inc di
  82. mov byte[es:di],47
  83. mov di,ax
  84. inc di
  85. mov byte[es:di],40
  86. add di,320
  87. mov byte[es:di],40
  88. dec di
  89. mov byte[es:di],40
  90. pop ax
  91. pop di
  92. call ris_lin
  93. vs:
  94. jmp vs
  95.  
  96. ;-------------------------------------------------
  97.  
  98. ris_lin:
  99. mov si,320
  100. push ax
  101. div si
  102. mov bx,ax
  103. push bx
  104. mov bx,dx
  105. push dx
  106. pop ax
  107. xchg ax,di
  108. push ax
  109. div si
  110. mov cx,ax
  111. pop ax
  112. xchg ax,di
  113.  
  114. mov bx,dx
  115. pop dx
  116. sub dx,bx
  117. mov [shirina],dx
  118. pop bx
  119. sub bx,cx
  120. mov [visota],bx
  121.  
  122. xor dx,dx
  123. push ax
  124. mov ax,[shirina]
  125. mov bx,[visota]
  126. div bx
  127. mov cx,ax
  128. pop ax
  129. xor bx,bx
  130. rl_loop1:
  131. push cx
  132. rl_loop2:
  133. mov byte[es:di],15
  134. inc di
  135. loop rl_loop2
  136. add di,320
  137. inc bx
  138. pop cx
  139. cmp di,ax
  140. jg rl_end
  141. cmp bx,dx
  142. jz rl_dob
  143. rl_con:
  144. jmp rl_loop1
  145. rl_dob:
  146. xor bx,bx
  147. inc di
  148. mov byte[es:di],15
  149. jmp rl_con
  150. rl_end:
  151. ret
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160. ;-------------------------------------------------
  161.  
  162. visota rw 1
  163. shirina rw 1
  164.  
  165. sbor.ASM:
  166.  
  167. macro align value { db value-1 - ($ + value-1) mod (value) dup 0 }
  168. HEADS = 1
  169. SPT = 2
  170. Begin:
  171. file "boot.bin",512
  172. file "grf.bin"
  173. align 512
Advertisement
Add Comment
Please, Sign In to add comment