Page 1 of 1

compiling troubles : part 1

Posted: Mon Jan 27, 2003 5:42 am
by kerim
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 :'(

Re:compiling troubles : part 1

Posted: Mon Jan 27, 2003 6:08 am
by Pype.Clicker
your syntax for get vector is wrong.

Code: Select all

  mov bx, [es:di]    
    mov ax, [es:di+2]  

Code: Select all

    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: Select all

    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>".

Re:compiling troubles : part 1

Posted: Mon Jan 27, 2003 7:47 am
by kerim
maybe I should use

shl al, 2 ???

Re:compiling troubles : part 1

Posted: Mon Jan 27, 2003 9:47 pm
by kerim
thank you ! the problem is solved !