Category "nasm"

How does the EBP register get saved?

I couldn't find much information or specification that suits me, so I have no choice but to ask here. When we call some function with the call instruction and t

Debugging NASM in VS code

I have a simple C++ program that calls some NASM code: main.cpp: #include <iostream> extern "C" int foo(); int main() { std::cout << "The result

Execute system command in x64 bit assembly?

I recently been trying to execute system commands using pure assembly. I managed to achieve it in a x32 bit binary as posted here: execute system command (bash)

Link nasm with ld.lld linker

I have main.s file. extern printf extern exit section .data fmt: db "hi!", 0xa section .text global _start _start: mov rax, 0 mov rdi, fmt call printf

Writing a putchar in Assembly for x86_64 with 64 bit Linux?

I am trying to use the write syscall in order to reproduce the putchar function behavior which prints a single character. My code is as follows, asm_putchar:

enabling paging leads to triple fault

In case this helps somebody in the future: check if the global descriptor table is working check if the elements of page table entry struct are ordered correctl

MOVZBQ equivalent in NASM

Background: I have been learning x86_64 assembly using NASM on a Linux system and was writing a subroutine for strlen(const char *str) I wanted to copy one byte

Load only first byte into a register, from a string at a label

I am trying to load only the first byte in a register after data is passed into it for example if I have the following ASM code global _start section .data stri

How to move the cursor with x86 BIOS calls?

I'm doing some operating system tutorials from the book "Operating systems from 0 to 1". One of the exercises is to set the cursor to a position on the screen i

How to get the beginning address of a string instead of the address of a whole string

SORRY if i make you confuse about the question, but i don't know a better to describe it i'm trying to write a NASM program to reverse a string in place. i ha

How do you understand 'REX.W + B8+ rd io' form for x86-64 assembly?

I was originally trying to generate the bytes for an immediate move into a 64 bit register.The specific operation I wanted was mov rdi, 0x1337 Using https://ww

relocation truncated to fit r_386_8 against .bss'

When I try to build my source into a 32-bit static executable for Linux with nasm -f elf -F dwarf -g loop.asm ld -m elf_i386 -o loop loop.o I get this R_386_

Printing hex from dx with nasm

I actually want to print the content of the dx register with nasm. Thereby the content is a 16 bit hex digit such as 0x12AB. Therefore I've first implemented a

Printing hex from dx with nasm

I actually want to print the content of the dx register with nasm. Thereby the content is a 16 bit hex digit such as 0x12AB. Therefore I've first implemented a

How to add two numbers, integer and a float in NASM?

I have this code that is suppose to add two numbers, a float(3.25) and a integer(2). EDITED: extern _printf, _scanf global _main section .bss num1: resb 4 s

How do I ignore line breaks in input using NASM Assembly?

Learning NASM Assembly, I am trying to make a program that reads two one-digit number inputs. I have two variables declared in the .bss: num1 resb 1 num2 resb

How do I ignore line breaks in input using NASM Assembly?

Learning NASM Assembly, I am trying to make a program that reads two one-digit number inputs. I have two variables declared in the .bss: num1 resb 1 num2 resb