Questions tagged [x86]

x86 is an architecture derived from the Intel 8086 CPU. The x86 family includes the 32-bit IA-32 and 64-bit x86-64 architectures, as well as legacy 16-bit architectures. Questions about the latter should be tagged [x86-16] and/or [emu8086]. Use the [x86-64] tag if your question is specific to 64-bit x86-64. For the x86 FPU, use the tag [x87]. For SSE1/2/3/4 / AVX* also use [sse], and any of [avx] / [avx2] / [avx512] that apply

Filter by
Sorted by
Tagged with
1 vote
1 answer
34 views

How to solve the problem "relative jump out of range"

TITLE ASSIGNMENT MAIN MENU ; title directive .MODEL SMALL ; declare memory model used (small) .STACK 64 ...
Yu Wen Ang's user avatar
2 votes
0 answers
32 views

How can I clear the terminal screen with Linux system calls in x86 assembly? [duplicate]

Thank you for taking the time to review my question; however, be kind as I'm still a beginner x86 programmer. I'll get straight to the point. I'm undertaking my first x86 project by attempting to ...
HerrWeishaupt's user avatar
0 votes
0 answers
18 views

Does the Intel SDM's "Intra-Processor Forwarding Is Allowed" memory ordering litmus test for store-forwarding show LoadLoad reordering?

This behavior can be represented by the following figure: But in my opinion, this memory older violates the order of load ->load. For Core 1, Load 1 executes after Load 2. In x86 memory ordering: ...
wang fuqiang's user avatar
1 vote
1 answer
68 views

Details about segment selectors in x86 system

I'm studying about protection ring of x86 system. Examples of accessing data segments In this picture, there are segment selectors. My questions are... segment selectors are in the RAM? who create ...
choiyhking's user avatar
0 votes
1 answer
37 views

equivalence between jump and cmov [duplicate]

If I had a label "branch" what is the difference between je branch and cmove %eip branch ...also does this cause problems with branch prediction? edit: cmov does allow immediate so just ...
Bobby Morelli's user avatar
0 votes
0 answers
40 views

Details about Protection Ring system

I'm studying about Protection Ring system. Can you give me some details about operation of this system in CPU level? Is it related to CPL? why they use especially "4" level? why not 2 or 3....
choiyhking's user avatar
0 votes
0 answers
23 views

x86 asm writes out random letters [duplicate]

here is the code with the enviroment https://replit.com/@DominikDevelopm/testing#main.asm if i write a longer text, or write text multiple times, it writes out characters that were written earlier. ...
DominikDIOP's user avatar
0 votes
0 answers
38 views

pushing value to stack through registers failed [closed]

I tried to push rcx and rdx onto the stack and then assigning values from higher memories to them but it didn't work My preivous stack was: enter image description here After implementing the code: ...
watson's user avatar
  • 1
2 votes
1 answer
39 views

Triple fault does not put system into reset

Tried to issue platform reset via triple fault on my x86 based platform (Intel Cherry Trail x5 Z-8350), however platform just hangs. I see expected behavior on qemu - system reboots on triple fault. ...
bob_vance's user avatar
-1 votes
0 answers
25 views

Error in my VS Code while trying to run asm

Include irvine32.inc .data ; Student ID 3455822 left DWORD 345 right DWORD 5822 total DWORD 0 diff DWORD 0 message BYTE "Hello World!",0 Array WORD 1,2,4,8,16,32,64 ...
Taaha's user avatar
  • 1
-4 votes
0 answers
38 views

How can I manipulate the CPU to tell the GPU to display all the graphics in x86 NASM? [closed]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; X86 NASM ; ; This is ...
Eric Wright's user avatar
1 vote
1 answer
60 views

What is wrong with my assembly code that is trying to swap each element of an even array with the element that is next to it?

I am taking a beginner assembly code class and I can't figure out what is going wrong. I moved arr+1 (the second element in the array arr) into EDX at the end just to check if the correct value is ...
LiannaL's user avatar
  • 21
-1 votes
0 answers
23 views

pwndbg not loaded in terminal (downloaded succesfully though)

I've recently just downloaded pwndbg from github, and the download was successful. However, I only saw the GNU gdb message and not the message from pwndbg: GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1 ...
itsrunan's user avatar
2 votes
1 answer
75 views

Is VGF2P8AFFINEINVQB the longest x86 instruction mnemonic?

Trivia Question At 17 characters, is VGF2P8AFFINEINVQB - Galois Field Affine Transformation Inverse, the longest x86 instruction mnemonic? Is there a length limit?
vengy's user avatar
  • 1,742
1 vote
0 answers
27 views

Way to pull x86 docker pull & push image on an arm machine? [duplicate]

Is there a way to push and pull x86 image working on an arm machine? I just want to pass through an image for testing.
lony's user avatar
  • 6,753
3 votes
1 answer
74 views

How does an int instruction know which registers to use when it runs?

I'm a student studying the Assembly Language(NASM) and I need some clarification on how the interrupt "function" or int knows which registers to "run". I have figured out that a ...
Guffar07's user avatar
0 votes
1 answer
46 views

DIY Bootloader isn't doing what it should do

A while ago I wrote a bootloader with the help of a tutorial. But it was so complicated that I barely understood anything. So today I set out to make my own bootloader using my knowledge and Google. ...
Fabboy's user avatar
  • 33
2 votes
3 answers
77 views

PCIe ordering rules and x86, how are they compatible?

PCIe specs express clearly what are the ordering rules. A Posted Request must not pass another Posted Request A Posted Request must be able to pass Non-Posted Requests to avoid deadlocks It means ...
Alexis's user avatar
  • 2,156
-1 votes
0 answers
28 views

Stack overflow on M1 takes longer

This is a hard question. I have many MacOs machines. Most of them have Intel x86 architecture but few of them are Ventura with M1. I am trying to generate a stack overflow on all the machines with the ...
Ariel Silver's user avatar
0 votes
1 answer
43 views

Msfvenom bind_tcp shellcode not working when the shellcode is defined as a global variable

I am generating bind_tcp shellcode on my Ubuntu with the following command: msfvenom -p linux/x64/shell/bind_tcp -b "\x00" -f c RHOST=172.31.31.179 LPORT=1234 And my C code to test it is: #...
heturing's user avatar
  • 127
1 vote
2 answers
34 views

Getting null bytes out of Windows shellcode

The code in question: mov ebx, fs:30h Consequent shellcode: 648b1d30000000 I can't seem to figure out how to write this without null bytes.
R-Rothrock's user avatar
0 votes
0 answers
38 views

What's the meaning of _mm512_mask_loadunpacklo_epi32?

I'm a beginner with the AVX-512, when I read the source code for an open source program, I found the following codes: __m512i vecData1; __mmask16 vecMask; int32_t *addrF = (int32_t *)_mm_malloc(sizeof(...
AoShen's user avatar
  • 1
0 votes
2 answers
70 views

why x86 assembly function call first argument is rbp - 4 rather then rbp + 4 [duplicate]

int square(int num, int i2) { return num * num; } square(int, int): push rbp mov rbp, rsp mov DWORD PTR [rbp-4], edi mov DWORD PTR [rbp-8], esi ...
helianthus's user avatar
0 votes
1 answer
37 views

How to create an import library for kernel32.dll using a .def file on x86?

I have a small project that does not depend on the CRT or windows sdk. In order to link against kernel32.dll I created a minimal .def file with only the couple functions I need: LIBRARY kernel32.dll ...
lelgetrekt's user avatar
2 votes
1 answer
151 views

Homemade 'fabs' function in C and x86 Assembly

I'm trying to make in GNU C an fabs function that returns the absolute value of a 32 bits float. I have three different ways, called fabs1, fabs2, and fabs3: #include <math.h> #include <stdio....
Cuco's user avatar
  • 29
0 votes
0 answers
26 views

unable to compile x86 .s file

I tried compiling my asm .s file in the terminal of VSC and it didn't work although it worked just yesterday :( The code: .global main main: pushq %rbp movq %rsp, %rbp movq %rbp, %rsp ...
itsrunan's user avatar
-1 votes
0 answers
34 views

How do I convert AT&T syntax to NASM syntax?

How do I make this ATS syntax assembly code to something NASM syntax so NASM can understand: .file "kernel.c" .globl _videoMemory .data .align 4 _videoMemory: .long ...
Freemotion 21's user avatar
0 votes
0 answers
41 views

Program in C keep seg faulting with asm function [duplicate]

I have a simple C program with a function I built in intel assembly that multiplies a number by the other and then returns the product of the two after that I use printf to output the number. I used a ...
yonx's user avatar
  • 5
-1 votes
0 answers
53 views

I am learning ASM and I made a program that adds two numbers but I didn’t know what register to use to output the result and store it into the result [duplicate]

Variable section .data num1 dd 5 num2 dd 2 result dd 0 section .text global _start _start: mov eax, num1 add eax, num2 I was expecting it to output the number but I didn’t ...
Eric Wright's user avatar
0 votes
1 answer
68 views

What value will RAX have after an 8-bit DIV instruction, with instructions that set up AL/AH and CL?

What is the correct answer? I've got this question on a test... :/ x86-64 architecture: //What value will the register RAX have after //executing the following sequence of instructions? mov ...
Zaco's user avatar
  • 13
0 votes
0 answers
25 views

Injecting Exceptions into the VMCS-PIR field

In x86 a VMM may use posted interrupts to signal an Interrupt to a VM (source). The detailed description can be found in Volume 3/29.6 (Posted Interrupt Processing). According to the documentation, ...
Benedict Schlüter's user avatar
2 votes
1 answer
53 views

Why do mem_load_retired.l1_hit and mem_load_retired.l1_miss not add to the total number of loads?

I'm investigating the effects of cache on performance on x86-64 CPUs. I've been using Linux's perf to monitor cache hit/miss rates, particularly these counters: mem_inst_retired.all_loads ...
MC ΔT's user avatar
  • 505
3 votes
0 answers
67 views

Customised ABI in Linux Kernel 2.6.11 boot code [duplicate]

Recently I have tried to read the code of Linux Kernel 2.6.11. In the path arch/x86/boot/ I found some codes about jumping to protected mode. I did not understand what ABI did they use and where did ...
Pollard Lee's user avatar
-1 votes
0 answers
18 views

Undefined Symbols when running assembly code [duplicate]

i am trying to running asm on mac, however and i am having some problems while compiling. heres my code: section .data hello db 'Hello, World!',0 section .text global _start _start: ; ...
DominikDIOP's user avatar
0 votes
0 answers
38 views

what is the relation between BIOS and the benchmark instruction pair `CPUID` and `RDTSC/RDTSCP`?

Recently when I read ia-32-ia-64-benchmark-code-execution-paper, it says what to do if the Section 3.2.2 method fails. Analyze the variance of the variances and the variance of the minimum values to ...
zg c's user avatar
  • 129
1 vote
0 answers
47 views

why do we need one jump after changing `PG` with `mov ... CR0` when using non-completely serializing instruction?

In the Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 3A 9.3 SERIALIZING INSTRUCTIONS When an instruction is executed that enables or disables paging (that is, changes the PG ...
zg c's user avatar
  • 129
1 vote
1 answer
121 views

Coherence protocol and store buffer

Consider the code below: std::atomic<int> a = 100; --- CPU 0: a.store(101, std::memory_order_relaxed); --- CPU 1: int tmp = a.load(std::memory_order_relaxed); // Assume `tmp` is 101. Let's ...
Jack Humphries's user avatar
1 vote
0 answers
40 views

Is weakCompareAndSet's "Spurious failure" simply the presence of contention in the LOCK prefix? [duplicate]

I've seen the argument that the reson why it is named "weak", is because the "strong" version has happens-before "orderings" behavior. In my understanding "Happens ...
Delark's user avatar
  • 1,171
0 votes
0 answers
78 views

Weird characters after implementing bootloader Assembly OS

I just implemented a bootloader in my small Assembly OS. It appears to be working, since it boots straight in the kernel. There is one problem, the characters are not correct, this was not a problem ...
Luxo Luxo's user avatar
0 votes
0 answers
17 views

What are "Global Pages" for? (Intel x86 processors) [duplicate]

Disclaimer: this is a repost from superuser, due to a comment that the question might be more suitable for Stack Overflow. In Intel Software Developer's Manual (Intel 64 and IA-32 Architectures ...
WannabeArchitect's user avatar
0 votes
0 answers
27 views

x86: movsxd taking a long time on Intel's Cascade Lake machine (Core i9-10980XE) [duplicate]

Upon using Intel's Vtune tool, I notice that the movsxd rax, edx instruction is taking quite some time to execute. I understand that we access both 32 bit and 64 bit registers in this assembly code ...
Vignesh's user avatar
-1 votes
1 answer
28 views

Using Labels in NASM

Using NASM. I want to be able to leave a label address inline. ; _Plus: DB 1, "+" do_PLUS: POP EDX ADD EDX , ESP MOV EDX , ESP ; _COLON: do_PLUS <---------- ** ERROR ** I ...
FJRusso's user avatar
1 vote
0 answers
34 views

Why does this print_array function gives me SEGFAULT in NASM x86 [duplicate]

extern puts extern printf section .rodata format db "%u ", 0 puts_format db "", 0 section .data arr1 dd 10, 20, 30, 40, 50, 60, 70, 80 len1 equ 8 arr2 dd 11, ...
tudor_cretu's user avatar
0 votes
1 answer
37 views

Get parameter value in Assembly

I'm a beginner in Assembly, so I'm confused about passing parameters in function call from another function. Specifically I have code like this: Assembly: bar: pushl %ebp movl %esp, %ebp subl $...
Võ Khắc Bảo's user avatar
4 votes
1 answer
47 views

uhex$ in masm assembly

I have this block of code here on Intel structure and I wonder why uhex$(ebx)+6 ? What is the +6 in there is for ? Can some one explain it to me ? .code start: ... WinMain proc hInst:HINSTANCE,...
Huy Tran's user avatar
0 votes
1 answer
58 views

Loading GDT from Late Bootloader

I have an OS I'm working on currently and making a 2-stage bootloader called early bootloader (DfltBoot) and late bootloader (AdvBoot) and the early one does it's job and loads the late one and jumps ...
trianglx's user avatar
1 vote
1 answer
77 views

First movss, then unpcklps with zeroes, not changing the high zeros. Why?

I am new to x86 and have no experience in it, so this code looks kinda obsolete to me. Is there any purpose in doing this? The instructions are: rcx+000003F8 = 32bit float xmm0 = 0 (all ...
Theo Schrenk's user avatar
0 votes
0 answers
32 views

Why can I not print out the contents of a buffer in x86 assembly?

Thank you for taking the time to look at my question and all help is appreciated. I will keep this question simple, so here it is: ; Program Author: David Mark Serrano ; Program Name: Battle_Chess ; ...
HerrWeishaupt's user avatar
1 vote
1 answer
58 views

Unable to get input to store in a buffer in a x86asm kernel im making

all it does is save the last character typed prompt: call print_string .input_loop: call wait_for_keypress cmp al, 13 ; checks if enter pressed je .exit mov [input_buffer], al ;...
technonux's user avatar
-3 votes
1 answer
52 views

How to replace a character in a DB string variable in x86 assembly language? [closed]

Here's my code: TextCol1 DB 0ffh,000h,0ffh,000h,00bh,000h,COL_TEXT_NORM1,COL_BLACK How do I write the code to replace the COL_TEXT_NORM1 with COL_RED_ALERT? Cheers Lazy Bones
Frankie 'Moodurian' Kam's user avatar

1
2 3 4 5
340