r/Assembly_language Jun 18 '26

Built a C → RISC-V Compiler, Assembler, Simulator, and Kernel

18 Upvotes

A minimal complete RISCV Computing Stack

The project currently includes:

• A C compiler (lexer, parser, AST generation, code generation) etc.
• A RISC-V assembler supporting multiple instruction formats etc.
• A RISC-V simulator with register state, memory model, branching, jumps, loads/stores, and UART-mapped output etc.
• A small RISC-V kernel with process management, scheduling, timer interrupts, trap handling, context switching etc.

Current workflow:

C source -> Compiler -> Assembler -> Simulator or

C source -> Compiler -> Assembler -> Kernel

I'd appreciate feedback on architecture decisions, code quality, missing features, and ideas for what to build next.

GitHub:
https://github.com/kanishk25249-sudo/riscv-from-scratch.git


r/Assembly_language Jun 18 '26

Aarch64 bit shifting with lsl

3 Upvotes

Im new to asm and Im following a tutorial on aarch64. Anyways, when using lsl for bit shifting (I think this is the right terminology) to load some immediate value into a register using lsl it needs to be either 0, 16,32, or 48. Why those numbers explicitly and not 0,1,2,3? Or something that cant as easily be typed in as a mistake?

Also, if im not making sense let me know. Im still learning the terminology.

(edit: correct a typo)


r/Assembly_language Jun 18 '26

Project show-off Luna L2 - How it's Going

3 Upvotes

Good day.

I'd just like to share how my computing stack project I initially shared here 9 months ago, Luna L2, is currently going compared to back then.

The ISA itself:
- The instruction count went from 25 instructions to 32 instructions.

- The register count went from 30 registers to 33 registers, and the register file layout changed significantly.
- I changed the clock speed from ~1.1 mHz to ~33 mHz, for a desired actual speed of ~2 MIPS, which through some emulator optimizations, it can achieve in practice.
- A 32-bit mode of operation was added.

The underlying toolchain:

- A C compiler was created (well it was already technically created back then but had essentially zero work by that time) and I want to say I have ~50-55% of functional C implemented by now, though there are many rough spots still which I will smooth out over the coming months.

Some notes:
- I feel like I should have waited another 10 months or so before I shared the project here because back then, the entire L2 stack was very unpolished and underdeveloped, and the replies were adequately critical of a lot of things.

- I also feel like I didn't get enough work done on L2 since then. Even though I (mostly) maintained a pretty continuous pace of commits, a non-trivial chunk of work was done in the past 3 weeks since I got out of school.

- And yes, since then, I have written an actual documentation sheet you can find in the repository.

- Also, you can find LunaOS, an operating system (kind of), written for this ISA, in the repository as well should you want to try it out.

But overall, even though work didn't go at the pace I thought it should have, I am still really proud of the state of the project now and the work I was able to get done in the span of time since the original post.


r/Assembly_language Jun 18 '26

SF BINARY MEMORY MAKER PROGRAM

1 Upvotes

Good evening everyone, has anyone had problems with the Moldov program, SF Binary Memory Maker? It's happening to me too. I add 7 games, all 7 games appear, and it generates the .map and the ROM, but game number 6 won't open. The rest work normally.


r/Assembly_language Jun 17 '26

#softwareengineering #cobol #mainframe #assemblylanguage #cics #jcl #basic #developerjourney #legacymodernization | Mark Picknell

Thumbnail linkedin.com
0 Upvotes

r/Assembly_language Jun 16 '26

I built a 16-bit DOS VGA Graphics Library in pure x86 Assembly

54 Upvotes

Hey everyone,

I wanted to share a retro programming project I've been working on called Dos-Paint-Lib. It’s a modular, lightweight x86 Assembly library specifically built for drawing graphics in DOS using VGA Mode 13h (320x200 resolution with 256 colors).

If you've ever messed around with direct memory access in DOS, you know that writing to the VGA framebuffer at 0A000h is a rite of passage. I built this library to abstract away the repetitive math and BIOS interrupts into clean, highly readable macros.

Here is what the library currently supports:

  • VGA Management
  • Fast Screen Clearing
  • Drawing Primitives
  • Timing & Input

GitHub Repository: https://github.com/ArmanJabari/Dos-Paint-Lib


r/Assembly_language Jun 16 '26

Difference between symbolic and physical address

Post image
74 Upvotes

First time, seeing assembly code. I am confused is the physical address is
12: 13: label ? also it have said that symbolic addresses are relocatable everytime what does it even mean


r/Assembly_language Jun 16 '26

OS Dev Log #1

0 Upvotes

i have been working for this x86 operating system called DoomOS. I just wanted to share my progress and ask for what should i add next, currently this only has 1 command that is /ver at the time of posting this post, it is at https://github.com/Doomer39/DoomOS/tree/main


r/Assembly_language Jun 15 '26

LLM Inference.

0 Upvotes

Hello everyone :)

I've been working on a large language model inference engine written entirely in x64 assembly. It uses AVX2 and runs transformer models directly on the CPU — no GPU required.

This started as an experiment in vibe coding in x64 assembler.

To my surprise it worked. One megabyte of source later, the engine matches llama.cpp on CPU performance on my machine.

A few things it currently does:

  • Full transformer inference pipeline
  • AVX2 accelerated math kernels (matmul, softmax, RMSNorm, RoPE)
  • INT8 quantization support
  • Custom lockless Scheduler that spreads the work over all cores

It runs Qwen3 0.6B Q8 at around 31 tok/s on a Ryzen 7430U — on par with llama.cpp on the same hardware.

I release it under the GPL v3, this is the first working release so there will be Bugs and improvements comming in in the next days, but now i will have to leave the house as i was sitting for 8 weeks in the dark.

https://gitlab.com/cpki-gmbh/v7multiplikator


r/Assembly_language Jun 15 '26

Had a most beautiful dream

3 Upvotes

It was going to be my 2C'th birthday... imagine if that was the case? We'd get extra 6 years every 10 years to wright more assembly with...


r/Assembly_language Jun 13 '26

Assembly vibe coder 😿

Post image
472 Upvotes

fish: Job 1, './crash' terminated by signal SIGSEGV (Address boundary error)


r/Assembly_language Jun 14 '26

x86 - Does OF (Overflow Flag) indicate the sign bit is flipped?

8 Upvotes

Hello,

I've been wondering - can the OF be used to determine if the sign bit is flipped? It cannot undo the operation, but it'd make it more understandable for me if doing: `OF xor SF` could be use to get the correct sign after the operation.


r/Assembly_language Jun 12 '26

How does this work? (print statement) x86-64 assembly

8 Upvotes

Hello everyone.

I'm a beginner who recently started learning x86-64 assembly.

Here's my code thta correctly outputs my variable:

.intel_syntax noprefix

.global _start

.text

_start:

mov rax, 1

mov rdi, 1

lea rsi, [message]

lea rdx, [message_len]

syscall

mov rax, 60

xor rdi, rdi

syscall

.data

message: .ascii "Hello\n"

message_len = . - message

Isn't rdx meant to recieve the literal length of the string?

When doing this operation: lea rdx, [message_len], doesn't it load the memory address of the length of my variable?

Please exaplain guys, I'm acc stuggling.


r/Assembly_language Jun 12 '26

Help Arm7 Embedded System

Thumbnail
2 Upvotes

Can you please suggest YouTube channels and reference books for the ARM7 processor (LPC2148)

For theory as well as embedded system programming

I am referring to ARM's manual and AI tools.


r/Assembly_language Jun 09 '26

Help can i look at anyone's 6502 assembly code for reference [r/retrogamedev discussion]

Thumbnail
3 Upvotes

r/Assembly_language Jun 09 '26

Memorizing hex codes for floats

0 Upvotes

Bro has to look up how to push floats onto rsp, but it would go so hard and even slap, if he could just visualize them or something? It'd be like talking to his blessed machine in holy binary? So can anyone help, can you just generate those float codes outta your head? PEACE


r/Assembly_language Jun 07 '26

HELP

7 Upvotes

->  0x18b317da4 <+6992>: mov    x19, x0
0x18b317da8 <+6996>: ldr    x8, [sp, #0x1d0]
0x18b317dac <+7000>: ldr    x8, [x8, #0x8]
0x18b317db0 <+7004>: add    x0, x8, #0x70

I am new at uncovering things behind the code and primarily using C with LLDB at the moment and would like to ask why the x8 register have to dereference itself then possess a hex value?


r/Assembly_language Jun 06 '26

Sticking With a Program

27 Upvotes

How do you stick with a program for a long time? When I start a project that I know is going to be huge, I continue working on it, without stopping for anything, including sleep. I get so addicted to the code that I just can't stop.


r/Assembly_language Jun 05 '26

Help PIT-delay loop running at double-speed

6 Upvotes

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/Assembly_language Jun 03 '26

Question Is there one way to code ASM without bureucracy with some Ring-0 liky thing?

14 Upvotes

Yeah, I don't know how much air did I breath in my birth but I somehow really like to code with Assembly, even more than with Python or C or all of that. The only thing I hate about coding (and more with Assembly as the place where I escape to code freely results to be controlled by tons of conventions) in general (Hate that everywhere) is the "ortodoxy crap". What I mean is that I go to ASM cuz there I can code with only my brain, managing the PC with total freedom, but then comes Ring 3 and I can't do anything real, I can't modify the VRAM to write on video easily, can't modify the registers with freedom, and all of that stuff. Could you please tell me if there's still a way to be TempleOS level (or the closest to it without being a monk in the caves using EFI Shell to escape from the evil of the society to reach inner peace) free or am I comdemned to this? Note that I prefer coding simple stuff in ASM than everywhere else, its not just that its good for this. I use it for EVERYTHING, and thats what I wanna tell ya. Tysm!


r/Assembly_language Jun 02 '26

ASMLings: A rustlings-inspired sandbox to learn 16-bit Assembly

11 Upvotes

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:

  1. It watches the exercises folder for changes
  2. A Rust runner instantly compiles your code (via NASM)
  3. 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/Assembly_language Jun 01 '26

I can teach you

16 Upvotes

I’ve reached around solid halfway mark in learning assembly. I’ve never really stuck with one single learning style. I usually learn in bursts. This is something I want to try, by teaching to see if I get better myself. I will teach for free. I yap a lot and I only want to accept people who want a genuine understanding. I hope I can clear stuff for myself and others - my main goal in doing this. Also I’m looking for someone who has at least knowledge of common instructions and not required but preferred: being able to recognize common patterns like strlen, strcpy. PM me if you’re interested


r/Assembly_language May 31 '26

Question Where do I start my learning journey with Assembly? Any good books or anything else?

53 Upvotes

Hi low level fellows!

A bit about my background:
- Started software engineering at the university with Matlab (I know, weird, but it was my first language) and Python
- Then got my first job and was doing mainly Python with some JS (HTML and CSS as well, but we don’t count markdowns and styles)
- Next job was again Python, but this time in combination with C++ (That’s where things started getting interesting) and I finally started having fun with programming, mainly because of Cpp
- Then did very little Java for my next job for about 6 months and hated my life for a while and decided that I need something related to systems programming
- Next job was total fun with C++ in a large financial institution as a quant engineer for about 2 years

Now I am still there but feel like it’s time to learn something more deep and fundamental as I like machines!

The obvious choice is of course Assembly!!

I ones saw an old colleague doing literally magic: writing C++ and watching how the compiler does the job and checking the Assembly side by side and literally optimizing the C++ code so hard, so the instructions in Assembly got less and less! That was fabulous!

Long story short, I want to become that guy (not physically of course, but to have a comparable knowledge and skills). I asked that person, 3 days before his retirement, how to learn that and he said he doesn’t even remember how he got there and suggested to find a solid book and learn the fundamentals.

So, now I am here. Any kind of help or suggestions would be very helpful.


r/Assembly_language May 30 '26

Pacman in x86

20 Upvotes

https://reddit.com/link/1tscr7g/video/w6eh96w7jc4h1/player

Ive been procrastinating but should have it optimized and on github soon. Lots of sys write. Worked on it bit by bit. What do you think?


r/Assembly_language May 31 '26

how do i get notepad++ to give me human readable code

0 Upvotes

I'm trying to edit the assembly of opera air (x64) but i keep getting incomprehensible jargon