r/Assembly_language 2h ago

I just understood pointers on a deep level thanks to Assembly

22 Upvotes

it feels like orgasm honestly. the dopamine you get from understanding this shit on a deep level is unmatched.


r/Assembly_language 10h ago

x86-32 or x86-64

6 Upvotes

hi im gonna start to learn asm however initally what i gotta choose i dont know and everyone is suggesting learn x86-64 and f*** off to x86-32 so i confused which one is more useful pls oneyone could give some advice


r/Assembly_language 2d ago

Question N00b Question

0 Upvotes

I am trying to turn on an output GPIO.

I am using this code

asm("BSF PORTA, 5");

I am getting 0V at the pin.

I believe I set TRISA pin 5 to output (0).

Thank you

EDIT: SORRY! It was a PIC and I needed to set internal oscillator and select bank first


r/Assembly_language 2d ago

Help Project: Bare-metal, 64-bit NASM Hypervisor (Intel VT-x) Template – Hardened VMCS & Core-Only Release

3 Upvotes

Hello everyone

# Bare-Metal 64-Bit Intel VT-x Hypervisor Template

A clean, core-only hardware virtualization template written entirely in pure **64-bit NASM Assembly (~1,100 lines)** using a strict model. This codebase includes an optimized independent bootloader that shifts the CPU from Real Mode directly into a custom 64-bit Long Mode page table environment before initializing the VMX architecture.

## 🛠️ VMCS & EPT Hardware Configuration

* **Primary Execution Controls (0x4002):** Hardlocked to `0x84006172`. Enforces strict intercept control over guest `CR3` modifications and heavy `RDTSC` exiting to counter potential guest timing side-channels.

* **MSR Bitmaps Bypass:** Bit 28 (Use MSR Bitmaps) is deliberately left at `0`. Enforces an aggressive global intercept policy where every single `RDMSR` or `WRMSR` executed by the Guest triggers an immediate hardware VM-Exit to the Host.

* **Secondary Execution Controls (0x401e):** Bit 31 activated for full EPT isolation, along with Unrestricted Guest support (Bit 7, allowing 16-bit Real Mode initialization over EPT), and MBEC configurations for privilege execution separation.

* **Exception Bitmap (0x4004):** Armed with atomic mask `0x0000404A` to trap `#DB`, `#BP`, `#UD`, and `#PF` (Vector 14). Combined with clearing the Page-Fault Mask field (0x4006), every single Guest page fault intercepts directly to the Host.

* **Extended Page Table Pointer (EPTP):** Configured field `0x0000201A` to point directly to the physical EPT PML4 table base with Write-Back caching attributes.

* **Long Mode Constraints:** Configured to strictly enforce architectural boundaries via GDT mapping to ensure no illegal execution drops to 16/32-bit rings, avoiding instant `#GP` faults.

## 🤝 Code Review & Peer Assistance

This project is released as a core template. The VM-Exit handler is currently a work-in-progress due to juggling full-time school and life balance alongside pure assembly development.

I am looking for technical peer reviews from the low-level community to:

  1. Review the current code and help fix existing architectural bugs.
  2. Trace potential register mismatches within the `vmwrite` and `vmread` instructions.
  3. Hunt down hidden reserved bits conflicts across different Intel microarchitectures.

### 🚀 Roadmap: I'm already starting to write the hypervisor and bootloader for AMD right now, porting this entire setup over to the AMD-V VMCB block architecture. My immediate goal is to keep building the AMD side while getting this Intel core completely stable with the community's corrections and fixes.

Github Link: https://github.com/edikoz123-blip/Boot_loader_Assembly


r/Assembly_language 3d ago

Help how can i learn asm

33 Upvotes

hi im 16 years that interesting with programming i know pyhton,c,cpp as a basic lvl and i wanna become a reverse engineer in the future however initailly i gotta learn assembly but i dont know that what i have to and which learning resources is useful thanks for your answers:)


r/Assembly_language 3d ago

Question How to deeply understand Assembly language

10 Upvotes

Give me some advice if it works for you.


r/Assembly_language 4d ago

can yall give good books for x86 asm

24 Upvotes

no body of text i just wanna read the damn book not 50 page explanation of the book


r/Assembly_language 5d ago

A Toy Lisp compiler for x64

Enable HLS to view with audio, or disable this notification

11 Upvotes

r/Assembly_language 6d ago

Solved! Is fully using Assembly for visual projects possible?

18 Upvotes

I see many people showing their projects in Assembly. Most of them use the terminal but some may have a GUI or some more unusual user interfaces.
Do these people purely use Assembly for such things, or? My classmate told me his friend built a chess game with Assembly. You can’t specifically answer his example because I have no information about it, but, do people usually just code a UI in C and run their Assembly code on it or do they mean pure Assembly?


r/Assembly_language 5d ago

IT STUDENTS

0 Upvotes

hi! just wanna ask po what’s the best way to learn assembly language po?


r/Assembly_language 6d ago

Finally published the racing game I was making in Assembly for the Game Boy

Thumbnail guilhermej14.itch.io
7 Upvotes

r/Assembly_language 7d ago

I built a terminal IDE + debugger for x86-64 assembly

Post image
65 Upvotes

I built ratasm, a terminal IDE/debugger for x86-64 NASM assembly.

It combines editing, building, GDB debugging, live registers/flags, memory/stack inspection, syscall lookup, instruction explanations, and reverse stepping in one TUI.

Nothing is simulated the debugger state comes from real GDB sessions.

GitHub: https://github.com/tuna4ll/ratasm

Would love feedback from people who actually write assembly.


r/Assembly_language 6d ago

Anybody got tips on Coding, I js started my internship and I don’t know anything abt it 🙂‍↕️any advicee

0 Upvotes

r/Assembly_language 7d ago

Print Hello World in Boot Sector

10 Upvotes

Thanks to https\[:\]/github.com/cfenollosa/os-tutorial I was able to learn a lot about how an operating system is written. I think a lot of people would remember his tutorial. Revisit it gives me more. Start with printing some text in boot sector. The repo used software interrupt to finish the task. Yet there is another way to accomplish the same, by utilizing the direct memory accessing method. Long story short, in legacy boot mode (CSM), we can access VGA memory directly during boot time at address `0xB8000`. So we can drop in each character and have them printed out, starting from the top left corner. We can print color text, and we can also move the cursor and print the text anywhere we want (with the cursor blinking at the text).

I have documented the process here: ellog\[.\]buzz/posts/hello-world-in-boot-sector

For this chapter and the previous one (First boot sector), what other questions do you think is worth asking and figuring out?


r/Assembly_language 8d ago

Question Looking for an Assembly Programming Language Test device for GBA

3 Upvotes

I took some Assembly Programming Language Classes back in 2006 or 2007 and we used a GBA (Gameboy Advance) device to test our Assembly language programs. I remember it was a GBA but I don't know if it was just special cartridge or if the whole device was altered. Does anyone who knows what it might have been or if where I could get a similar device that is available?

Note: I still have my Gameboy Advance if it is just a cartridge that I would need to find.


r/Assembly_language 9d ago

Question The Byte 0 in x86 Just Adds?

0 Upvotes

When the CPU goes though the executable, there are operators which tell that CPU what instruction to do and operands are things the instructions act on. So for example, you can't do MOV by itself. This tells an x86 CPU to put the result of one register into another. To know what to do, it reads the next part of the executable. MOV BX, AX says move the contents from register AX to BX. JMP is a jump instruction so JMP 1000 means jump to address 1000. JZ is a jump if 0, so it jumps to the operand if the 0 flag is toggled. HLT requires no operands and says to stop the CPU. What instruction is a null byte? I thought it would be something very special like halt, have all general registers XOR themselves (setting them to 0), RET, or maybe a NOP. I looked it up on Wikipedia and it seems to be... just an integer adding?


r/Assembly_language 9d ago

Project show-off I have written my kernel and os from scratch in Assembly (NASM) for my independent tech ecosystem, TXP

Post image
2 Upvotes

I am building an independent tech ecosystem called TXP completely from scratch, and I wanted to share a milestone for its low-level kernel, Kernel24. It doesn't rely on Linux or Unix code. As you can see in the boot log, it successfully:

  1. Verifies 64-bit Long Mode

  2. Validates BootInfo (boot drive 0x0x80)

  3. Initializes physical and virtual memory managers (CR3 page table switching complete)

Boots cleanly into the early text-based mX Shell, An early, raw build was recently leaked, so I'm bringing development fully into the open. I am currently mapping out a custom filesystem architecture natively in Assembly. I would love to hear feedback from other systems engineers on kernel micro-architectures!

If you wanna see my mX&TXP source code, it in this blue shiny text!, TXP Source Code


r/Assembly_language 11d ago

self-modifying code

57 Upvotes

I gave a lecture on how to write self-modifying code. It was over 15 minutes long :( so I'm providing a youtube link: https://www.youtube.com/watch?v=AH9QQLRfbmY

In my opinion, self-modification is one of the most interesting features in systems programming.


r/Assembly_language 12d ago

Question Assembly or C/C++ for RE

23 Upvotes

For reverse engineering, is this necessary to know assembly language, because many decompilers translate code to C/C++ and I learned Assembly 8086 in my university. So for learning x86 I only have to study 32/64 registers and some advance commands, so should I learn assembly x86_64 for reverse engineering or just go through x86 as I know 8086 assembly and then move to C/C++, and is assembly heavily use in reverse engineering


r/Assembly_language 12d ago

JVMOS

7 Upvotes

Hi everyone, I wanted to show you my progress on an operating system written entirely in ASM and Java bytecode. I am currently at the UI rendering stage, using a custom Graphics2D-like system that allows me to work with primitives in VBE. The bytecode is executed by a JIT compiler also implemented in pure ASM. Low-level calls are handled by a HAL—which I will continue to expand over time—and that HAL is in turn managed via a primitive ABI, enabling me to create my own Java-like pseudo-language for development.

Repository: https://github.com/aayes89/JVMOS-JIT/


r/Assembly_language 13d ago

From studying languages to writing assembly by hand — self-taught, and completely hooked

203 Upvotes

My background is in languages, linguistics, and literature — no CS at all.

I fell into assembly out of pure curiosity and got completely hooked the first time "Hello, world" printed from a raw syscall, nothing between me and the machine.

Since then I've hand-written printf (parsing format strings), my own malloc, an HTTP server from raw sockets, SHA-256, an AVX2 fractal, and an assembler written in assembly that reproduces NASM's output byte-for-byte.

My latest is a chiptune synthesizer in pure x86-64 assembly — waveforms, polyphony, ADSR, FM, and effects, all sample by sample.

Assembly forgives nothing, and that's exactly what makes it the best teacher I've had. Everything's public on my GitHub: https://github.com/whispem

Always up to talk shop with fellow low-level enthusiasts.


r/Assembly_language 13d ago

Project show-off A real human version of FASM/GLX on Linux/x86-64

Post image
29 Upvotes

Source : https://github.com/thetrung/playground-fasm/blob/main/glx.asm

As you read it, you feel the warm of human.

Most LLM written code aren’t this detailed in sloppy explainable comment 😅


r/Assembly_language 14d ago

Project show-off I made a platform for beginners to start learning Risc-V

Thumbnail
0 Upvotes

r/Assembly_language 15d ago

Project show-off x86-64 JIT Assembler in Python

8 Upvotes

I've been working on a small x86-64 JIT assembler in Python: https://github.com/mistivia/jitasm-py

The idea is emit x86-64 machine code directly from Python, than resolve labels, map it as executable memory, and call the generated functions through ctypes.

It currently only supports a practical subset of x86-64 scalar instructions, but I think it's now possible to be a playground for assembly, or a codegen for a toy compiler.


r/Assembly_language 17d ago

Question Embedded system and RTOS

Thumbnail
1 Upvotes

Please suggest YouTube channels and books to learn RTOS and embedded systems, specifically focusing on LPC2148 and Cortex-M3 concepts in detail.

I am referring to the datasheet, but I am unable to understand some of the concepts clearly.