summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/rouge-4.7.0/lib/rouge/demos/nasm
blob: ed0e8b88e5659cb2914b82f6ad0f2d56a08156b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
%macro IRQ 2
    global irq%1
    irq%1:
        cli
        push byte 0     ; push a dummy error code
        push byte %2    ; push the IRQ number
        jmp  irq_common_stub
%endmacro

extern irq_handler

irq_common_stub:
    pusha             ; push all general-purpose registers
    mov   ax, ds      ; lower 16-bits of eax = ds
    push  eax         ; save the data segment descriptor
    mov   ax, 0x10    ; load the kernel data segment descriptor
    mov   edx, eax
    call  irq_handler

%assign i 0
%rep 8
ISR_NOERRCODE i
%assign i i+1
%endrep

ISR_NOERRCODE 9