Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Assembly code got system error,any hints?

Status
Not open for further replies.

dongshandle

Programmer
Mar 26, 2002
2
US
My simplest "hello world" assembly code can compile and link. But everytime I tried to run it, just got system error "The program tried to execute an invalid instruction". First, I thought it's because 386 up CPUs run under Protected Mode in default and I need to use DPMI. However, NO NO and it just works on my friends windows98 machine. I tried both TASM2.0 and MASM6.00B, got the same result. If I restart the machine within DOS mode and try to run it, the machine just died. AmKG,Straiph? Do you have any idea? It may be a simple problem, but I really have no idea.
 
What's your OS?

Would you mind posting the program? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
if it works on your friends PC but not on yours under dos then i am thinking jammy donuts - no - sounds like a hardware configuration (bios) oddity.

what version of DOS are you booting your PC with? try Win98 shell or less.

how did the machine die under dos?
have you made sure that if calling interrupts that you are doing the right ones and in the right fashion?

write a program to do following:
mov ebx,0B8000h ;put white/blue * at top left screen.
mov ax,01F2Ah
mov [ebx],ax
mov ax,04C00h ;dont forget (DOS terminate executable)
int 21h

boot DOS , clear screen and execute.
this just resolves the pointer to start of code in your program.

have you assign the code, data and stack segments correctly?

i know, why dont you post the source asm which will save alot of guess work and then i cant get on with something more important like jammy donuts.

Straiph.
0000:0000:0000:0000h
The people who have nothing to say and say it too loud have little knowledge, It's the quiet ones you need to worry about!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top