Click to See Complete Forum and Search --> : A simple question about assembler (8086) compatibility.


Wallex
08-01-2002, 11:51 PM
This is really out of curiosity.
If I make a program in assembly language, what will make it incompatible between OS'es (If I make it in Linux, what will make it Windows incompatible)? I ask this because I am learning to program in assembler (8086) and I wouldn't like having to boot up into windows to do my assignments (specially since I don't have access to my music from there). I know assembler is directly linked to the processor (above all) so I shouldn't have problems making a program that will work on both systems, right? Or is there anything I need to consider? I am not going to work with files, so I will not have problems with the filesystem. I will work with interruptions to try to print output and read inputs, will this be a problem for portability?

l01yuk
08-02-2002, 04:20 AM
Code you write in Linux won't be compatible with Windows is the short answer. I don't know if there are any emulators out there, that is a possibility.

TacKat
08-02-2002, 08:27 AM
If you were to make heavy use of macros and conditional assembly you could write a program that would "port" fairly easily, but in essense you'd be writing two different programs that did the same thing and putting them in the same source file. Or I suppose you could use C libraries, but if you're going to do that you might as well write in C.

Assembly is heavily dependent on the architecture which is why its nearly impossible to port a program to a different processer type without rewriting it entirely. However, assembly is also dependent on the OS because you usually don't have any libraries to abstract the interface.

For instance, the polite way for asm code to do things in Linux is to make syscalls (int 80h), but in MS-DOS you fire off a couple different interrupts to do the same job.

So it comes down to this: Yes, it's possible. Doing it while trying to learn assembly is likely to be a lot more hassle than its worth.

Wallex
08-02-2002, 04:31 PM
Ack... alright, I guess I feared that kind of answer. Thanks for clearing things up before I made a BIG mistake...