Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Simple Assembly code got system error,any hints?

Simple Assembly code got system error,any hints?

Simple Assembly code got system error,any hints?

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?

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."

RE: Simple Assembly code got system error,any hints?

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.


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!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close