OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 28, 2024 7:22 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: compiling troubles : part 1
PostPosted: Mon Jan 27, 2003 5:42 am 
I have a problem when compiling my kernel with NASM. The problem is related to interrupt vector routines (SetVector, GetVector).

-- GetVector --
...
mov bx, es:[di] ; put low byte in BX
mov ax, es:[di]+2 ; put high byte in AX
...

-- SetVector --
...
mov word es:[al*4], dx ; put low byte first
mov es:[al*4+2], ds ; put high byte then
...

For these 4 lines, compiler says :

intvec.inc:25: error: invalid combination of opcode and operands
intvec.inc:26: error: invalid combination of opcode and operands
intvec.inc:46: error: invalid combination of opcode and operands
intvec.inc:47: error: invalid combination of opcode and operands

Please H E L P :'(


Top
  
 
 Post subject: Re:compiling troubles : part 1
PostPosted: Mon Jan 27, 2003 6:08 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
your syntax for get vector is wrong.
Code:
  mov bx, [es:di]   
    mov ax, [es:di+2] 


Code:
    mov word es:[al*4], dx  ; put low byte first

you cannot use the "*4" feature with non-32 registers. only
[es:eax*4] will be allowed.

Code:
    mov es:[al*4+2], ds    ; put high byte then

same as above, plus you cannot have mov <mem>,ds. You should expand it into "mov <reg>,ds ; mov <mem>,<reg>".

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:compiling troubles : part 1
PostPosted: Mon Jan 27, 2003 7:47 am 
maybe I should use

shl al, 2 ???


Top
  
 
 Post subject: Re:compiling troubles : part 1
PostPosted: Mon Jan 27, 2003 9:47 pm 
thank you ! the problem is solved !


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group