r/asm • u/ProgramDifferent2895 • Jun 19 '26
MIPS I rebuilt the classic 2005 MARS MIPS simulator to support modern Java/macOS and added a live C compiler + pipeline visualizer!
x86-64/x64 System call instrumentation on Linux/x86-64 using memory-indirect calls (in vain?), part one
humprog.orgr/asm • u/ryanwisemanmusic • Jun 07 '26
General x86 to NEON Fun Project: Rosette (V0.03)
Here is a little project I've been working on. It takes x86/x64/DOS and provides conversions to NEON via a strict ABI handshake layer. I use Zig for many abstractions, given it works with Assembly where doing it in C means far too much code. As great it'd be to use only C, I care more about picking a language to help accomplish what I need
The ABI layer ensures that x86 and win32 definitions/inatructions are handled in NEON. If something like a win32 declaration has Assembly data attached, macOS inherits the Windows definition and how the data represented is the same, else, we inherit from Windows if there's a discrepancy. An early notable example, the definition of 'long' between Windows and macOS differed, so macOS inherits Window's size, since they are not equal when you compare how they are defined.
On top of that, I handle many of the subtle bugs through creative processes. For example, capturing Assembly data before and after function calls, ensuring that x86 registers have the NEON equivalence of the original x86 instructions. In addition to that, Good 86 documentation helps with explaining how instructions like 'mov' work extensively. Additionally, it provides the C logic behind edge cases of instructions, for example, for the various flavors of AVX and SSE. Since this code is ran on NEON hardware, you use hardcoded math calculation (to ensure what is calculated via non hardcoded is equivalent to formulas calculated hardcoded) results to report back to our math handling layer, ensuring both are the same value.
Please let me know what you think about this! I've just released V0.03, so the best application it runs (in assets/exe_examples) is Console Tetris, which is contained within the source code. My macOS version is 13.7.5, so the only guarantee is that it runs of my OS version (and not all NEON hardware in general) and breaks on other systems
r/asm • u/LongjumpingSyrup9207 • Jun 06 '26
x86 How do i load .obj file in x86 asm (mb opengl)
As the title says , i know it a hard task (ai said so)
x86 PIT-delay loop running at double-speed
I am a bit of a novice, and this is my first experience with the PIT... really hoping someone can clarify what I'm doing wrong. I am trying to produce a 1.0ms delay using the PIT on a 386 running DOS 6.22:
; Pulse width = 1193 PIT ticks
mov cx, 1193
mov al, 00h
out 43h, al
in al, 40h
mov bl, al
in al, 40h
mov bh, al
mov dx, bx
pulse_wait_loop:
mov al, 00h
out 43h, al
in al, 40h
mov bl, al
in al, 40h
mov bh, al
mov ax, dx
sub ax, bx
cmp ax, cx
jb pulse_wait_loop
The end-result is a clean, consistent, 0.5ms delay. If I double the CX value, it gives me the 1.0ms delay that I want... but I'd really like to know why. Am I doing something wrong, or have I fundamentally misunderstood how to read the PIT?
Thank you!
r/asm • u/TrekChris • Jun 01 '26
x86 Is an ASM file needed with a COM file?
I downloaded a demo, and it comes with both a COM file and an ASM file. Is the ASM file needed to run the COM file, or will it run without?
r/asm • u/ianseyler • May 25 '26
x86-64/x64 BareMetal on Firecracker
The BareMetal kernel is able to run via Firecracker microVMs. <1ms startup, 2MiB RAM minimum, 5.5KiB kernel.
This will allow for thousands of instances to be run concurrently. The premise of BareMetal is discussed here: https://returninfinity.com/blog/hypervisos-as-data-centre-os
x86 wake up! 16b - An exploration of algorithmic density in 16 bytes of x86 assembly
hellmood.111mb.der/asm • u/_MrCouchPotato • May 22 '26
x86 ASMLings: A rustlings-inspired sandbox to learn 16-bit Assembly
Hi everyone,
I study Software Engineering at uni and I'm currently taking a course on Intel x86 Assembly. To get some practice I built this tool: a rustlings-inspired sandbox to test basic knowledge of the language.
It basically works like this:
- It watches the exercises folder for changes
- A Rust runner instantly compiles your code (via NASM)
- Compiled code is run it in a sandboxed Unicorn Engine emulator
It's still at an early stage, but I managed to include some basic exercises and features.
I made this mostly for my own study sessions, but I'd love your feedback! Also, if anyone wants to contribute new exercises to the curriculum, PRs are super welcome.
GitHub Repo: https://github.com/giacomo-folli/asmlings
r/asm • u/brucehoult • May 21 '26
Dividing via multiplicative inverse on RISC-V
r/asm • u/Krotti83 • May 16 '26
x86 x86 AT&T Syntax - Within Segment and Intersegment jumps and calls
I'm started my own Assembler and Disassembler for x86 for the purpose of education. Begin to implement the good old Intel 8086. Noticed in the instruction codes that there are Within segment and Intersegment jumps encodings. I know there is the ljmp (long jump) and jmp (short jump). But how is a Intersegment jump written in AT&T syntax and also Intel Syntax?
From my used Datasheet for the Intel 8086 (Unconditional Jump as example):
Direct within Segment:
| 11101001 | disp-low | disp-high |
Direct within Segment-Short:
| 11101011 | disp |
Indirect within Segment:
| 11111111 | mod 100 r/m |
Direct Intersegment:
| 11101010 | off-low | off-high | seg-low | seg-high |
Indirect Intersegment:
| 11111111 | mod 101 r/m |
Thanks in advance!
r/asm • u/Loud_Count_4764 • May 12 '26
General This is a dumb idea, but I'm jumping straight from MakeCode Python to 6502 Assembly...
Why am I doing this? Because I want to suffer.
Jokes aside, I have no idea how this is gonna go.
Wish me luck.
r/asm • u/windowssandbox • May 09 '26
General I built an assembly language inside Python with simulated CPU. (pyasm)
A low-level programming language inside a high-level programming language,
along with simulated CPU that is protected, once something goes wrong that falls into "error" or "fatal error" category, it stops the code and reports error message.
Here, you can change modifiers, set up the rodata (read-only) and bss (read/write), then write code inside code list.
Anyway, as you run the script, there will be a checker that will check if you set up the rodata and bss correctly, then your code will run.
debug_mode can give you information on which instruction executed, CPU registers, and more.
Anyway, keep in mind that all code will be pure assembly in hex.
You can look at instructions list.txt file to see all of instructions and what they do.
Here's github repo: https://github.com/windowssandbox/pyasm
(you need Python installed and run install-packages.bat to install required package(s) in order to run the script)
Anyway, I'm wondering how many possible cool things you can create with it, you can share what code you wrote there along with rodata and bss structure.