Advertisement
Guest User

Untitled

a guest
May 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [BITS 16] ;viktigt
  2. [ORG 0x7C00] ;BIOS jmps here
  3.  
  4. mov si, string ;Move string pointer into Source Index
  5. call print_string
  6. mov ax, 0x2401
  7. int 0x15
  8.  
  9. print_character:
  10.     mov ah, 0x0E
  11.     mov bh, 0x00
  12.     mov bl, 0x07
  13.     int 0x10
  14. ret
  15.  
  16. print_string:
  17.     next_character:
  18.         mov al, [si] ;get one byte from the value pointed by si
  19.         inc si ;Move si pointer to next character
  20.         or al, al ;If al = zero, end of string
  21.  
  22.         jz exit_function
  23.         call print_character
  24.         jmp next_character
  25.  
  26.     exit_function:
  27.         ret
  28.  
  29.  
  30. string db 'Hello World', 0 ;Just a null terminated string
  31. TIMES 510 - ($ - $$) db 0
  32. DW 0XAA55 ; we need a boot signature of course.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement