Simple Assembly code got system error,any hints?
Simple Assembly code got system error,any hints?
(OP)
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.
RE: Simple Assembly code got system error,any hints?
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."
RE: Simple Assembly code got system error,any hints?
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!