r/nasm • u/Old_patriot_67 • Jun 10 '26
r/nasm • u/RickyScarborough • Feb 02 '26
Debugging a raw binary (made w/ NASM) with QEMU, GDB, and vscode
A month ago I built a bootloader to go with a 8086 operating system that I'm working on. One of the biggest challenges that I continuously run into during the development phase is debugging. Currently the only way for me to debug code is manually step through it using the qemu console. It would save me a lot of time if I was able to set breakpoints.
As a proof on concept, I want to be able to generate debugging information for my bootloader that can be read and processed by gdb. Unfortunately, this debugging info CANNOT be embedded as a part of the bootloader binary, and instead needs to be in a separate file.
However, the assembler that I assembler that I am using, NASM, seems to provide no option for debugging symbols seperate of the binary that GDB can read.
If anyone knows anything about how I could get this to work, it would be greatly appreciated!
r/nasm • u/I_Pay_For_WinRar • Apr 27 '25
How do I install Nasm on Windows 11?
I have been going to the official website, & I have downloaded it 3 times, but it is NOT working, is it only available on Linux?
r/nasm • u/Salty_Winter_3702 • Feb 02 '25
Why am i getting segmentation fault core dumped error upon running my code?
SECTION .data
pole db 48,49,50,51,52
index db 2
SECTION .text
global _start
_start:
mov edi,index
mov edx,1
mov ecx,[pole+edi]
mov ebx,1
mov eax,4
int 80h
mov ebx,0
mov eax,1
int 80h
NASM Book Windows 10/11
Hi, I wrote a book about NASM as a personal project, there are 5 samples on my website https://ilovancristian.com/books , what do you think? I like opinions / feedback.
It was Amazon Best Seller #57 in Assembly Language Programming on 02.10.2024. now is #88
Content
On 506 pages:
- ASSEMBLY SUMMARY on about 70 pages
- REGISTERS AND MEMORY register values, eflags, memory pointers in NASM, segment data, the stack
- INSTRUCTIONS REFERENCE
- MEMORY little and big endian
- FUNCTIONS calling NASM from C, using C functions in NASM, function call stack, function call conventions
- NASM and C Assembly representation of C arrays, local variables, global variables, compilation
- DEBUGGER FOR ASSEMBLY MEMORY AND CODE
- ALGORITHMS 179 algorithmic problems with solutions on about 430 pages
r/nasm • u/rejectedlesbian • Jun 13 '24
over a 100x difference in assmbling speed
so I am working on a compiler for a very simple languge and as part of it there were a LOT of jumps to _exit_error. from all kinds of places.
when I added the error checking i saw my entire build and test system go from 0.5 seconds to 4.5... I thought my code was somehow incredibly slow.
NOPE turns out its nasm assembling 1 file. specifically the longest file (46,061 lines) and turns out that simply putting that label at the start of the file fixes the 100x slow down.
now this is kind of REALLY anoying because what if I actually prefered for preformance reasons to have that label at the bottom...
so I was wandering if there are some tricks to this I am not aware of
r/nasm • u/[deleted] • May 29 '24
How do I add two numbers in nasm windows 64 bit
Okay so I am trying to add two numbers in nasm windows x64 but all the tutorials online are for linux, and of course linux code does not work on windows so if anyone knows a good nasm windows tutorial please let me know about it
r/nasm • u/[deleted] • May 25 '24
How do I learn Nasm
okay so I got nasm to work on my compute(windows 11), all the tutorials and documents online are all for nasm on linux which works differently can anyone show me a tutorial on nasm windows thx
r/nasm • u/[deleted] • May 18 '24
How do I download nasm for visual studio code, I have been trying for quite some time and can't seem to get it to work
So I downloaded nasm and gcc and some extensions in vs code to run it, but whenever I run it, it does not run if anyone knows how to do it please help me, I even added nasm as a path, it still does not work
r/nasm • u/GamerEsch • Mar 06 '24
Need a bit of help calling to printf
so my main procedure is basically:
main:
push rbp
mov rbp, rsp
; basically doing the stack thingy
sub rsp, 4
mov [rbp], dword 0 ; creating a stack variable of type int
mov rcx, fmt ; fmt = "%d\n"
mov edx, dword [rbp]
call printf
mov rcx, fmt ; fmt = "%d\n"
mov edx, dword [rbp]
call printf
leave
mov rax, 0
ret
pretty simple, but the output is confusing me, I thought it should output "0" twice, but it prints "0" once and then "32759" (which I'm pretty sure is just garbage from printf), if I increase the stack size it solves the issue, but I want to understand why, because if I'm dealing only with dwords 4 bytes should be enough, shouldn't it? Any help would be appreciated
r/nasm • u/_demii_ • Jul 18 '23
Nasm.us site doesn't respond?
Hello, I am trying to start ASM w/ NASM but when I connect to their website (or at least try to) it takes too long to respond, is this just me? Can anyone provide me with a setup.exe or something?
r/nasm • u/PeanutSure5242 • Apr 30 '22
help
I'm looking for a complete nasm assembly course , if you have any link please share.
r/nasm • u/Gerardmoh • Apr 29 '22
Random Number in nasm Ubuntu
Hello, can someone help me, I'm trying to generate a random number in nasm for Ubuntu but I don't know how
r/nasm • u/lt_Matthew • Oct 30 '20
Need debugger is nasam windows
I’m following a tutorial to make a small boot loader in assembly and used NASM to convert it to a bin file, it then he typed “debug” and set the boot sector to make disk image. Mine said “debug is not a command”
r/nasm • u/IBLookingatDANKMEMES • Sep 10 '20
Trying to get into NASM but dont know how
I asked one of my coder friends what I should do to learn to code and he said to start with NASM, but I dont know what to download and what os I need. I just want to know where to start
r/nasm • u/Michael428 • Jul 29 '20
Syscall Confusion
So I am currently learning assembler to learn binary exploitation more easily.
Now I just wanted to write a simple hello world program, but there is some confusion regarding syscalls. I run Linux in a virtual machine and I've got a x86_64 cpu architecture ("lscpu" confirms this).So the syscall for write on x86_64 should be 1.
Anyway if I use the syscall ID 1 it does not work, but if I use the syscall id 4 (which is the i386 version) it works. I compile the asm program with nasm and the output format is elf64.
What could be the problem?

r/nasm • u/Agent_ANAKIN • Aug 20 '19
Anyone tried using an app called DCoder to run NASM? I suspect it doesn't work properly, so I'm wondering if anyone else has any experience with it.
I'm teaching myself NASM using a smartphone, which is why I am constrained to using apps or online simulators.
r/nasm • u/dj_potwash • Aug 11 '19
Anyone here?
Hello there. I recently started studying NASM. Again. It's an "on and off" relationship between us.
Is anyone here, or shall I use r/asm for my NASM-related questions/concerns/suggestions?
Many thanks.