Linux and CPU requirements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 15 January 2003 09:43 am, Weber Walter M wrote:
> concerned with the error message or its solution. What I want to know is
> when I install a Linux distro on my PC and write assembly programs using
> it, will I get this message or am I getting it just because I'm coding on a
> PC whose OS is Windows 2000 and I'm in the DOS window.

Well... assembly language programs need to fit the CPU state and installed
operating system.  I suspect your problems are associated with these
two requirements.  DOS programs can be run when the CPU is in "real
mode" which uses 16 bit addressing.  All that is needed is to use a
DOS assembler to compile the program and produce a EXE or COM
file.

The gcc compiler can be configured for many different operating systems
and in Linux it normally creates 32-bit programs in ELF or COFF format.

If you are beyond these problems then the type of CPU might be a problem.
Most CPU's are downward compatable.  That means they support the old
instructions but may have some new instructions added.  For this reason
it helps to write assembly for old CPU.  Another problem is that not all
CPU's have floating point math instructions and the program needs to
check before using a floating point instruction.

Another problem might be addressing memory.  If you try to access
memory that does not exist an error occurs.  Sometimes this is
the "illegal instruction" message with isn't very helpful.  The CPU
just triggers an error interrupt and the message depends upon who
is handling the interrupt.

To summarize, assembly can be written for both Linux and DOS but
requires different proceedures.

jeff (over-the-hill DOS programmer)






[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]