1,060 questions
0
votes
0
answers
56
views
Does this assembler statement load an instruction into register?
Reading the article https://web.archive.org/web/20171219120457/http://nairobi-embedded.org/005_elf_types.html about ELF Object File Types, I faced up with the following assembler x86 instructions:
mov ...
2
votes
0
answers
30
views
Why is this example Assembly code that is trying to create a data record which is the address of another data record generating an error? [duplicate]
This question regards code from the book "Learn to Program with Assembly" by Jonathan Bartlett. The code in question is on page 96 and is called persondatanamepointer.s. The context is that ...
3
votes
1
answer
72
views
Should the box at the bottom be %rax instead of %rbx in Fig 6-1 of Jonathan Barlett's book?
I've been reading a book called "Learn to Program with Assembly, Jonathan Barlett". In which , I didn't understand the Figure 6-1.
Context: The author is explaining register-indirect mode, ...
0
votes
0
answers
30
views
Can an immediate value be moved into to a memory location without loading it into a register first? [duplicate]
I've been learning x64 assembly lately from a book (Learn to program in Assembly, Jonathan Bartlett). The book claims, "In order to manipulate the data, we have to move it into registers first.&...
0
votes
0
answers
36
views
Can anybody help me with these error messages, please? ≽^•⩊•^≼ [duplicate]
Here is the code (written in assebly at&t syntax):
.section .data
.equ N, 1024
v: .skip N * 4
fin: .string "input.txt"
fout: .string "output.txt"
descriptor:...
0
votes
0
answers
83
views
Assembly Calls Itself [duplicate]
I am rather new to assembly and have been trying to understand what is happening with the call instruction within this code. I have this simple C++ program that I compiled and disassembled with gdb.
#...
1
vote
0
answers
25
views
How to get CLI arguments in Assembly language without libc? [duplicate]
I wanted to print out first command line argument in x86_64 Assembly on Linux, but I have had hard time getting value of it. For clarification: commands I use to compile this are as -o args.o args.s -...
1
vote
1
answer
138
views
Subtraction producing a negative number in assembly - what is the hex value?
I'm very new to assembly so I don't know if this is a stupid question, but I have a question where I'm being asked to read the following line of assembly and say what value is stored in %rdi ...
-1
votes
1
answer
50
views
How to understand the bytes the stack pointer changed when call function
I feel confused about the bytes the stack pointer changes when callq or retq is invoked?
Here’s a little example
; Disassembly of leaf (long y) y in %rdi
0000000000400540 <leaf>:
400540: 48 8d ...
0
votes
1
answer
345
views
How to use x86-64 SIMD vector instructions and registers for polynomial evaluation
I need to write a x86-64 assembly function that uses x86 vector/SIMD instructions and the %ymm registers to evaluate this expression: x*(x*(a*x + b) + c) + d.
The function will have this signature: ...
1
vote
1
answer
79
views
My bootloader isn't printing after switching to Protected Mode
I'm trying to print the character "C" after switching to the Protected Mode, but it isn't working, and I don't know why. I'm using Assembly AT&T/GAS syntax
Here is the code:
.code16
....
1
vote
0
answers
67
views
Whis is this x86_64 AT&T assembly failing, i think foo: is the culprit?
Here is the assembly, I am using Windows 11.
Assembling: as .\test.S -o test.out
Linking: ld -o test.exe -subsys=console test.out -L "C:\TDM-GCC-64\x86_64-w64-mingw32\lib" -lmsvcrt
When i ...
0
votes
0
answers
684
views
cannot execute: required file not found, linking -lc wth ld command
So basically, I am working on a compiler ... long story short, I codegen and i want to use libc with the x86_64 AT&T Assembly. The object file is generated with 64bit elf architecture. I want to ...
0
votes
0
answers
85
views
Problem with program in assembly x86 AT&T, division by repeated subtraction algorithm
I have a problem with my program. It should read from STDIN 32 bytes as divident, then next 32 bytes as divisor, after that it should divide divident by divisor using "division by repeated ...
1
vote
2
answers
61
views
Problem to convert from ASCII to integers in Assembly AT&T 32 bit
ASM newbie here. I'm trying to convert in ASM AT&T (32-bit version) the following ASCII text from ASCII to integer (skipping the commas (44 in ASCII) and newlines (10 in ASCII)):
1,10,2,2\n2,7,6,7\...