In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "Assembler"

From WiiBrew
Jump to navigation Jump to search
m
m (Robot: Cosmetic changes)
Line 5: Line 5:
 
Writing games and applications in C or C++ is of cause more efficient. However, it is not forbidden to use Assembler for the WII. If you are interested in assembler programming then give it a try and do it!
 
Writing games and applications in C or C++ is of cause more efficient. However, it is not forbidden to use Assembler for the WII. If you are interested in assembler programming then give it a try and do it!
  
<br>
+
<br />
  
 
</br>
 
</br>
Line 13: Line 13:
 
The assembler code usually has to call the C functions of the devkitpro package which provide support for the WII such as querying the Wiimote. So you have to link these with your assembler code.
 
The assembler code usually has to call the C functions of the devkitpro package which provide support for the WII such as querying the Wiimote. So you have to link these with your assembler code.
  
==Resources==
+
== Resources ==
  
[[Assembler_Application_Note | Application Note to compile and run assembler programs on the WII]]
+
[[Assembler Application Note|Application Note to compile and run assembler programs on the WII]]
  
[[Assembler_Tutorial | Tutorial for the PowerPC processor instructions and the AS assembler]]
+
[[Assembler Tutorial|Tutorial for the PowerPC processor instructions and the AS assembler]]
  
  
==Links==
+
== Links ==
  
 
[http://publib.boulder.ibm.com/infocenter/systems/topic/com.ibm.aix.aixassem/doc/alangref/alangref.pdf AIX assembler] AIX assembler manual (not AS!) with detailed descriptions of the PowerPC instructions
 
[http://publib.boulder.ibm.com/infocenter/systems/topic/com.ibm.aix.aixassem/doc/alangref/alangref.pdf AIX assembler] AIX assembler manual (not AS!) with detailed descriptions of the PowerPC instructions

Revision as of 18:02, 10 August 2009

Assembler programming for the WII

It is possible to write assembler programs for the Wii and this describes how to do it.

Writing games and applications in C or C++ is of cause more efficient. However, it is not forbidden to use Assembler for the WII. If you are interested in assembler programming then give it a try and do it!



The devkitpro toolchain uses the GCC C/C++ compiler. This compiler uses the AS (or GAS) assembler to assemble the code. The AS assembler has a different syntax to most other assemblers since it does not use the Intel syntax but the AT&T syntax which is very different from the Intel syntax. The advantage of the AS assembler among other features is that it can generate code not only for Intel processors but for a lot of different processors as well such as the PowerPC processor. So it supports instructions like stmw, stwu, mflr, mtlr, blr etc.

The assembler code usually has to call the C functions of the devkitpro package which provide support for the WII such as querying the Wiimote. So you have to link these with your assembler code.

Resources

Application Note to compile and run assembler programs on the WII
Tutorial for the PowerPC processor instructions and the AS assembler


Links

AIX assembler AIX assembler manual (not AS!) with detailed descriptions of the PowerPC instructions

MPCFPE32B.pdf The special PowerPC instructions are documented in chapter 8 of this manual

SVR4ABI.pdf or [1] The PowerPC Processor ABI Supplement

AS assembler manual

PPC CL datasheet

PPC CL special features

Introduction to assembly on the PowerPC