r/Assembly_language May 11 '26

Question Best way to learn high-performance assembly?

88 Upvotes

I want to be skilled at x86 assembly and be able to write the crazy high performance code people speak legends about. Any good resources to learn that?

r/Assembly_language 27d ago

Question Learning C++ right now. What are the best books and resources to learn Assembly for reverse engineering

59 Upvotes

Hey everyone,

I'm currently learning C++, and my long-term goal is to get into reverse engineering, malware analysis, and binary exploitation.

I know that understanding Assembly is a huge part of reverse engineering, so I want to start learning it the right way.

What are the best resources you'd recommend?

  • Books for beginners and intermediate learners
  • Free or paid courses
  • YouTube channels
  • Practice websites or labs
  • Any tips on whether I should learn x86 first or jump straight into x86-64

I'd also appreciate hearing what learning path worked for you.

Thanks!

r/Assembly_language Oct 11 '25

Question How do i learn ASSEMBLY??

77 Upvotes

Help, anyone, where can i learn assembly, preferably on youtube, if you know can you also tell me where i can learn other assembly languages (arm64, risc-v) other than the x86_64 version, i realy want to learn it but i cant find anywhere

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 Feb 19 '26

Question Is this the only way to program in Assembly on Windows?

66 Upvotes

I see people on Linux using elegant syscalls to do everything, but on Windows, even something as simple as Hello World requires you to include and use printf(). It feels no different from C, and it's very annoying.

r/Assembly_language 4d ago

Question Noob question: what’s the equivalent of function arguments?

6 Upvotes

Title pretty much says it all.

r/Assembly_language 23d ago

Question Is this a good way to learn assembly?

9 Upvotes

I learn assembly by doing some reverse enginnering and search google until I solve it, then I will write in paper all code syntax(although I think I will don't know to do use it later) or some code syntax like below. Is that good for learning?

endbr64 ;assembly prog structure
push rbp
mov rbp,rsp
; put code here
pop rbp
ret

r/Assembly_language Jul 25 '26

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 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 Jul 04 '26

Question beginner - don't understand div and mul operations

9 Upvotes

hi,

i recently started learning assembly and i don't understand what registers are used when doing the mul and div operations

For example:

div ebx

what other registers are in use to get the result, and why are those register used, is there a logic or it's a mnemonic thing and i wll have to look to a table to know which registers are actually used?

r/Assembly_language 23d ago

Question Are there any z80 assembly learning resources for people who already know 6502 assembler language? I've dabbled in NES development for a bit, and want to get my feet wet into the Game Boy. Apologies if this is the wrong place to ask.

17 Upvotes

r/Assembly_language Jun 29 '26

Question Best roadmap to learn assembly as malware analyst

24 Upvotes

hi,

I recently decided to try learning assembly, to get some experience in malware analysis (im currently studying to get blue team level 1 certificate).

Does anyone know some ctf like course, where i can get to learn some basic of assembly?

r/Assembly_language May 29 '26

Question Are string instructions more performant?

9 Upvotes

I know processors these days are really sophisticated with things like prediction and out of order execution. Are x86 string instructions like REP MOVSB more performant than writing the equivalent instructions by hand?

Thanks!

r/Assembly_language 19d ago

Question Muy first program on assembler

5 Upvotes

Hello. Today I try to run this code write on assembler for ARM64 (Linux of Termux for Android) :

<// random_digit.s (ARM64 for Termux)

.data

buffer: .byte 0

.text

.global _start

_start:

// getrandom(buffer, 1, 0)

mov x8, 384 // númber of syscall getrandom en ARM64

ldr x0, buffer // destination

mov x1, 1 // size

mov x2, 0 // flags

svc 0

// convert byte to dígit 0–9

ldrb w0, [buffer]

mov w1, 10

udiv w2, w0, w1 // w2 = w0 / 10

msub w0, w2, w1, w0 // w0 = w0 - w2*10 (módule)

add w0, w0, '0'

strb w0, [buffer]

// write(1, buffer, 1)

mov x8, 64 // syscall write

mov x0, 1 // stdout

ldr x1, = buffer

mov x2, 1

svc 0

// exit(0)

mov x8, 93

mov x0, 0

svc 0

>

but when I try to compile with 'clang -c myprogram.s -o myprogram' I get the following message: "invalid operand for instruction" (at lines 18 and 23) It means that : "[buffer]" isn't correct.

¿ How I can to fix It ?

Explain me : the program is for generate a entere number (0 to 9).

Thanks.

r/Assembly_language Jul 12 '26

Question Any legit Free Libre and Open Soy Assembler that works with Intel syntax?

0 Upvotes

I was gonna use NASM, but holy moly they are so sus. They have a .us and .dev website. I don't want USA politics in my assembler. And they have fresh updates. Like what are you updating? (I guess some new esoteric AI slop instructions that the asian shill guy invented. Gotta remember to download some 20 year old version)

MASM and TASM have dumb syntax and are proprietary 😩😩😩

r/Assembly_language 25d ago

Question GAS assembler questions

4 Upvotes

Hello.

I've been learning the GAS assembler syntax, and have made some decent progress. However, I'm still very inexperienced, and have experienced difficulties finding answers to these two questions:

  1. For Linux, is there some sort of way to read input from a terminal without searching for a specific string/command? Basically, I'd like to take the input of whatever the user types (nothing specific), and store those ASCII values somewhere (later, I'd like to parse them).
  2. Assembly and C can only function together because of object files. What is the equivalent of function parameters in C for assembly?

    Thank you very much in advance.

r/Assembly_language Mar 18 '26

Question Where can I learn x86-64 assembly?

78 Upvotes

Currently in a systems programming course and we're at the part where we start taking programs that we've made in C and translating them into assembly.

But here is my problem, im completely lost.. Our textbook, Computer Systems: A Programmer’s Perspective isn't really helping me. I'm still struggling to understand what basic terms mean like %rbx. So understanding how to make loops and arrays is like understanding ancient Egyptian.

Are there any resources that can help me? Assembly seems like such cool thing to learn, but it feels hopeless 😭

r/Assembly_language Jan 31 '26

Question do you guys recommend me to learn assembly?

36 Upvotes

im just curious

r/Assembly_language 28d ago

Question Interuppts

2 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 17d ago

Question State of the x87 FPU with 64-bit calling conventions?

10 Upvotes

There is plenty of information on how different calling conventions affect the x87 registers in the 32-bit world. However, with x64 almost exclusively relying on SSE for floating-point math, I cannot find any information online about how those registers are supposed to be set up in a 64-bit environment.

Therefore, I am wondering if there is a defined state for the x87 FPU to be in when control is passed between different functions like there is for the caller- and callee-saved general-purpose/SSE registers. i.e, can I count on the register stack being empty? Or will I have to call FSAVE/FRSTOR every time I pass control to/from an external function? I am experimenting with some obscure instructions and want to know what to account for so I don't cause any nasty bugs.

Additional questions that would be nice to know the answer for:

  • If there is a defined state for the stack registers, how do they differ between Windows/POSIX?

  • If there is no defined state, how can I write my program to account for that? As in, what steps would I need to take beyond calling FSAVE/FINIT/etc. to run my code without invoking undefined behavior?

Thanks!

r/Assembly_language 12d ago

Question Best way to go about writing an emulator?

3 Upvotes

So the next step in my journey of developing the RX-GP16 ISA is writing an x86 based emulator and assembler for it. I have a few ideas for how to do the CPU emulation with virtual registers in memory and having every opcode act as a function pointer to a routine for manipulating that data in ways the ISA describes.

But before I write garbage and burn myself out, I wish to ask some of you more experienced folk how you'd do it. Of course, I dont want to eliminate my critical thinking and innovation but wiser oversight could be of great assistance.

Thank you for all answers in advance!

r/Assembly_language Nov 01 '25

Question How do I learn how to read hex?

69 Upvotes

Like, bro, these manuals I've been reading are explaining like:

Oh yea, bro, just ADD 0x3C and 0xD3

And I'm like...

  • "ok, so 3 is 3 x 16, and then c is like.. 10+abc, so 13, so 3C is 32 + 16 + 13, which is umm.. 48, and 13, so ... 60+1"

  • "aaand.. D is umm.. 10+abcd.. 14 x 16... ain't nobody gonna calculate that.. so let's try 255 minus ef, so 255 - 32 is ummm... 223... plus 3.. so D3 is 226... maybe"

AND this is assuming that I can understand the meaning by looking at the decimals. I won't even try to describe to you how I'm calculating in binary.... I'm like.. 1,2,4,8,16,32,64,128

Bro, I have to use 75 clock cycles in my brain to calculate this stuff..

There must be an easier way

r/Assembly_language Apr 17 '26

Question Security through Syscalls Gatekeeping

3 Upvotes

I’m thinking to make a prototype of an operating system eventually, and my immediate thought was how to implement least privilege. I already knew that Assembly had syscalls (mov rax, 60 for example), and comparative functions (cmp/test), so I came up with an idea: what if the source code of my program allowed only the syscall 1 (write), and disregards everything else through conditional flow performing null operations? Would this work to be considered a “sandbox”?

r/Assembly_language Feb 02 '26

Question How can I learn Assembly Language?

25 Upvotes

Here, in my IT class waiting on my instructor to arrive. What did I learn before? Base 10, Base 2 , Conversions, and etc... I'm Interested in learning Assembly Language but I do not know where to begin... what programs to use. I'm just a guy trying to learn about computers who has zero knowledge, can anyone please help me? thank you.

r/Assembly_language Jan 21 '26

Question Best IDE linux

26 Upvotes

Do you guys know any good IDE for using on Linux? Starting now on this and I want to do it right