Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. cpu 8086
  2. [BITS 16] ;In 16 Bit mode
  3. [org 0x7C00] ;Originating at 0x7C00 (where bios loads it to)
  4. CALL GetKey ;Call BIOS procedure to obtain character from keyboard
  5. CALL PrintCharacter ;Call bios procedure to write the obtained key
  6. JMP $ ;Infinite loop as end of program
  7.  
  8. PrintCharacter:
  9. MOV AH,0x0E ;AH = 0x0E means teletype output for interrupt 0x10 (display output)
  10. MOV BH,0x00 ;Page number 0 for the cursor position for interrupt 0x10
  11. MOV BL,0x07 ;Light grey font on black background
  12. INT 0x10 ;Call video interrupt
  13. RET ;Return from PrintCharacter
  14.  
  15. GetKey:
  16. MOV AH,0x00 ;Bios scan code
  17. INT 0x16 ;Call keyboard interrupt
  18. RET ;Return from getkey
  19.  
  20. TIMES 510 - ($ - $$) db 0 ;Fill the rest of the sector with 0
  21. DW 0xAA55 ;boot signiature at end of bootloader
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement