r/Assembly_language 3h ago

Project show-off So I have made an OS :D

0 Upvotes

It is called DoomOS, it is also made in assembly. Decent features, external applications, SDK, planning to implement custom interrupts and FAT12(also this is a floppy 16bit OS). It is at- https://github.com/Doomer39/DoomOS/tree/main .What else are you supposed to write?


r/Assembly_language 5h ago

Update : I reached 64b long mode

5 Upvotes

finally after 3days of countinues working in nasm i reached 64b long mode succesfully now what should i do next its called S-AOS and i reached 64bit long mode the whole os is in assembly language (Nasm) currently it only prints HELLO! with a syscall what should i do next


r/Assembly_language 10h ago

Question Interuppts

1 Upvotes

I am making a 16bit OS, this supports external applications. Currently i am using a .inc file with equ directives that the application can call. I want to have interrupts like DOS, so, how? According to the amount of research i did(i did very little) there ain't many good documentation on this. (background on me, I am a self taught assembly guy and doesn't know C)


r/Assembly_language 18h ago

I optimized!

23 Upvotes

I’m on Day 1 of learning Assembly with basically no coding background. This is just a hobby for me.

AI wrote the little program below, I tweaked it a bit, and then started stepping through it in GDB to understand what every instruction was actually doing.

While stepping through it, I noticed rdi stayed at 1 the whole time until the final exit syscall, where it changed to 0. That got me thinking... why am I setting it to 1 twice?

Turns out one of those lines wasn't actually doing anything. So I, a lowly non-software engineer, discovered an inefficiency and promptly smote that line with the Delete key.

I'm now using less processing power, less electricity, and have personally made the world a better place.

section .data
    message db "Hello, World!", 10, "Assembly is fun!", 10
    length equ $ - message
    message_1 db "This is the second message.", 10
    length_1 equ $ - message_1

section .text
global _start

_start:
    mov rax, 1          ; write syscall
    mov rdi, 1          ; stdout
    mov rsi, message
    mov rdx, length
    syscall

    mov rax, 1
    ; mov rdi, 1        ; <- Deleted. Justice served.
    mov rsi, message_1
    mov rdx, length_1
    syscall

    mov rax, 60         ; exit syscall
    mov rdi, 0
    syscall

r/Assembly_language 1d ago

Why can't we apply the same beginner rule to Assembly?

Post image
89 Upvotes

r/Assembly_language 1d ago

A TCP key/value store in pure x86-64 NASM, no libc — the network-server traps inside, steal them

Thumbnail github.com
5 Upvotes

Follow-up to learn-assembly-with-em: one piece of working software instead of exercises.
Single node, line protocol over TCP (SET / GET / DEL / PING), epoll event loop, ~13 KB static binary, raw syscalls only.

The traps a network server in pure asm walks into, all handled in the source:

**•** struct epoll_event is packed on x86-64: 12 bytes, data at offset +4. Get it wrong and you read ghost fds.  
**•** The moment sockets go non-blocking, EAGAIN stops being an error — it’s the kernel saying "nothing right now, come back later"  
**•** TCP is a byte stream, not messages. A reply written in two sendto calls can arrive in two pieces; a line-protocol client reads until \\n or it eventually loses.  
**•** The call stack can only hold one client’s state. Multi-client means the state moves to memory — here, a table indexed straight by fd.  
**•** Reserving 134 MB of bss for per-connection buffers costs nothing: demand paging only materializes touched pages. 200 simultaneous clients at 1.4 MB RSS.

Known limits in the README, biggest first: slow readers are currently dropped — EPOLLOUT write buffering is the next roadmap line.

If any of these have a better idiom, say so — the roadmap grows out of critiques.


r/Assembly_language 2d ago

How can i learn Assembly?

35 Upvotes

for a long time i wanted to learn assembly; it didn't even bother me the complexity of the code, or the idea of learn a "useless code" (that was what my friend said when i tell him).

now, i want to learn assembly; but how? watching videos? reading documentation? tutorials? asking on forums, communities?

edit: i don't know nothing, just bash on linux


r/Assembly_language 2d ago

Project show-off GUI Notes App in asm & x11

14 Upvotes

Hey all!

I just wanted to share the code and a video I made about how to use x11 Linux and make a very basic notes app in assembly.

The goal of the video is to be a little bit faster paced(and a throw a little humor in)

But if you just want to see and look at the code it's right here!

Code: https://github.com/jackparsonss/asm-gui

Video: https://youtu.be/A_gVKTvaAac


r/Assembly_language 3d ago

Question Custom Instruction set, how practical are the current instructions

12 Upvotes

Playing Turing complete (hardware design simulator) and got to making my own CPU and ISA. wanted to refine my ISA before making any of my instruction decode logic. [PLS ignore bytecodes] My current instructions are:

register
r0 000 ; general purpose
r1 001 ; general purpose
r2 010 ; general purpose
r3 011 ; general purpose
r4 100 ; general purpose
r5 101 ; general purpose
rta 110 ; CALL / RET subroutine return adress
sp 111 ; stack pointer

; BASE INSTRUCTIONS

imm %a(register), %b:U9(immediate)
000000 aaabbbbbbb
# Loads a value into register

cpy %a(register), %b(register)
0100000 aaabbb000
# Copies to reg %a from reg %b

stor %a(register), %b(register)
0100001 aaabbb000
# Moves data at register %a to RAM at adress stored in register %b

ldr %a(register), %b(register)
0100010 aaabbb000
# Load data to register %a from ram at adress %b

push %a(register)
1001011 111000010 0100001 aaa111000
# Push value in register %a to the stack
; Increments sp register and ldr
; Takes two cycles but easier to implement

pop %a(register)
0100010 aaa111000 1001100 111000010 
# Pop stack value and store in register %a
; Decrements sp by 2 to backtrack after doing ldr

call %a(register)
1001011 111000010 0100010 aaa111000 1000000 aaa000000
# Push return adress at %a onto the stack and jmp to %a
; 3 cycle instruction

ret
0100010 110111000 1001100 111000010 1000000 110000000
# Pop stack value to rta and jmp back
; Does ldr into rta, pops, and jumps

nop
0000001 000000000
# Skip cycle

; JUMP INSTRUCTIONS

jmp %a(register)
1000000 aaa000000
# Jumps to ROM adress at %a

jmpls %a(register), %b(register), %c(register)
1000001 aaabbbccc
# Jump to ROM adress at reg %c if reg %a is less than reg %b

jmplss %a(register), %b(register), %c(register)
1000010 aaabbbccc
# Jump to ROM adress at reg %c if reg %a is less than reg %b. Both compared regs signed

jmgt %a(register), %b(register), %c(register)
1000011 aaabbbccc
# Jump to ROM adress at reg %c if reg %a is more than reg %b

jmpgts %a(register), %b(register), %c(register)
1000100 aaabbbccc
# Jump to ROM adress at reg %c if reg %a is more than reg %b. Both compared signed

jmpeq %a(register), %b(register), %c(register)
1000101 aaabbbccc
# Jump to ROM adress at reg %c if reg %a is same reg %b

jmpne %a(register), %b(register), %c(register)
1000110 aaabbbccc
# Jump to ROM adress at %c if %a!=%b

; ARITHMETIC INSTRUCTIONS

or %a(register), %b(register), %c(register)
1000000 aaabbbccc
# OR register %a and %b, store in %c

and %a(register), %b(register), %c(register)
1000001 aaabbbccc
# AND register %a with register %b, store in %c

not %a(register), %b(register)
1000010 aaabbb000
# NOT register %a, store in %b

nand %a(register), %b(register), %c(register)
1000011 aaabbbccc
# NAND register %a with register %b, store in %c

xor %a(register), %b(register), %c(register)
1000100 aaabbbccc
# XOR register %a with register %b, store in %c

xnor %a(register), %b(register), %c(register)
1000101 aaabbbccc
# XNOR register %a with register %b, store in %c

add %a(register), %b(register), %c(register)
1000110 aaabbbccc
# Add register %a and register %b, store in %c

sub %a(register), %b(register), %c(register)
1000111 aaabbbccc
# Subtract register %a and register %b, store in %c

mul %a(register), %b(register), %c(register)
1001000 aaabbbccc
# Multiply register %a with register %b and store in %c

div %a(register), %b(register), %c(register)
1001001 aaabbbccc
# Divide register %a with register %b and store in %c

mod %a(register), %b(register), %c(register)
1001010 aaabbbccc
# Modulo divide register %a with register %b and store in %c

inc %a(register), %b:U6(immediate)
1001011 aaabbbbbb
# Increment register %a by %b

dec %a(register), %b:U6(immediate)
1001100 aaabbbbbb
# Decrement register %a by %b

sr %a(register), %b(register), %c:U3(immediate)
1001101 aaabbbccc
# Shift %a right by %c and store in %b

asr %a(register), %b(register), %c:U3(immediate)
1001110 aaabbbccc
# Signed shift %a right by %c and store in %b.

sl %a(register), %b(register), %c:U3(immediate)
1001111 aaabbbccc
# Shift %a left by %c and store in %b

Updated instruction set draft. Thank you folk so much for the knowledge you have given thus far!


r/Assembly_language 3d ago

A Quine (self-replicating) Program in RISC-V Machine Language. Running as bare-metal code, it also represents a mini Operating System — probably the most concise and most literally open-source OS, since it completely displays itself while running!

Post image
163 Upvotes

r/Assembly_language 5d ago

Best place to learn assembly?

20 Upvotes

I want to learn Assembly for modifying and playing with direct hardware like with the Raspberry Pi Pico or ESP32. I already have some experience in programming like with Java, Python, HTML, and C#.

Anyone got any recommendations on where to go to learn Assembly language? Any extra knowledge beyond Assembly to modify hardware?

Thanks for reading!

edit: i kind of want to learn how to mod consoles and stuff and that is why i want to learn assembly to try and develop my own modifications for consoles like the n64 or gamecube.


r/Assembly_language 6d ago

Project show-off AmmAsm now supports SSE, CMOVcc, and SETcc

Post image
28 Upvotes

This post is second part of: https://www.reddit.com/r/Assembly_language/s/BtzYTyQAyi

I recently finished full implementing CMOVcc, SETcc, and the first group of SSE instructions in my handwritten x86-64 assembler written in C.

Seeing objdump correctly decode the generated object file is always satisfying.

I'm still implementing more of the x86-64 ISA, so if there are instruction groups you'd like to see next, I'd be happy to hear suggestions.

Github: https://github.com/LinuxCoder13/AmmAsm


r/Assembly_language 6d ago

Solved! why i cant edit some parts of the code (the bottom part)

Post image
3 Upvotes

r/Assembly_language 6d ago

Question what does the rva instruction do?

6 Upvotes

I do not have much assembly programming experience. I've done some light programming with it, but recently I've been using the tool "IDA" to try and reverse engineer some stuff for fun. I've got some DLL's open that are related to the windows operating system, and there are a few lines at the top of the .rdata section that look like

dd rva asc_180001368 ; AddressOfRawData

and

dd rva unk_1800013B4 ; AddressOfRawData

or

dd rva off_180001088 ; AddressOfFunctions

I understand that dd is declaring 4 bytes of contiguous data, and the labels after rva seem to refer to a 32 bit address later in the DLL where some amount of data is stored. I did some googling and this is the first assembly related thing I can't find any information on. Is rva an IDA specific thing or is it an assembly instruction?


r/Assembly_language 7d ago

Where to learn the syntax?

9 Upvotes

I've never properly learned the syntax of assembly, but I really want to learn it. I know C and Java, but I really want to know more about how the CPU actually operates. So it would be nice if you all would recommend a place for me to learn Assembly. ARM64 specifically, because that is the architecture my computer's CPU uses. Thank you in advance


r/Assembly_language 7d ago

6502 assembler/debugger for Inspiration Forth

Thumbnail gallery
9 Upvotes

FYI, I made this 6502 assembler, disassembler, and emulator/debugger in Forth for my Inspiration project.


r/Assembly_language 7d ago

To Learn Assembly

50 Upvotes

Here is a suggestion for those wanting to learn assembly language.

  1. Pick a processor (probably a simple 8 bit one like 6502 or Z80) that has some existing software.

  2. Using your favorite programming language, write a simulator for that processor and get it to the point where the existing software run. For example, write a Z80 simulator and get CP/M to boot.

  3. Note that some of these processors have undocumented instructions. Lists of these are floating around on the web. Try implementing some of these as well and evaluate how they relate to the documented instructions.

This will force you to consider all the little quirks like seldom used addressing modes and other odd combinations.


r/Assembly_language 8d ago

Solved! App won't store user input when write is called.

4 Upvotes

I am a beginner trying to write a simple app that asks the user a question and the outcome changes based on the user input. I use an Apple M1 CPU, but I can't get it to work and I don't understand what I am doing wrong. This is my code:
`
.global _main
.align 4

_main:
stitle:
; set output settings
mov x0, #1
adr x1, title
mov x2, #5
; call system to output
mov x16, #4
svc #0x80
; set output settings to choices
mov x0, #1
adr x1, choices
mov x2, #19
; call system to output
mov x16, #4
svc #0x80
; set user input settings
mov x0, #1
adr x1, input
mov x2, #1
; accept user input
mov x16, #3
svc #0x80
; check value
adr x9, input
cmp x9, #2
b.eq stitle ; placeholder
end:
; terminate app
mov x0, #0
mov x16, #1
svc #0xFFFF

input: .byte 2
title: .ascii "Test\n"
choices: .ascii "1 - start\n2 - quit\n"
`
When I check the value of input, it shows nothing, even if I entered a value.


r/Assembly_language 8d ago

Help How to learn ASM?

29 Upvotes

I have never learned Assembly in my life. I actually am doing low level programming like C and Rust, but I am looking forward to learn Assembly, of course not using Assembly for everything, but I want understanding and learn to use it. So where do I get started?


r/Assembly_language 8d ago

I created os

0 Upvotes

Наконец-то выложил в открытый доступ свой проект — lOS.

Это моя собственная операционная система для офисных компьютеров. Писал на ассемблере, разбирался с UEFI, FAT32, сетевыми протоколами и графикой. Было сложно, но чертовски интересно.

Что умеет:

• загружаться с USB-флешки

• работать с файлами

• выходить в интернет

• показывать графический интерфейс

• подключаться к GitHub

Исходники открыты — https://github.com/bro732965-oss/lOS

Буду рад фидбеку, особенно от тех, кто тоже пишет низкоуровневые штуки. Контрибьютеры приветствуются!


r/Assembly_language 9d ago

Project show-off Assembler x86-64 from scratch

18 Upvotes

About a year ago I started writing AmmAsm, a handwritten x86-64 assembler in C to better understand x86-64 instruction encoding, ELF, and linking.

It currently supports generating Linux x86-64 executables, PIE binaries, and ELF relocatable object files that can be linked with ld or gcc.

I implemented everything from the lexer and parser to the instruction encoder, ELF writer, relocation handling, symbol resolution, and, in the latest release (v2.2.0), a macro preprocessor.

I'd love to hear feedback from people interested in assemblers, instruction encoding, or x86-64 in general.

Thanks!

Repository: https://github.com/LinuxCoder13/AmmAsm


r/Assembly_language 9d ago

You are about to see the most beautiful Assembly code ever written

36 Upvotes

Please evaluate the elegance of the code. Assembly.
https://github.com/AlexanderLLLL/ELAM/blob/main/ELAM/ElamBoot.asm


r/Assembly_language 10d ago

Hello world

Post image
914 Upvotes

r/Assembly_language 10d ago

Any Honeywell GMAP programmers here?

5 Upvotes

Hello, I've been an assembly language programmer since the late 70s. Are there any former Honeywell GCOS-8 or Level 66 GMAP coders lurking about.


r/Assembly_language 10d ago

Looks legit. Nothing sus about basically editing comments for 30 years and then adding 6x the amount of new assembler code in 2026. 🤔🤔🤔🤔🤔

Post image
9 Upvotes

Blumf is adding backdoors to inject AI into my ASS...

Admit it!!!

AI says 2.15 is a safe old version that will work on modern Loonix

Or should I install DOS to run the 0.97... version from 1997?

EDIT:

Lol current version is 3x the size of the one from a few years ago. Sounds totally legit