Assembly for Intel based computers on a mac...

Discussion in 'Mac Programming' started by TrumanApple, Sep 14, 2005.

  1. TrumanApple macrumors member

    Joined:
    Jan 2, 2005
    #1
    Is this possible? In my systems programming class we are using 32 bit MASM to program, and i have a mac. Is it still possible to do this from my mac without virual pc?
     
  2. VanMac macrumors 6502a

    VanMac

    Joined:
    May 26, 2005
    Location:
    Rampaging Tokyo
    #2
    Not likely. You are programming instructions for a specific processor (x86). There may be some sort of emulator you could run your code on....

    You could write all your code on the mac, as you only need some text editor, but debugging or running it would be a different story...
     
  3. mrichmon macrumors 6502a

    Joined:
    Jun 17, 2003
    #3
    Often for systems programming courses you will be running your assembly code in a CPU simulator. This protects you from hosing the running system and usually allows you to see the contents of the registers and CPU state to help you learn what is going on. If your course is using a Intel CPU simulator then may be possible to get that simulator or something comparable which runs on OS X natively. As an example, the Bochs IA-32 emulator runs on a Mac the QEMU emulator may also run on a Mac.

    For comparison, I used to teach SPARC assembly but the student labs had mostly windows machines. So we used a SPARC cpu simulator which run on Windows (and various other platforms since it was written in tk/tcl).

    Try googling for intel cpu simulator "OS X" which appears to turn up some pointers to useful simulators.
     
  4. rhix macrumors newbie

    rhix

    Joined:
    Jul 1, 2004
    Location:
    Winnipeg,MB
    #4
    NASM is portable

    If your goal is to write 32bit x86 Assembly, then you could use the Netwide Assembler (NASM). It's freely available online, and has been ported to run on many architectures. I've written a ton of x86 asm from my alpha. Of course, that doesn't let you _run_ the code. I'd get some emulator like QEMU (or Bochs) for that with a DOS image.

    MASM sucks, it introduces a lot of stuff in assembly that really shouldn't be there. Data types? The CPU doesn't give a rat's ass if your int is signed or unsigned, it'll run the exact same operations on it either way. So why should you care?

    I've used MASM, TASM, and NASM, and NASM was by far the best one for me.
     
  5. notjustjay macrumors 603

    notjustjay

    Joined:
    Sep 19, 2003
    Location:
    Canada, eh?
    #5
    I used to TA a course where we had a Java-based simulator of X86 assembly language. I was just trying to find it, but it doesn't seem to be posted online. Sorry. :)
     

Share This Page