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

16,287 questions
1vote
1answer
20views

Why don't gcc/clang vectorize 128-bit SIMD intrinsics into 256-bit when possible?

Suppose I have this function: void test32(int* a, int* b, size_t n) { for (size_t i = 0; i < n; ++i) { a[i] = a[i] + b[i]; } } Clang and gcc both produce 256-bit SIMD when compiled ...
0votes
0answers
24views

What is the bare minimum for implementing VESA Graphics for my OS?

I'm working on a small OS, and I'm attempting to switch from VGA to VESA VBE for higher resolution picture output. I did lots of research, though in the end I was left very confused about how I even ...
  • 322
1vote
1answer
52views

What is the simplest way to get a higher resolution Graphics Mode?

I'm working on a little operating system, and I've decided that I've grown tired of VGA's 320x200 8-bit color limitations. I really don't want to refactor all my code, so my goal is implementing the ...
  • 322
0votes
0answers
25views

why is it moving the pointer into a register and not just using the pointer directly? "movl record_buffer_ptr, %eax"

the title says it all, why is it moving the pointer into a register and not just using the pointer directly? assembly in book "Programming From Ground Up Chapter 9": movl record_buffer_ptr, %...
-5votes
0answers
52views

Can machine code be converted into Assembly language using C language? [closed]

So here is my problem. I'm planning to write malware detection program in C and I would like to write a C program that takes machine code (binary) as an input and then converts it into a low level ...
0votes
1answer
30views

How to print the values after using the push and pop stack [duplicate]

I have a question about assembly. MOV AX,50 MOV BX,60 PUSH AX PUSH BX POP AX The value of AX is 60. My question is how can I print AX. Since all I know is: MOV AH,02 MOV DL,41 INT 21H I am having ...
0votes
0answers
37views

after calling proccess function - thread crashes

static DWORD DamagePlayerAddress = 0; __declspec(naked) int __stdcall CallDamagePlayer ( int weaponID, uintptr_t* entityParamsPtr, int damage ) { __asm { mov eax, [esp + 4]...
0votes
1answer
37views

How do I fix my double-buffer not drawing to screen?

I'm working on a small operating system, and I ran into some screen-tearing, so I'm working on double-buffering to solve that. I'm just now running into the issue that now nothing prints to screen ...
  • 322
0votes
1answer
65views

Why am I getting flickering in the display

I'm working on a simple operating system, and I've run into some issues with flickering in the output (see this clip). I'm pretty at a loss as to what could be causing this apart from perhaps an issue ...
  • 322
0votes
1answer
106views

Is the red zone a problem for inline assembly for 32-bit x86 with MSVC?

Does the red zone exist in x86 ? And even if not, can you explain to me by AMD64 ? Where is the red zone ? WIKI: "the red zone is a fixed-size area in a function's stack frame below the current ...
2votes
0answers
102views

how to switch CPL3 to CPL0

I write a bootloader which i want to switch to ring0 from ring3 by sofaware interrupt. but it don't work. org 0x7c00 mov dx,0x92 in al,dx or al,2 out dx,al mov eax,cr0 or eax,1 mov cr0,eax lgdt [...
0votes
1answer
42views

what is the purpose of "movl $0, %ebx" or getting 0 into ebx before an int $0x80 Linux SYS_EXIT?

I know that its getting 0 into ebx but why? I'm so sorry if it looks like a no-brainer question to you, its my first week of learning assembly and a few months of programming. I haven't included ...
-4votes
0answers
55views

How to deal with bomb lab with disassembling? [closed]

It has driven me crazy that I don't know what should be the argument to avoid bomb explosion. Can somebody helps me? Thanks a lot! Here's the result from (gdb)disas phase_1: │ 0x400ec0 <phase_1&...
1vote
0answers
54views

AMD Performance counters: `rdmsr` instruction seems to be blocking

I am currently reading the AMD Processor Programming Reference Manual to figure out how to enable and then read performance counters for AMD. It seems to me that in order to enable performance ...
1vote
1answer
43views

`test` vs `cmp` for one-bit registers comparison

In x86, when I have two registers, and I know both of them have only one bit turned on, and I want to know whether they're equal, I can use either test or cmp (cmp a, b will give zero when they're ...

153050per page