Interrupts.s gives various errors

Programming, for all ages and all languages.
Post Reply
Mehmetdev1
Posts: 23
Joined: Fri Apr 01, 2022 10:06 am
Location: Türkiye, Uşak/Merkez

Interrupts.s gives various errors

Post by Mehmetdev1 »

Hello. The interrupt.S file gives various errors, what is the solution, I am posting the code and screenshot:

Interrupt.s Code:

Code: Select all

.set IRQ_BASE, 0x20
 
.section .text

.extern _ZN16InterruptManager15handleInterruptEhj

.global _ZN16InterruptManager22IgnoreInterruptRequestEv






.macro HandleException num
.global _ZN16InterruptManager16HandleException\num\()Ev
_ZN16InterruptManager16HandleException\num\()Ev:
    movb $\num, (interruptNumber)
    jmp int_bottom
.endm

.macro HandleInterruptRequest num
.global _ZN16InterruptManager26HandleInterruptRequest\num\()Ev
_ZN16InterruptManager26HandleInterruptRequest\num\()Ev:
             movb $\num + IRQ_BASE, (interruptNumber)
             jmp int_bottom
        .endm     



HandleInterruptRequest 0x00
HandleInterruptRequest 0x01




int_bottom:

   pusha
   pushl %ds
   pushl %es
   pushl %fs
   pushl %gs
   
   pushl %esp
   push (interruptNumber)
   call _ZN16InterruptManager15handleInterruptEhj
   # addl $5, %esp
   movl %eax, %esp
   
   popl %gs
   popl %fs
   popl %es
   popl %ds
   popa
   
   
_ZN16InterruptManager22IgnoreInterruptRequestEv:
   
   
   iret
   
   
.data
    .interruptnumber: .byte 0
   
Attachments
Ekran görüntüsü 2022-05-05 200318.png
M. Alp
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Interrupts.s gives various errors

Post by iansjack »

Again, the error messages are telling you exactly what the problem is. Time to learn x86 assembler programming, and the meaning of the various directives and defines.
davmac314
Member
Member
Posts: 121
Joined: Mon Jul 05, 2021 6:57 pm

Re: Interrupts.s gives various errors

Post by davmac314 »

"interruptnumber" is not declared as a global (via the ".global" directive), and is inconsistently spelled (once as ".interruptnumber", once as "interruptNumber").
Post Reply