Advertisement
Guest User

bryoboot2.asm

a guest
Jan 22nd, 2025
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------------------------[bryoboot2.asm]--------------------
  2. ; 1. constants
  3. ; 2. directives
  4. ; 3. main
  5. ; 4. functions
  6. ; 5. messages
  7. ; 6. footer
  8.  
  9.  
  10. ; ---------------------------[CONSTANTS]------------------------
  11. BL2_ADDR equ 0x7fee         ; origin address of loader2
  12.  
  13.  
  14. CR equ 0x0d                 ; Carriage Return
  15. LF equ 0x0a                 ; Line feed/ Newline
  16.  
  17. ;----------------------------[DIRECTIVES]------------------------
  18. org BL2_ADDR                ; origin
  19. bits 16                     ; real mode 16 bit
  20.  
  21.  
  22. ;----------------------------[MAIN]------------------------------
  23. main:
  24.     ; Segmentation registers setup
  25.     xor ax,ax
  26.     mov ds,ax
  27.     mov es,ax
  28.     mov ss,ax
  29.  
  30.     ; Printing Initial Boot message
  31.     mov si,initial_boot_msg
  32.     call print
  33.  
  34.     jmp $
  35.  
  36.  
  37. ;----------------------------[FUNCTIONS]--------------------------
  38.  
  39. print:
  40.     .loop:
  41.         lodsb
  42.         or al,al
  43.         jz .break
  44.         mov ah,0x0e
  45.         int 0x10
  46.         jmp .loop
  47.  
  48.     .break:
  49.         ret
  50.  
  51.  
  52.  
  53. ;-----------------------------[MESSAGES]--------------------------
  54. initial_boot_msg:
  55.      db '[BL2] BRYOBOOT2 loaded sucessfully',CR,LF,0
  56.  
  57.  
  58. ;-----------------------------[FOOTER]----------------------------
  59. times 512-($-$$) db 0        ; Padding to 512 bytes
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement