Free2Code
 
Time: 2009-01-06, 03:30am
MASM 5.1 Problem
Subject: MASM 5.1 Problem  ·  Posted: 2006-04-18, 12:13am
Rank: ? (1)
Member #: 27238
I am using MASM 5.1
MY OS is windows xp

I have written the following code :

DATA SEGMENT

NUM1 DB 01h

DATA ENDS


CODE SEGMENT

ASSUME CS:CODE, DS:DATA

START: MOV AX, DATA
MOV DS, AX

MOV AL, NUM1
MOV DL, AL

MOV AX,0200h

INT 21h

CODE ENDS

END START


i am able to assemble the code without any errors. i have also used link with the obj file to generate exe file

however, when i try to execute the generated exe. I am getting the following error
( my source file is FIRST.ASM)

c:\windows\system32\cmd.exe - FIRST
The NTVDM CPU has encountered an illegal instruction.
CS:057c IP:ffea OP:86 32 7b 05 18 Choose 'Close' to terminate the application.

I do not understand why the above error is coming.



 
  Reply to this ·  Post link ·  Top
Subject: Re: MASM 5.1 Problem  ·  Posted: 2007-08-12, 12:28am
Rank: ? (1)
Member #: 29655
You missing the @ character before the Data to define the data segment when initialsing your program.

Cheers,
HK

 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons