Homebrew Making Homebrew with ASM

[GBATemp]~IceStorm

Banned!
OP
Banned
Joined
Oct 29, 2013
Messages
71
Trophies
0
Location
yo mama's house
XP
111
Country
United States
Hello.

I am new to the Homebrew scene. I have a comprehensive understanding of C++ and I am starting to learn devkitpro. My question is, do you have to know both ARM assembly and a compiled language like C++ to do Homebrew or just one? If you don't need to know ARM, then why are people using it for Homebrew? What are the benefits of it? Also can you mix C++ code and ARM code that compiles and also uses an assembler?
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Hello.

I am new to the Homebrew scene. I have a comprehensive understanding of C++ and I am starting to learn devkitpro. My question is, do you have to know both ARM assembly and a compiled language like C++ to do Homebrew or just one? If you don't need to know ARM, then why are people using it for Homebrew? What are the benefits of it? Also can you mix C++ code and ARM code that compiles and also uses an assembler?


Code you see in ASM is for ARM9.
You can write regular homebrews (ARM11) in C/C++ through devkitpro using ctrulib.
 

UraKn0x

Official senpai
Member
Joined
Mar 20, 2014
Messages
370
Trophies
0
XP
735
Country
France
Oh. What functionality do both ARM9 and ARM11 processors provide? Why is only the ARM9 written with ARM asm code?
The ARM9 core is mainly used by the operating system of the 3DS. The code you see in ASM is mainly exploit code or assimilated to exploit, for example a CFW launcher.
There is no interest in writing homebrew for the ARM9 core apart from using privileged commands, such as booting the firmware. For a "normal" homebrew you'll only ever need ARM11.
Of course you can write ASM code for the ARM11 core but this is mainly useless unless you're doing very specific operations on which you need to control EXACTLY what's happening on your 3DS, and you can also write C/C++ (Not sure for C++) for the ARM9 core, but given why this core is used, you'll mainly write ASM code for it.
 

Jim_e

Well-Known Member
Newcomer
Joined
Nov 13, 2007
Messages
79
Trophies
0
XP
267
Country
United States
Hello.

I am new to the Homebrew scene. I have a comprehensive understanding of C++ and I am starting to learn devkitpro. My question is, do you have to know both ARM assembly and a compiled language like C++ to do Homebrew or just one? If you don't need to know ARM, then why are people using it for Homebrew? What are the benefits of it? Also can you mix C++ code and ARM code that compiles and also uses an assembler?
The benefits of ASM for ARM11 is generally more speed, for the ARM9 it's privileged access. On the 3ds the ARM11 is just barely fast enough to do most of what you want.

You don't need to know or use ASM to do homebrew. You don't need to know ASM to use ASM functions in fact, you can probably find some well written ARM ASM functions that could speed up code floating around on the internet. But understanding ASM can give you an understanding on how to optimize your code. Many people make the mistake of thinking that making C++ code look smaller and cleaner produces faster code, but that's not generally the case.

If you're interested in ASM, Steam has a programming game called TIS-100 based on a massively parallel accumulator processor. It's pretty cool, and can definitely give you a feel of asm.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
If you want develop an homebrew for 3DS, stat doing it in c/c++.

If you want to learn arn asm, search a tutorial online (there are really good ones) and start studying it, but leave the udea of writing homebrews for the moment.

Both the thing need a large amount of knowledge so keep focused on learning well only one at a time
 

Jim_e

Well-Known Member
Newcomer
Joined
Nov 13, 2007
Messages
79
Trophies
0
XP
267
Country
United States
Thanks. After I have learned ARM, how can I apply my programming knowledge to the 3DS? Like what functions/ libraries/ assemblers/ compilers should I use?
GCC will build asm files. If you are using Devkitpro, just place the .S files in the src folder and they will build. Normal C header files can reference any functions in the .S.

Be aware, assembly is not easy, and bad assembly is worse than bad C. Unfortunately I'm not aware of any good assembly books for ARM(many will target specific markets such as smart phones or low power embedded devices). If you are interested in a reasonably concise example, CTRULIB's gpu example implements a simple memcpy routine using asm. It should show you how to make a S file and how to use the ASM function from C.

Also TIS-100 was a game recommendation, not a resource for learning.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: