I’m trying to write some assembly programs using nasm on linux. Everything is good, but I make heavy use of local symbols (.loop, .else, etc.), which is a pain when debugging, because these symbols are emitted to the symbol table, e.g.: will produce a disassembly that looks like: which is a bit annoying just because gdb will think these are
Tag: nasm
mov edx overwrites cx register
I’m trying to print Hi 10 times. This is my code. gdb reports that mov edx, 3 overwrites the cx register to some crazy value and so the loop keeps going forever. What am i doing wrong? Is it because they are the same register? How does one program in assembly with so few registers? Compiling on centos with nasm
Clean console on assembly
Is there anything similar to system(“cls”); that exists on C for Assembly? I’m using NASM to compile and I’m working on a x86 linux. UPDATE 1: Here’s my modified code to integrate sugestion: Cheers Answer To imitate the terminals clear command have in a .data section: then whenever you want to clear the terminal do:
Getting digit instead of Ascii in nasm assembly intel x86
I’m trying to learn the basics of assembly but can’t get across on how to display results stored in memory. What I’m trying to do is get the dot product of the two list of numbers and display it on the screen. However, I keep getting random letters which I believe are hex representations of the real decimal value. How
assembly function segfault at return (nasm x64)
My asm function segfaults at return. Here is the function prototype : void ft_cat(int fd); Basically it get a fd from a C main and act like cat shell command. I get no problem if I removed read and write parts so maybe the problem is around syscalls. I just can’t tell. I already spent hours and hours looking for
NASM code with user output, and then input into an argument. (code error)
I have had problems implementing user output into and argument with my below code. An example of BASH showing, a similar example function of what i would like to implement in NASM. The reason why I am creating this code is to show a comparison of different languages, used within Linux, This is one part of my research project. So
Printing an integer with x86 32-bit Linux sys_write (NASM)
I’m new to this forum. I have a little experience with high-level languages (really little). Nearly one month ago I thought it would be a good idea to see how assembly worked so after choosing nasm (IA-32) on linux I started learning from a tutorial. Now, after ending it, I tried to write a simple program where you get the
nasm assembly linux timer or sleep
I’m trying to find a way to make my code wait for two seconds before proceeding. I’m using nasm for Linux in protected mode, so I can only use int 80h. I found a syscall called “alarm” (27) and another called “pause” (29). However, when I try to use those, the program waits and finishes instead of continuing execution. I’ve
How to clear screen on protected mode
I’m using NASM for Linux and I’d like know how, in the protected mode, you can clear the screen. I found a solution using the int10h, but on the protected mode I can only use int80h. Thanks in advance. Answer You can write x1b[2J to the standard output so the terminal get cleared and fix the cursor position using x1b[H,
Calling assembly routines from C source code
I have this simple C source code : and i have this s.asm which defines the function _Sum : now , i compiled the .asm using : and compiled and linked the .c file using : this is the outcome : So what is the problem ? I’m using Ubuntu-Linux Any help would be greatly appreciated , Thanks [SOLVED] :