Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include "macros.inc"
- section .data
- pit_count dq 0
- format_str db "Current timer count: %ld\n", 0
- section .text
- extern printf, pic_master_eoi
- global pit_interrupt
- pit_interrupt:
- pushaq
- mov rax, [pit_count]
- inc rax
- mov [pit_count], rax
- and rax, 256 ; display message every ~2.5s (assuming PIT has a period of 10ms)
- jnz .done
- mov rcx, format_str
- mov rdx, pit_count
- call printf
- .done:
- call pic_master_eoi
- popaq
- iretq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement