Author Topic: Ilegal intructions  (Read 17600 times)

nobody

  • Guest
Ilegal intructions
« on: January 05, 2010, 01:31:37 AM »
I have problem when using intructions like this:

mov ds, ax        ;set ds with the address of a segment data like .data or .bss
out dx, al  ;output byte in AL to I/O port address in DX
also i can't use the interuptions intructions like int 21h

This intructions can be assemble but when i run the program and one of this instruction will be executed the program can't continue and terminate.

What is the problem? i am in window vista so the program run in real mode or protected mode. this have some relation with the problem? i need some privilege level if I am in PM? how can i use this intruction without problem?

I am using masm32 and nasm but the problem is the same when i run the program crash in this intructions.

please everybody some links and codes to this matter

I remenber that  a little more than 1 year I was programming assembley in tasm with the int #, in and out and  mov ds, ax intructions and work with any problem in window xp. So, i don't know what is the problem and worst I don't know how to solve!

Thanks and any help is welcome

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Ilegal intructions
« Reply #1 on: January 05, 2010, 05:28:07 PM »
If your code ran under XP, but doesn't run under Vista, that ought to give you a clue! MS has "improved" their OS by removing 16-bit support. They've been threatening for years to do it - apparently they have. (I thought it was only 64-bit Vista that dropped dos support - you running 64-bit Vista?)

An emulator called "dosbox" may help.

Best,
Frank