Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cpu 8086
- [BITS 16] ;In 16 Bit mode
- [org 0x7C00] ;Originating at 0x7C00 (where bios loads it to)
- CALL GetKey ;Call BIOS procedure to obtain character from keyboard
- CALL PrintCharacter ;Call bios procedure to write the obtained key
- JMP $ ;Infinite loop as end of program
- PrintCharacter:
- MOV AH,0x0E ;AH = 0x0E means teletype output for interrupt 0x10 (display output)
- MOV BH,0x00 ;Page number 0 for the cursor position for interrupt 0x10
- MOV BL,0x07 ;Light grey font on black background
- INT 0x10 ;Call video interrupt
- RET ;Return from PrintCharacter
- GetKey:
- MOV AH,0x00 ;Bios scan code
- INT 0x16 ;Call keyboard interrupt
- RET ;Return from getkey
- TIMES 510 - ($ - $$) db 0 ;Fill the rest of the sector with 0
- DW 0xAA55 ;boot signiature at end of bootloader
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement