Search code examples
linuxnasmmacos-sierra

Assembly Level Programming in macos using NASM


My prof. has asked me to do assembly language programming in linux through NASM X86 64 bit.

Since,I have Mac with me the programs will need to be modified for the MacOS, may be due to the system calls and whatever other reasons.

How shall I replicate the same environment as asked by my prof.in my macos ?

Will it be good enough if I install linux in my Macbook ?

If yes, then what will be the difference between the "Linux in Windows PC" and "Linux in Mac" in terms of programs that I will write ? If no, then how shall I deal with that ?


Solution

  • Will it be good enough if I install linux in my Macbook ?

    Installing it in a VM might be more convenient (you don't need to reboot to go from MacOS to Linux), but installing it directly on your Macbook will also work.

    If yes, then what will be the difference between the "Linux in Windows PC" and "Linux in Mac" in terms of programs that I will write ?

    "Mac vs. PC" marketing terminology not withstanding, Macs run the same types of x64 CPUs as "regular PCs" and Linux doesn't care which other operating systems are also installed on your system. So if you write assembly on a Linux on an x64 Mac, you'll use the exact same x64 instructions and Linux syscalls as you would when running Linux on an x64 non-Mac.