atm959

Wow

Dec 5th, 2018
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BITS 16
  2.  
  3. start:
  4.     mov ax, 07C0h       ; Set up 4K stack space after this bootloader
  5.     add ax, 288     ; (4096 + 512) / 16 bytes per paragraph
  6.     mov ss, ax
  7.     mov sp, 4096
  8.  
  9.     mov ax, 07C0h       ; Set data segment to where we're loaded
  10.     mov ds, ax
  11.  
  12.     mov ah, 00h
  13.     mov al, 01h
  14.     int 10h
  15.    
  16.     mov si, text_string ; Put string position into SI
  17.     call print_string   ; Call our string-printing routine
  18.  
  19. .mainLoop:
  20.     mov ah, 00h
  21.     int 16h
  22.     mov ah, 0Eh
  23.     int 10h
  24.     jmp .mainLoop
  25.  
  26. text_string:
  27.     db 020h, 0DBh, 0DBh, 0DBh, 020h, 020h, 020h, 0DBh, 0DBh, 0DBh, 020h, 00Ah, 00Dh
  28.     db 0DBh, 020h, 020h, 020h, 0DBh, 020h, 0DBh, 020h, 020h, 020h, 0DBh, 00Ah, 00Dh
  29.     db 0DBh, 020h, 020h, 020h, 0DBh, 020h, 0DBh, 020h, 020h, 020h, 020h, 00Ah, 00Dh
  30.     db 0DBh, 020h, 020h, 020h, 0DBh, 020h, 020h, 0DBh, 0DBh, 0DBh, 020h, 00Ah, 00Dh
  31.     db 0DBh, 020h, 020h, 020h, 0DBh, 020h, 020h, 020h, 020h, 020h, 0DBh, 00Ah, 00Dh
  32.     db 0DBh, 020h, 020h, 020h, 0DBh, 020h, 0DBh, 020h, 020h, 020h, 0DBh, 00Ah, 00Dh
  33.     db 020h, 0DBh, 0DBh, 0DBh, 020h, 020h, 020h, 0DBh, 0DBh, 0DBh, 020h, 00Ah, 00Dh
  34.     db "Press ENTER to start. (Well, not yet.)", 00Ah, 00Dh, 0
  35.  
  36.  
  37. print_string:           ; Routine: output string in SI to screen
  38.     mov ah, 0Eh     ; int 10h 'print char' function
  39.  
  40. .repeat:
  41.     lodsb           ; Get character from string
  42.     cmp al, 0
  43.     je .done        ; If char is zero, end of string       
  44.     int 10h         ; Otherwise, print it
  45.     jmp .repeat
  46.  
  47. .done:
  48.     ret
  49.  
  50.     times 510-($-$$) db 0   ; Pad remainder of boot sector with 0s
  51.     dw 0xAA55       ; The standard PC boot signature
Advertisement
Add Comment
Please, Sign In to add comment