Thread: easy question about machine code

  1. #1
    still a n00b Jaguar's Avatar
    Join Date
    Jun 2002
    Posts
    187

    easy question about machine code

    Yes, I know that exe file (from Windows) can not execute on linux, and vice versa.
    I doubt that machine code is `machine' dependent (not OS dependent).
    I question why it is not portable although running on same CPU, same architecture and same registers but different OS?
    Or may be different address located?
    Please make me out.
    Thanks,
    slackware 10.0; kernel 2.6.7
    gcc 3.4.0; glibc 2.3.2; vim editor
    migrating to freebsd 5.4

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    wine − run Windows programs on Unix
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    265
    My experience is that its 99.999% of binarys are portable. Linux can run windows software through emulation, Windows can run linux binarys through emulation (There are several ways, cygwin is a util that might help) and best of all, FreeBSD can run both Linux and Winblows binarys. Whats really sad is that FreeBSD's linux binary emulation is so good, that most the time it can auctually run a linux binary emulated FASTER than it can be run by a linux box natively! Now THATS speed and power. There are a million different types of executable formats, however they arent that low of a level. 99% of the time u dont want to talk to the CPU at uuber low level, you want to talk to the OS and draw pictures or characters. Besides, CPUs are way more complicated these days. Way back when, a cpu had what? a dozen instructions? something like that? Now the P4 for example has something like 450+. Thats a big gap. Thats why compilers can optomize code way better than humans can, and since the only people that know all of the P4 instructions are dark creatures living deep within the depths of intels R&D division, nobody sits down and starts hashing out ultra low level ASM. The WinASM stuff i have seen is auctually like a language. Not much like old ASM on big blue's mainframes =P

  4. #4
    still a n00b Jaguar's Avatar
    Join Date
    Jun 2002
    Posts
    187
    >>There are a million different types of executable formats, however they arent that low of a level. 99% of the time u dont want to talk to the CPU at uuber low level, you want to talk to the OS and draw pictures or characters.

    Thanks, that's I'm curious to know.
    slackware 10.0; kernel 2.6.7
    gcc 3.4.0; glibc 2.3.2; vim editor
    migrating to freebsd 5.4

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked List question from a newb(Need code Critique)
    By Gatt9 in forum C++ Programming
    Replies: 2
    Last Post: 01-08-2006, 03:11 AM
  2. sorry i know its probly an easy question
    By thestien in forum C++ Programming
    Replies: 7
    Last Post: 12-03-2005, 11:13 AM
  3. This is hopefully an extremely easy question...
    By rachaelvictoria in forum C Programming
    Replies: 2
    Last Post: 11-07-2005, 01:36 AM
  4. C# Compiled to Machine Code
    By FwyWice in forum C# Programming
    Replies: 1
    Last Post: 12-06-2002, 04:22 AM
  5. easy question?
    By aristotle1 in forum C Programming
    Replies: 1
    Last Post: 11-17-2001, 09:25 AM