All Questions
12,255
questions
0
votes
0
answers
40
views
Why is my array value not equal to a literal?
I am new to assembly and was trying to work with an array. However, I was geting caught when try to compare the array value to a constant stored in a register.
From the following code I was expecting ...
1
vote
1
answer
54
views
gnu inline assembly constraint `i` for memory address
Recetly, this function rip_rel_ptr has been added to Linux kernel.
https://elixir.bootlin.com/linux/latest/source/arch/x86/include/asm/asm.h#L118.
I can compile the kernel, but when I copy this ...
-5
votes
0
answers
82
views
x86 mulss result is diffrent over time [closed]
I am trying to make C++ neural network library and I noticed, that sometimes model with same inputs and same parameter values drastically changes output for no reason. I have no idea why it happens, ...
4
votes
0
answers
59
views
Why does Intel x86 manual use +rd instead of +ro or +rq for 64-bit registers?
The description of the PUSH instruction in the Intel manual (PDF, Volume 2, Chapter 4.3, PUSH) contains the line 50+rd PUSH r64. It seems +rd is used throughout most of the instruction descriptions ...
1
vote
0
answers
31
views
Link function calls against reverse engineered binary
I created an windows x86 .exe file that I reverse engineer. Imagine I only have the .exe file and I reverse engineered some functions.
The goal is to create a dll that links with this .exe so the dll ...
1
vote
1
answer
50
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
1
answer
89
views
Why do I get multiple ASM instructions per addition? (Visual Studio 2022 Community)
Here's the C program, I use Visual Studio Community 2022 with MSVC compiler. What are all those mov instructions, I don't use any compiler optimization flags.
#include <stdio.h>
int main(void) {...
0
votes
1
answer
36
views
x86 NASM Crash - Iterate over string
How to iterate over individual characters of a string in x86 assembly and print them?
global _main ; declare _main entry point
extern _printf ; extern method
section ....
20
votes
2
answers
1k
views
How to prepare stack pointer for bare metal Rust?
I'm trying to write an x86 bootloader and operating system completely in Rust (no separate assembly files, only inline assembly within Rust).
My bootloader works completely as intended within the QEMU ...
0
votes
1
answer
35
views
Print the greatest number in assembly programming
Trying to print the greatest number (a & b) by using the below assembly code. But it is printing the "first" (Welcome) message only. I just want to print the "second" (i.e ...
2
votes
1
answer
58
views
Zero Flag Not Set After Addition/Subtraction on 8086 Emulator (DOS) Using TD
I'm working on a simple assembly program for the 8086 emulator (DOS) using Turbo Debugger (TD). My task is to set the Zero Flag (ZF) to 1 using addition/Subtraction. However, no matter what I try, the ...
0
votes
0
answers
58
views
Falling to switch from 16-bit real mode to 32-bit protected mode
I am new to low level programming and I am writing a bootloader in assembly that switches from 16-bit real mode to 32-bit protected mode and loads a kernel. However, my bootloader stops working after ...
2
votes
1
answer
83
views
Trying to understand object code for "MOV AX,BX", am I dumb or is the textbook bad?
EDIT: Based on the answers and comments, it appears both the book and I are correct. BUT IMHO the book did a poor job of explaining the example, I mean instead of something like "For this ...
0
votes
0
answers
79
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 ...
0
votes
1
answer
40
views
i get this error trying to jump to the end point [duplicate]
this the procedure for the esc press to exit
i am trying to jump from this proc to the exit to stop game whenever esc is pressed. but it says that escpressed is out of range
proc escpressed
mov ah,1h
...