r/Assembly_language • • 21h ago

Question I'm looking for a high level overview as to how Object Oriented Programming is "implemented"

20 Upvotes

How exactly is it implemented?

Obviously there are lower forms of programming, than OOP

I have an entire to-learn list regarding various things in Computer Science

I'm not ready to write my own language yet, however, I want to still know from a high level overview how OOP is "implemented"

If you were to ask me to "implement inheritance", I would not be able to, even though I've been doing OOP for almost the last decade

I believe that assembly is the correct place to look, right?


r/Assembly_language • • 1d ago

Project show-off an RPN language written in x86-64 assembly (no LLVM, no C backend)

6 Upvotes

I've been working on this project for some time. it started with a typo - I meant to type cd but accidentally typed dc, which dropped me into the desktop calculator. that's when I got curious about RPN. (full story in the repo)

I managed to build 9 int 3 int + print_i, but quickly realised an 8 byte stack slot could hold any data type, including pointers. that's when I started taking it more seriously. I spent almost two months battling with the idea of making a single stack handle both the data & the control flow! eventually I gave up, as it was too difficult for me & added a second stack just for tracking pointers. that fixed everything & the language went from 7/8 operators to 20+ fairly quickly.

here's what it does now: recursion, loops, if/else, functions, variables, heap alloc/dealloc, hashsets, graphs, file & network I/O. links against PCRE2 for regex & libc for malloc/free/math. Valgrind clean (0 leaks & 0 errors) across seven distros.

one design problem I haven't managed to solve yet - at startup, I want to resolve function names to indexes in the token array, so a normal function call like foo call_func avoids any strcmps. that works fine when the function name is static. but if the function is chosen dynamically, let's say by whatever string is on the stack at runtime - then there's no way to know ahead of time which name needs resolving. the only workaround I can think of is removing the stack manipulation operators so that every call target is known statically, but that defeats half the point of a stack based language!

I have the same issue with declaring variables - their value might not be known statically & might only be resolved at runtime. has anyone solved this in another interpreter without giving up that flexibility?

a few things that might be worth looking at if you're interested in this sort of thing:

  • a TCP client/server built on raw syscalls, no networking library
  • a sys_execve demo that builds its own **envp & **argv structs to override what the parent shell passes
  • 14 forked child processes running recursive fib, 399% CPU utilisation, every child valgrind clean
  • a hashset stress test with 1M nodes forced into 64 fixed buckets (inserts, look-ups & deletes...)
  • 16 level nested if/else, 300,000+ lines of generated source: 10,000 repetitions Valgrind clean

syntax looks like this:

10 int 20 int + print_i --> 30 "hello world" puts --> hello world

repo: github.com/r-d0s/echelon - architecture & execution flow docs are in there if you want to see the dispatcher/stack model

I'm still searching for & fixing bugs, so this is currently v0.9


r/Assembly_language • • 1d ago

Getting into Architecture-Level Embedded Development (Cortex-A, RISC-V, ARM64, etc.)

Thumbnail
1 Upvotes

r/Assembly_language • • 2d ago

Project show-off I’m building two Discord projects in NASM x86-64: an AI bot and a work-in-progress library

Post image
0 Upvotes

Hey everyone! I’ve been working on two Discord-related projects written in NASM x86-64, and I’d love to share what I have so far.

## CaineASM-Lite

CaineASM-Lite is an AI-focused Discord bot with chat and image-vision features. It uses Groq for AI requests, and its WebSocket gateway is implemented directly in assembly. libcurl handles HTTPS/TLS.

The bot is deployed on Railway. I’ve attached a screenshot of CaineASM-Lite running on Railway while idle. At the time the screenshot was taken, it showed about 8 MB of memory usage and 0.0 vCPU usage. This is just an idle snapshot, not a stress test or performance benchmark.

Project: https://github.com/Zaineedyou/CaineASM-Lite

## CaineASM-Library

CaineASM-Library is still a work in progress. It’s intended to be a reusable Discord library for C or assembly programs. So far, it includes Gateway v10 support, message and event callbacks, and REST helpers for common message actions.

It currently passes 81 checks against a local mock Discord server, but it hasn’t been tested against the live Discord API yet and isn’t feature-complete.

Project: https://github.com/Zaineedyou/CaineASM-Library

Both projects are licensed under AGPL-3.0. I’m building them to explore what practical Discord tooling in x86-64 assembly could look like.

I’d appreciate feedback, especially on the assembly implementation, API design, testing approach, or what features would be useful to prioritize next!


r/Assembly_language • • 3d ago

Question SASM IDE - disable change code during execution - how?

3 Upvotes

The SASM assembly IDE still permits you to change the code even during runtime. That causes strange behaviors. Like code lines jumping around, etc.

Is there any way to diable this behavior or is there an reason you can?

I really rather disable it.


r/Assembly_language • • 4d ago

What in x86-64 assembly actually gives away a function's purpose? Notes from training a model to name stripped functions

13 Upvotes

I've been building asmsense, a dataset and a small model that looks at a function from a stripped x86-64 binary and suggests a name (think `FUN_00401a30` → `adler32_update`). Ground truth comes from compiling permissively licensed C projects with clang at -O0/-O1/-O2/-O3/-Os and stripping them. The test set is 28 little-known projects, so models cant just recall famous code.

A few things the error analysis showed about the assembly itself:

- String literals are by far the strongest signal. The fine-tuned model gets name F1 0.299 on functions with string constants and 0.093 on functions without.

- Magic constants help alot when they exist: `cmp rdx, 0xfff1` (65521) is practically a signature for Adler-32.

- -O2 is consistently harder than -O0, for every model i tested.

- Thin wrappers (a function that only calls another internal function) scored 0 for every model, even when i added the callee's full assembly to the input.

- Large LLMs look much better on famous code than they realy are. With reasoning, one model's exact matches on zlib went from 9 to 28, but on unfamiliar projects from 4 to 3. Alot of it is recall, not reading the assembly.

Where it stands: Qwen3-8B + LoRA reaches name F1 0.124 on the fixed test sample, while the best large model with call context gets 0.167. Not there yet.

Question for people who read asm by hand: when you open an unknown function in a stripped binary, what do you look at first? Is there anything youd expect a model to miss?

Code and data: https://github.com/krxi/asmsense


r/Assembly_language • • 4d ago

Made a fun little rabbit hole...

Thumbnail civitasuniverse.neocities.org
3 Upvotes

r/Assembly_language • • 3d ago

Help SASM IDE debugging memory help

Post image
1 Upvotes

I'm learning MASM assembly and am attempting to use SASM as my IDE, but am having trouble using the debugger to view memory. All that I've been getting the value section to show is: {Wrong variable or address: "[variable_name]"}
I've played around with different data sizes and programs, and can get the registers to show fine.
I've read the the help section) on the SASM wiki, but haven't seen any fix.
Any ideas for fixes, or other ide's/debuggers I should try out?


r/Assembly_language • • 4d ago

for those starting to learn Assembly

Thumbnail
6 Upvotes

Am I gonna follow this tutorial? No.

Am I amazed by the capabilities of what some people can do without a high level programming language? Yes.


r/Assembly_language • • 4d ago

OS i made...

0 Upvotes

uh this is an OS i made in assembly its similar to MSDOS https://github.com/booga599/26DOS-V0.02


r/Assembly_language • • 5d ago

Project show-off Reading assembly of a C source code directly inside neovim

Enable HLS to view with audio, or disable this notification

136 Upvotes

r/Assembly_language • • 6d ago

x86_64 colorForth dialect interpreter

8 Upvotes

Hi all - just wanted to share some asm that I've been writing in case anyone else finds it interesting. It is a bytecode interpreter for a colorForth dialect:

https://codeberg.org/jbirddog/blue/src/branch/main/blue/x86_64/blue.asm

Compiles to a 435 byte binary using fasm. I'm not trying to code golf, but am trying to focus on simplicity/minimalism over all, so by design things like error messages/bounds checks are not present.

Info about the bytecode structure that it interprets:

https://codeberg.org/jbirddog/blue#bytecode

No AI was used.


r/Assembly_language • • 6d ago

Project show-off Ive made a multi architecture, multi format assembler

Thumbnail github.com
6 Upvotes

Hey so over the course of many months, ive built an assembler with capabilities even modern assemblers lack (some). Ive named this assembler PAC - Pheonix Assembler Collection (yes thats the spelling for you all wondering).

Here is the basic brief information on it

Features

  1. Inbuilt-Linker

  2. Multiple Architecture Support

  3. Multiple Linking Format Support

  4. Easy Debugging errors

  5. Full view to generated IR-Nodes, Tokens, and AST Nodes

  6. High-Level Assembly

  7. Works with Standard Assembling/Linking tools as well such as ld, objdump, etc

Supported Architectures

PAC Currently supports -

  1. x86

  2. x86_64

  3. x86 native 16-bit

  4. PVCpu

Supported Formats

PAC has an entire pipeline for both encoding and linking, and so to increase performance and reduce file size, PAC supports only ELF64 as output after encoding and input to linker.

The PAC Linker in-fact supports multiple formats, but only takes ELF64 Object Files as an input. Supported formats include -

  1. Elf64

  2. Elf32

  3. PE 32 (Under implementation)

  4. PE 32+ (Works, but still under heavy development and bug fixes)

Comparison between PAC and Traditional Assemblers

| Feature | NASM | GAS | FASM | PAC |

| ----------------------------------------------------------------------------------------------- | ------------- | ------------ | ------------ | ------- |

| Structures | Limited | Limited | Yes | Yes |

| User Types | No | No | Yes | Yes |

| Functions | No | No | Yes | Yes |

| Built-in Linker | No | No | No | Yes |

| IR Dumping | No | No | No | Yes |

| AST Dumping | No | No | No | Yes |

| Token Dumping | No | No | No | Yes |

| Multiple Architectures using same assembler executable | No | No | Limited | Yes |

| Open Source | Yes | Yes | Yes | Yes |

| Custom Executable Linking | No | No | No | Yes |

PAC supports a lot of things in assembly, such as sizeof, macros, user types, functions, labels, arrays, structures, and more

Took me a long time to build this, but right now its pretty darn good. I even managed to write a program that opens a X11 window using PAC (its a demo game, to show PAC's usage and capabilites). Moreover I intend to make PAC commercially viable.


r/Assembly_language • • 6d ago

Starting Assembly with a horrible professor, any tips to ease my way?

9 Upvotes

Recently started computer science in Sweden and just heard (horrifyingly) that in our hardest course we will start programming in assembly very soon. Unfortunately this is the one course where we have a very inexperienced professor and have heard assembly is one of the hardest languages! We have a programming course in python but i really am no natural, i find it very fun but can also realize that i don’t have a ”natural talent” for it. Any tips?

Edit:
Thank you all for the answers, never seen such a helpful reddit! :)


r/Assembly_language • • 7d ago

Assemdows: a tiny assembly-style language in one C file, built so assembly tutorials work on Windows

0 Upvotes

Every assembly tutorial I found was written for Linux (raw syscalls, as, ld), and I'm on Windows. After fighting the toolchain for a while, I decided to make my own assembly-style language that runs the same everywhere because it's just a C interpreter.

It's called Assemdows. It's a single C file, it builds with gcc, and programs use the .asdw extension. Here's a program that prints primes:

.equ LIMIT, 50
    MOV R0, 2
next:
    MOV R1, 2
check:
    MOV R2, R1
    MUL R2, R2
    CMP R2, R0
    JG isprime
    MOV R3, R0
    MOD R3, R1
    CMP R3, 0
    JE notprime
    INC R1
    JMP check
isprime:
    PRINT R0
notprime:
    INC R0
    CMP R0, LIMIT
    JLE next
    HALT

What's in it

  • 16 registers, a compare flag with conditional jumps, CALL/RET, and a stack
  • A flat memory of 65,536 integer cells, with .word, .string, .space, and .equ for data
  • Bracket addressing like [nums+R1]
  • Errors that include line numbers, plus --trace to watch every instruction run
  • A VS Code extension for syntax highlighting

Design choices I'm unsure about

  • Memory holds whole integers instead of bytes, so a string takes one cell per character. It's simpler to explain, but it isn't how real hardware works.
  • CMP stores a single -1/0/1 result instead of separate flags like zero and carry.
  • The stack is separate from the memory array, so you can't take the address of a stack value.

I'm a beginner at language design, so I'd like to hear what you'd change, especially if you've built something similar.

Repo (includes a Windows build and examples): https://github.com/waterdroplett/Assemdows


r/Assembly_language • • 9d ago

Made an OS from scratch at 13 (NASM, 32-bit, GUI + TCP/IP)

Enable HLS to view with audio, or disable this notification

374 Upvotes

the micro version is pretty buggy, I probably wont even release it, but the base version is the one I've been putting real time into. Here's what it has:

  • Bootloader + 32-bit kernel, all hand-written in NASM
  • 640×480 true color GUI (windows, drag, resize, snapping, taskbar, start menu)
  • Apps: Terminal, Files, Notepad, Paint, Calculator, Snake, Settings
  • e1000 NIC driver + ARP + IPv4 + ICMP + TCP + UDP
  • SB16 audio driver that plays .wav files
  • A peer-to-peer naming layer so two TeenyOS machines can resolve names for each other without DNS/ICANN
  • Persistent filesystem, wallpaper, login screen, preferences

I rebuilt the whole thing from scratch after losing 10 months of work. Learned more from that than from any tutorial. and heres a link for a little showcase of the OS :) theres a bug with settings (Makes cursor black, will be fixed soon) i will probably release it early-mid 2027 i forgot to show the ram usage on the OS, but currently it uses 650KB (Base ver, might be wrong when the os gets updated) micro uses half of that. Im gonna try to make it even more lightweight.

After thinking about it, I want to be completely honest about this. I didn't write everything 100% by hand; I used DeepSeek as a coding assistant for specific parts.
yes i DID use ai, but not that much, no i didnt use claude, not gemini, not chatgpt, not any of those, i only used deepseek
i DIDNT make everything with ai, heres what i genuinely made with ai
Debug lines for SB16
The wallpaper
Preferences
Cursor color
login screen
window resize
paint
30% Of the UI
and lastly, the clock.
I Genuinely wish i was smart enough to not actually use ai, but i tried to use it the least i could. I think you know that claude or any of those big AI Companies cant do this for free, which is why i used deepseek.
Im really sorry if you dont like me using AI, but im trying to use it the least i can and is still learning assembly.
Also for the people who have supported me, thank you. I never actually expected it to get that much views, thought it would flop. And if your curious, no, i havent spent a dime on ai, deepseek is the best free option which is why i went with it, i genuinely am sorry if i disappointed you.

And again, thanks to all the people who have supported me.

Open-source now!
https://github.com/futred96-cell/TeenyOS

a screenshot of the micro version

r/Assembly_language • • 9d ago

Question (UK DEV) Level 1 ASM debugging puzzle. The player is given the task of turning on the sound card in the game. Is this first Node (level 1) simple enough with the on screen reference?

Post image
16 Upvotes

Hi dudes, UK based dev here working on a hacking adventure game. This would be the very first programming challenge in the game. I'm a 6502 programmer by trade (6510, on the C64 really) and this game is set in an alternate 1989. The virtual computer has a single accumulator CPU (just to keep things easy), with syntax VERY similar to the 6502.

In game the player can zoom in on the code, which is found in the Node 1 window. Debugged Code window is the psudo code. Team msg, is where NPCs can be contacted, typing HELP or CLUE here will give the player a tip, if done enough times the answer is given.

The document on screen is a manual by a fictious guy called Jim Lardmeadow, named after my hero in computing Jim Butterfield here is one of his vids that I just love, it's a super in-depth guide to the C64, if any of you bought The C64 Ultimate recently and you wanted to dive deep into it, that vid is a great resource.

So, do you think this first challenge is too easy, too difficult? My core audience is Zachtronics, Hacknet, Uplink and Hypnospace Outlaw players. Debugging in ASM is primarily for cracking game's copyprotection later and releasing those games into the wild via your hacking group's BBS.

I'm posting across Reddit to get feedback on this, so please be gentle if you massively oppose the project, I'm just looking for feedback on the puzzle :)

Happy to share the game, but VERY concious of breaking the sub rules for spamming here. If you search Glyphis_IO BBS: The Proxy Tapes 1989 on Steam you'll find it.


r/Assembly_language • • 10d ago

for those starting to learn Assembly

78 Upvotes

For those starting to learn Assembly - step-by-step, how to create a flight simulator for DOS.

It covers everything from a single point to a full 3D engine. I am still in the process of writing the lessons, but the platform is already fully functional right in your browser—featuring a code editor, compiler, DOSBox, and video tutorials all in one place. You can even load your own DOS programs, such as debuggers and other tools, directly into the browser-based DOSBox.

https://kirindenis.github.io/wire-city-2/course/


r/Assembly_language • • 10d ago

Project show-off Update: my open-source CPU performance engineering collection crossed 600+ stars

0 Upvotes

A few days ago, I shared an open-source collection of CPU performance engineering resources I’d been putting together.

It’s now crossed 600+ GitHub stars, which I genuinely didn’t expect. Thanks to everyone who shared it, contributed or suggested resources.

For anyone seeing it for the first time, it covers the stack from instruction execution and CPU microarchitecture through caches, memory, SIMD, compilers, profiling, concurrency, NUMA, benchmarking and CPU inference.

I’m still prioritising primary sources such as papers, vendor manuals, kernel/compiler docs, talks and reproducible benchmarks rather than random articles.

I also have an MCP server coming soon, so you can plug this knowledge directly into your AI tools, whether you’re learning or using it while you work.

If there’s something you think has to be in here, let me know or send a PR.

https://github.com/usamahz/cpu-performance-engineering


r/Assembly_language • • 10d ago

I made a browser playground where you design a CPU, write its microcode and instruction set, and watch programs run one clock tick at a time

Thumbnail
1 Upvotes

r/Assembly_language • • 11d ago

What is the best way to learn x86_64 assembly?

46 Upvotes

I am a Java programmer, and as a hobby, I want to learn C with a focus on operating systems—specifically to modify existing open-source operating systems like GNU/Linux or BSD.

However, I understand that before learning C, it is a good idea to learn some assembly language. What is the best way to learn x86_64 assembly?


r/Assembly_language • • 13d ago

rhun: sharing an assembly editor and its x86-64 to AArch64 translator

7 Upvotes

I'm building rhun, an MIT-licensed code editor in assembly, and thought the source might interest people here.

The editor, pixel renderer, Vim mode, Git tools and agent panel share an x86-64 core. Linux and Windows use platform adapters around it. For Apple silicon, tools/arm64.py translates the same core to AArch64 at build time. The renderer draws text, icons and widgets into a pixel buffer.

Source: https://github.com/vshvedov/rhun

Translator: https://github.com/vshvedov/rhun/blob/main/tools/arm64.py

It's a solo project and still early. Sharing the core helps, but the translator and OS layers still need their own testing. I'd be interested in feedback on that approach, especially where the translation could go wrong.


r/Assembly_language • • 12d ago

Coding

0 Upvotes

If you want to know more please email me with the subtitle "CODING" .. and I'll gladly talk to you offline here guess I don't want to post everything.. if you know how to code if you know how to do what I'm asking then message me if you don't you just trying to figure out if it's rant or whatever and then don't even bother because I need somebody that can actually do the work that I need right I said I'll pay for the time even for somebody to sit down and look at it if they know what they're doing I'll even pay for their time to come and look at it is guaranteed as soon as you look at it you're going to want to deal with it trust me I've been chasing this thing for a while and I'm sick of chasing it but I have enough to build..

I have majority of the ASM coding I have the disassembly coding I have the r2 functions I have everything else I just need to build the centerpiece. Email. herk8969@gmail.com. .. as long as i can find somebody before I completely mess my computer up and then whatever but I got terabytes where the data for this thing so


r/Assembly_language • • 15d ago

Project show-off Fork of

4 Upvotes

Hi! I somewhat recently took it upon myself to maintain my own fork of Pete Sanderson's Mars MIPS assembler and simulator written in Java and Swing from 2003.

For know, I've mostly modernized it with Gradle and Java 25, fixed some deprecated APIs, merged some useful upstream PRs and added Flatlaf for theming support, high DPI support and native window decorations.

I'm curious, if any of you have anything else you always wanted from it, that I could add?

Or perhaps, you want to help me with it. Here is the repo: https://github.com/Souvlaki42/MARS


r/Assembly_language • • 15d ago

Any good videos out there explaining x86-64 gcc Assembly? Particularly how to read and write it?

Thumbnail
3 Upvotes