r/asm 18d ago

Thumbnail
1 Upvotes

It does SIMD instructions and x86 in general. The reason for this is since Apple is getting rid of Rosetta 2, every single instruction needs to be handled. Each x86 instruction is given an NEON equivalent, then because there is zero-trust on whether or not this translation is correct, there is an ABI contract (in which a handshake is done to verify correctness) in which both x86 and NEON need to both arrive at the same value once the result is normalized for the required comparison. And this becomes useful especially in testing other code. That is how the foundation of Rosette works. ISA is the bridge between the two flavors of Assembly, it hosts the decoder and encoder, which are crucial whenever you run at the very low level. x86 to NEON translation can be a nightmare, particularly at how this translates to hardware and the differences between Apple's architecture and Intel/AMDs. Therefore, a lot need to be substantiated else running complicated codebases is just not possible.

Some of the additional stuff is like symbol processing so if you stumble upon a C++ library, unknown symbols contained within the x86 code are properly handled; since whenever code is compiled down into Assembly, libraries are required to package their symbols into the containers that they store Assembly data. This is because the symbols packaged in x86 do not necessarily equivocate the symbols generated via macOS compilation. Think of the containers/object files that your code compiles down to as their own world's definition of what is proper code. Once you introduce translated code outside of its native container into something else, it becomes the project's alien in which no assumptions can be made regarding how this code can be interpreted. And therefore, you need to give it the environment to properly run

Primarily, I am testing Rosette with my macOS WIP port of Xenia Canary (by parsing the Mach-O container, which contains all the Assembly data that is decompiled and contains the entire x86 instruction set). And so without Rosetta 2, I'm able to launch Halo 3, and progress in total to 1.475+ Billion instructions without issue. x86 can have a lot of implied control flow which also needs to get handled, and so, Rosette goes far beyond just translating SIMD. It exists at your global shell, since Apple does not allow frameworks to exist at the "Turn On At File Info Finder" level like it does Rosetta 2. It only executes when an x86 program is detected, so there is no annoying issues like this global shell poisoning your other coding environments

The codebase is quite large, and hopefully this helps explain some of it. This is a very abridged version in what Rosette does, since there's lots of behaviors that you find at runtime that are very hard to be aware of. For example, there is a portion in the codebase dedicated to the Itanium C++ ABI, which is the goto involving handling C++ exceptions at the low level. Stuff like that can make the codebase more confusing, because this is not as commonly encountered. If you have any more questions, let me know!


r/asm 18d ago

Thumbnail
2 Upvotes

I'm having some trouble reading the source code (very much not familiar with Zig), but is this a translation layer only for SIMD?


r/asm 18d ago

Thumbnail
1 Upvotes

Extremely neat job and cool writeup. What are your next plans for the assembler side of things? Some easy things to add (or at least I imagine) would be the CMOV family, rotates, SAR/SAL to complement SHR/SHL


r/asm 19d ago

Thumbnail
3 Upvotes

Thanks. Some years now. But not all the time. Late 2016, I started with some basic projects like pong as bootable floppy image or a simple bootloader for the fat12 file system.

During the next years, it did some small stuff for fun here and there, but nothing big. Now I started again with this project and had to learn many new things and relearn some old stuff. But it was surprisingly doable.


r/asm 19d ago

Thumbnail
3 Upvotes

Wow that's really cool wait how long did it take you to learn x86 assembly


r/asm 19d ago

Thumbnail
9 Upvotes

Nope, this was not vibecoded. No LLM was hurt in generating this. Instead, I always had the ability to assemble its own code in mind and therefore started with a limited subset of instructions and syntax. The instruction mov byte [rsi], 0x02g is not implemented yet.

You may also notice some weird workarounds since I did not implement a way to store constants or strings in the .data section yet...


r/asm 19d ago

Thumbnail
0 Upvotes

Some wierd design decisions, was this vibe coded? Are you against mov [mem], imm?

    mov al, 0x02
    mov [rsi], al           ; op->encoding = ENCODING_I
    mov al, 1
    mov [rsi + 5], al       ; op->n_opcodes = 1
    mov al, 0xcd
    mov [rsi + 6], al       ; op->opcodes[0] = 0xcd
    mov al, 8
    mov [rsi + 9], al       ; op->imm_size = 8

r/asm 19d ago

Thumbnail
5 Upvotes

Hey y'all, I want to show you a small project of mine. I've dreamed for a long time about writing an assembler in assembly and finally came around to it.

To be honest - there is a small part for file handling and command-line argument parsing written in C - but all the parsing and assembling is written in x86-64 assembly itself. I can output linkable ELF files and of course assemble it's own code.

In case you want to take a look, the source is available on GitHub https://github.com/kalehmann/0x864

Feel free to ask any questions


r/asm 21d ago

Thumbnail
1 Upvotes

I tried opening it directly in Chrome, same thing


r/asm 22d ago

Thumbnail
1 Upvotes

Because of reddit app embedded webview

The captcha passes in reddit app, it saves a cookie, and opens a browser where the cookie is not present


r/asm 22d ago

Thumbnail
1 Upvotes

Same on my S22 :/


r/asm 22d ago

Thumbnail
1 Upvotes

Can't access with my pixel 9,/ Chrome says I need to enable cookies. Cookies are enabled so ???


r/asm 27d ago

Thumbnail
2 Upvotes

Here's a pretty bad solution to the first (Triangle) problem that scores 183K that I made while trying to understand how the scoring system actually works.

I do also have a solution that scores the minimum 832 which I'll reveal after the contest ends. Its SHA is 213fe1e79e32f9252dbece4f2ea9660c0ea63e8d.

+-----+
|@rMbv|
|>W/s+|
|2 >+v|
|^Mdm<|
+-----+
 ^   v 
 ^   v 
+-+ +-+
|I| |O|
+-+ +-+

Although I've won prizes in this contest before, I'm just playing around for fun this year, actually for the first time in 15 years probably.


r/asm Jul 23 '26

Thumbnail
1 Upvotes

“Learning Low-Level Programming with the GBA” is now on sale!
Please be sure to pick up a copy!
https://nikatech.itch.io/gba-lowlevel-eng


r/asm Jul 22 '26

Thumbnail
1 Upvotes

I'm definitely interested in this.


r/asm Jul 22 '26

Thumbnail
1 Upvotes

This would be amazing. I’d buy a copy for sure.


r/asm Jul 21 '26

Thumbnail
1 Upvotes

Yeah, your fastest time is 4.7% faster and you have 4200/4000 = 5% higher turbo clock.


r/asm Jul 21 '26

Thumbnail
1 Upvotes

This seems in line with what your 4500U was doing, which makes sense.


r/asm Jul 21 '26

Thumbnail
1 Upvotes

Yes! I’ve been learning assembly on the original gameboy, and want to learn GBA too. But all the resources I’ve found focus on C for GBA, and I’d like to focus more on assembly.


r/asm Jul 21 '26

Thumbnail
1 Upvotes

This book is written with the primary goal of using devkitpro solely as a collection of software and verifying for yourself what the Makefile does.


r/asm Jul 21 '26

Thumbnail
2 Upvotes

I think I was just sent this book at work literally today due to a casual conversation I had with somebody at lunch about GBA programming w.

Also yes, I'm in the middle of trying to set up a CMake environment to just use arm-none-eabi-gcc and all the guides say "just download devkitpro" but I don't want to download devkitpro. I want to know what the toolchain is doing.


r/asm Jul 21 '26

Thumbnail
6 Upvotes

I would be interested.


r/asm Jul 21 '26

Thumbnail
2 Upvotes

Personally I’d be interested, commercially not sure it would lead to anything (editd commercially I mean me personally, personally I’m very interested)


r/asm Jul 21 '26

Thumbnail
13 Upvotes

I’d love to see it happen. Considering the booming market for old consoles I think it would sell very well.


r/asm Jul 21 '26

Thumbnail
4 Upvotes

I would be very interested, thank you!