Assembly Language Programming under Mac OS X

AI Thread Summary
To start assembly language programming on Mac OS X after experience with C, it's essential to understand the architecture of your system, particularly if you're using a MacBook Pro with an Intel processor. XCode includes an assembler (as) that can be utilized for compiling assembly code, but specific knowledge about its setup and debugging process is necessary. Resources like the Apple developer documentation provide insights into calling conventions, which are crucial for ensuring compatibility between assembly code and other languages like C++. NASM is recommended as a common assembler for Mac OS X, and users should familiarize themselves with its documentation to configure platform settings correctly. Additionally, understanding how to link object modules compiled with NASM to other development tools is important for effective programming.
Agisch
Messages
7
Reaction score
0
I want to start with assembly language programming after some years with C, cause I think it's a good way to learn how a computer actually works.

But how I can compile assembly code under Mac OS X?

I went to a library, and I had found out that many books are outdated, and no book covers assembly language concerning Mac OS X.
 
Technology news on Phys.org
Hey Agisch and welcome to the forums.

Can you outline your architecture for your system (since this is important for picking an assembler program)?
 
XCode includes an assembler (as), but I'm not sure what's required to assemble and debug code using XCode. Here's a wiki link, but you should do a web search for "XCode assenbler" to get more information on how to use it, and howto use it with OS X. Assuming the C compiler has an assembly output option, you could write some code in C that makes basic OS X calls such as file I/O and look at the assembly code produced by the C compiler.

http://en.wikipedia.org/wiki/Xcode
 
chiro said:
Hey Agisch and welcome to the forums.

Can you outline your architecture for your system (since this is important for picking an assembler program)?

My system specifications:

MacBook Pro
15-inch, Mid 2012


Processor 2.3 GHz Intel Core i7
Memory 4 GB 1600 MHz DDR3
Graphics NVIDIA GeForce GT 650M 512 MB
Software Mac OS X Lion 10.7.5 (11G63)
 
Given you have an Intel then any x86 64 (or x86 32 if 32-bit size words) will do the trick.

When you do assembler routines you need to make sure the calling convention is correct. Here is a look at it from Apple:

http://developer.apple.com/library/...owLevelABI/000-Introduction/introduction.html

Basically this ensures stuff is passed directly between different environments and its a critical thing when using assembly code in conjunction with say C++ or something else.

As for the actual assembler, I did a google search and I got this:

This document here mentions NASM which is a common assembly program.

http://www.nasm.us/

Read the docs for how to set the platform information (word size, operating system, calling conventions, etc) and you'll be good to go.

Also check out how you can link object modules compiled with NASM with your other dev tools if you are linking to compiled libraries, dynamic libraries, executables or other code objects.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top