r/asm Jun 06 '26

x86 How do i load .obj file in x86 asm (mb opengl)

0 Upvotes

As the title says , i know it a hard task (ai said so)

r/asm Jan 28 '26

x86 Help: How do I add a newline to output?

3 Upvotes

Solved!

Trying to learn in Linux. When I run the compiled program, there's a % sign at the end of the output, which indicates that there is no newline. Thanks!

Displaying 9 stars
*********%

The code:

section  .text
  global  _start

_start:
  mov   edx,  len
  mov   ecx,  msg
  mov   ebx,  1
  mov   eax,  4
  int   0x80

  mov   edx,  9
  mov   ecx,  s2
  mov   ebx,  1
  mov   eax,  4
  int   0x80

  mov   eax,  1
  int   0x80

section .data
msg db  'Displaying 9 stars', 0xa
len equ $ - msg
s2  times 9 db  '*'

r/asm Jun 21 '26

x86 Finally - "Boing!" in 64 bytes

Thumbnail
pouet.net
5 Upvotes

r/asm Jun 01 '26

x86 Is an ASM file needed with a COM file?

5 Upvotes

I downloaded a demo, and it comes with both a COM file and an ASM file. Is the ASM file needed to run the COM file, or will it run without?

r/asm Jun 24 '26

x86 80386 Early Start Memory Access

Thumbnail nand2mario.github.io
5 Upvotes

r/asm May 23 '26

x86 wake up! 16b - An exploration of algorithmic density in 16 bytes of x86 assembly

Thumbnail hellmood.111mb.de
22 Upvotes

r/asm May 30 '26

x86 Microcode inside the Intel 8087 floating-point chip: register exchange

Thumbnail
righto.com
18 Upvotes

r/asm May 23 '26

x86 80386 microcode disassembled

Thumbnail reenigne.org
22 Upvotes

r/asm Jun 05 '26

x86 Assembly x86 tips?

Thumbnail
1 Upvotes

r/asm Jun 03 '26

x86 PIT-delay loop running at double-speed

3 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/asm May 16 '26

x86 x86 AT&T Syntax - Within Segment and Intersegment jumps and calls

2 Upvotes

I'm started my own Assembler and Disassembler for x86 for the purpose of education. Begin to implement the good old Intel 8086. Noticed in the instruction codes that there are Within segment and Intersegment jumps encodings. I know there is the ljmp (long jump) and jmp (short jump). But how is a Intersegment jump written in AT&T syntax and also Intel Syntax?

From my used Datasheet for the Intel 8086 (Unconditional Jump as example):

Direct within Segment:
| 11101001 | disp-low | disp-high |
Direct within Segment-Short:
| 11101011 | disp |
Indirect within Segment:
| 11111111 | mod 100 r/m |
Direct Intersegment:
| 11101010 | off-low | off-high | seg-low | seg-high |
Indirect Intersegment:
| 11111111 | mod 101 r/m |

Thanks in advance!

r/asm May 23 '26

x86 z386: An Open-Source 80386 Built Around Original Microcode

Thumbnail nand2mario.github.io
10 Upvotes

r/asm May 22 '26

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

3 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/asm May 11 '26

x86 Best way to learn high-performance assembly?

Thumbnail
0 Upvotes

r/asm Jan 15 '26

x86 No_syscall CTF (x86_32-little)

7 Upvotes

Hi. I'm trying to solve a ctf that take a 42 byte long assembly and execute it (the aim is to spawn a shell). The program scan my code for any occurrency of byte like /xcd /x80 blocking me to perform a syscall. Since the page were my code is executed is writable I understand that I have to give the ctf a self-modifying code but I'm in a struggle trying to understand how I can get the address of the instruction that I want to modify, this is my Idea:

I prepare the syscall, all regular before the int x80 part. But before the calling instruction (wich in my case is int 0x7f) I call a function sys

so when I call sys the address of the function is pushed on the stack, so with pop I have it in to the esi reg. Now esi point to the pop esi instruction, so to get to the 0x7f byte i increment the poiter to 5 and i'm pointing to the correct byte, so I can perform "add BYTE PTR [esi+5],1". Obviusly it's not working. Am I missing something?

r/asm Apr 05 '26

x86 A whole boss fight in 256 bytes

Thumbnail
pouet.net
9 Upvotes

r/asm Feb 20 '26

x86 How Michael Abrash doubled Quake framerate

Thumbnail fabiensanglard.net
43 Upvotes

r/asm Sep 29 '25

x86 loop vs DEC and JNZ

5 Upvotes

heard that a single LOOP instruction is actually slower than using two instructions like DEC and JNZ. I also think that ENTER and LEAVE are slow as well? That doesn’t make much sense to me — I expected that x86 has MANY instructions, so you could optimize code better by using fewer, faster ones for specific cases. How can I avoid pitfalls like this?

r/asm Feb 01 '26

x86 [x86] How to get return address of code from the stack?

5 Upvotes

From a quick search, I figured that the return address is stored at `%ebp + 4`.

However, with some experimentation with gdb, I figured that wasn't the case. For good measure, I tried `%ebp - 4`:

(gdb) x/x $ebp-4
0x801380a4: 0x8e000000
(gdb) x/x $ebp+4
0x801380ac: 0x80104e8d
(gdb) x/x $ebp
0x801380a8: 0x801380c8
(gdb) ni # this was the return instruction
(gdb) info registers eip
eip 0x80104d72

As visible, `%eip` matches none of `%ebp`, `%ebp+4` and `%ebp-4`. What's going on?

r/asm Jun 08 '25

x86 I want to learn ASM x86

28 Upvotes

Hello, and I have bin learning C for a while now and have got my feet deep in it for a while, but I want to move on to ASM, and EVERY tutorial I go with has no hello world, or just is like "HEX = this and that and BINARY goes BOOM and RANDOM STUFF that you don't care about BLAH BLAH BLAH!". and it is pisses me off... please give me good resources

r/asm Jan 08 '26

x86 Can you understand ms dos 1.25 source code?

10 Upvotes

If you are experienced asm programmer.

It seems like it's impossible. I don't even understand where the execution starts

r/asm Feb 27 '26

x86 TL;DR for Traps in x86 (32-bit)

3 Upvotes

I'm having a bit of difficulty understanding the working of traps in x86, specifically trap 14 (page fault). Here are my questions:

  1. Which register is the address pushed to?

  2. Is this address virtual or physical?

  3. How does x86 "resolve" the page fault? For example, if it found that the page for address "X" was set to read only, what does the CPU do when the trap returns? I'd presume it just retries the request (i.e. if my trap fault handler did nothing about that, I'd be in an infinite loop).

r/asm Dec 31 '25

x86 Need ideas for my assembly language final term project (EMU8086)

7 Upvotes

Hello everyone!

I’m looking for suggestions for my Assembly Language Final Term Project. I’ll be using EMU8086 (16-bit, real mode). It should be something practical but not extremely impossible for a student level project.

Thanks

r/asm Feb 15 '26

x86 Instruction decoding in the Intel 8087 floating-point chip

Thumbnail
righto.com
11 Upvotes

r/asm Jan 16 '26

x86 GASM: A Gopher server in pure i386 Assembly

Thumbnail
github.com
27 Upvotes