nasm Questions
2
Solved
I'm studying x86-64 NASM and here is current situation:
These codes are for education only, not for running on client-facing system or so.
RCX holds loop count, between 1 and 1000.
At the beginnin...
Improbability asked 8/9, 2024 at 15:50
1
Solved
I am a little bit confused by how movzx behaves in the following example. (Please note that I am assuming the print_int function used in my code sample works and the problem is not there but in my ...
Gadabout asked 21/4, 2024 at 9:59
4
I am trying to compile and link my first program on Assembler.
I try to compile the following code:
; %include "stud_io.inc"
global _main
section .text
_main:
xor eax, eax
again:
; PRINT "He...
2
When compiling below code:
global main
extern printf, scanf
section .data
msg: db "Enter a number: ",10,0
format:db "%d",0
section .bss
number resb 4
section .text
main:
mov rdi, msg
mov a...
Weidman asked 27/6, 2018 at 20:13
0
I am attempting to write a simple assembly program in NASM on Windows that includes a loop and calls the ExitProcess function from the Windows API. I've successfully assembled the code using NASM, ...
4
Solved
There is a recent publication at nature.com, Faster sorting algorithms discovered using deep reinforcement learning, where it talks about AlphaDev discovering a faster sorting algorithm. This caugh...
5
Solved
I am looking for a way to print an integer in assembler (the compiler I am using is NASM on Linux), however, after doing some research, I have not been able to find a truly viable solution. I was a...
1
Solved
I have read this, this, and this yet to find what it is I want.
Firstly, I understand the difference between lea and mov in terms of the result they can achieve, put simply:
mov eax, ebp ;put the v...
2
Solved
I'm trying to create a simple make file, the commands I'm using now are:
$ nasm -f elf64 main.asm
$ ld -s -o test1 main.o
That's it. How can I create a Makefile from them? I've read the manuals ...
Kerato asked 11/1, 2017 at 4:0
2
Solved
I am trying to call a function - that should have an absolute address when compiled and linked - from machine code. I am creating a function pointer to the desired function and trying to pass that ...
Lakieshalakin asked 15/8, 2016 at 18:54
3
I want to print a float value with printf
global main
extern printf
section .data
string: db `%f\n`, 0
section .bss
rs: resq 1
[...]
movq xmm0, [rs]
mov rdi, string
mov rax, 0
call print...
Waiver asked 15/12, 2013 at 12:59
5
I'm not trying to prompt an Intel vs AT&T war (moot point anyway, now that they both support Intel syntax) or ask which one is "better" per se, I just want to know the practical differences in ...
Presentday asked 10/12, 2012 at 0:59
5
4
Solved
I've been trying to learn assembly lately, and came across this post. The author used NASM and Microsoft linker to set up the assembly working environment. I followed the same steps and installed N...
Whim asked 18/10, 2020 at 12:40
2
I am trying to print a string in Q Emulator using NASM. My code is as below:
mov bx,HELLO
mov ah, 0x0e
int 0x10
HELLO:
db 'Hello', 0
jmp $
times 510-($-$$) db 0
dw 0xaa55
However when I compile...
Frederick asked 20/10, 2016 at 0:27
4
Solved
I'm assembling an x86-64 program on Ubuntu with NASM:
nasm -f elf64 -g -F dwarf -o foo.o foo.asm
ld -o foo foo.o
Source:
section .text
global _start
_start:
mov rax, 60 ;SYS_exit
mov rdi, 0 ;EX...
1
I am new to assembly. I am trying to do this:
SECTION .data
SECTION .bss
SECTION .text
global _start
_start:
nop
mov rax, 067FEh
mov bx, ax
mov cl, bh
mov ch, bl
nop
Everytime I ru...
Venicevenin asked 19/1, 2015 at 4:22
1
Solved
I really dislike the GNU Assembler syntax and I some existing code written with NASM syntax that would be quite painful and time consuming to port.
Is it possible to make the global_asm!() macro us...
Heliotype asked 2/1, 2023 at 0:11
7
Solved
can anyone give me a comprehensive description about ORG directive?
When and why is it used in assembly written applications?
Using Nasm on x86 or AMD64.
1
Solved
I am in the process of making a bootloader as a way for me to learn assembly. I have looked into using sections to organize and optimize my code, but one thing that doesn't work is when I call my p...
Emblem asked 4/11, 2022 at 20:20
2
message db "Enter a digit ", 0xA,0xD
Length equ $- message
Is it used to get the length of a string?
How does it work internally?
2
I have an assembler file I want to compile in one run. However, the following code fails:
enable_language(ASM_NASM)
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -f bin")
add_executable(test t...
3
Solved
Starting to learn assembly, I was given some Hello World assembly code created during the class on Linux. I would like to get it to work for 64-bit Mac OS X.
code.asm:
SECTION .data
hola: db "H...
1
section.text:
global _start
_start:
mov ebx, 1
mov eax, 4
mov ecx, msg1
mov edx, len1
int 0x80
mov eax, 1 ; exit
mov ebx, 0
int 0x80
section.data:
msg1: db "Hello world"...
3
Solved
I'm going through the Intel processor documentation and writing some basic assembly code at the same time. I have both nasm and as (GAS) on my server and I understand the basic differences of both ...
Volturno asked 18/12, 2011 at 2:31
1 Next >
© 2022 - 2025 — McMap. All rights reserved.