NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: Alfonso V on June 23, 2005, 01:51:23 PM

Title: Far procedures and labels
Post by: Alfonso V on June 23, 2005, 01:51:23 PM
I'm trying to do an interrupt handler and i need make a far procedure, something like this:

NuevaInt21h:
  STI
  PUSHF
  DB        9Ah
  OldInt21h DD 0
  CLI
  INC       BYTE [NumTeclas]
IRET                        

But "LDS       DX, OldInt21h" fails me. How can do it?

Thank you
Title: Re: Far procedures and labels
Post by: nobody on June 23, 2005, 06:39:11 PM
> "LDS DX, OldInt21h" fails me. How can do it?

Try:

LDS DX, [OldInt21h]

----------
nmt
Title: Re: Far procedures and labels
Post by: Alfonso V on June 24, 2005, 07:37:07 AM
I've done yet and fails too. It est, compiler gives me an error: "invalid combination of opcode and operands". Also i have put next code:
  MOV       AX, WORD [OldInt21h+2]
  MOV       DS, AX
  MOV       DX, WORD [OldInt21h]

With this, compiler goes well, but executable don't work properly because NTVDM gives an error.

Cheers
Title: Re: Far procedures and labels
Post by: Alfonso V on June 24, 2005, 07:45:21 AM
I'm sorry

I have put it now right and goes right. I've put "LDS [OldInt21h]" instead "LDS DX, [OldInt21h]". An owful mistake, i'm sorry.