Definition and erasing of flags

I'm having trouble trying to set a zero flag. I have done some research online but it has come to confuse me even more. Correct me if I'm wrong but it's my understanding that you can use MOV, ADD, SUB, INC, and DEC and set and clear flags? So would s

Convert Pentium II synchronization code to online assembly?

I am trying to use the following code in GCC. It is throwing errors(I guess because of __asm). Why is this simple and easy format is not working in GCC? Syntax of extended assembly is provided here. I am getting confused, when it comes to use of more

Does not include displacement, rotation and FALA

For example, this is the assignment I have Write an HLA Assembly program that prompts for an int8 value to inspect and then prints it in binary format. For example, here would be the program output for various entered values Gimme a decimal value to

Access to memory with gdb, for assembly code?

I'm currently debugging a simple c program, and was wondering about this assembly comparison: cmpl $0x1d,-0xc(%ebp) From what I gather, this is checking 29 against a location in memory. How do I access this in gdb with the print or x commands? Is it

X86 assembly call label at a string address

I'm not sure if anything like this is possible with x86 assembly but can I mov eax, string call string my_funct: mov ebx, hi_msg call puts32 ;say hi ret string db 'my_funct', 0 hi_msg db 'Hi', 0 I understand that I want to call the label at an addres

x86 casual performance control?

Since intel provides strong hardware memory model, is there any advantage at all to using "memory_order_relaxed" in a C++11 program? Or just leave it at default "sequential consistent" since it makes no difference?That largely comes do

Code C represented as assembly code - How to interpret?

I got this short C Code. #include <stdint.h> uint64_t multiply(uint32_t x, uint32_t y) { uint64_t res; res = x*y; return res; } int main() { uint32_t a = 3, b = 5, z; z = multiply(a,b); return 0; } There is also an Assembler Code for the given C cod

ELF x86 disassembler disassembling to Intel Syntax

Is there a Disassembler that runs on Linux that has the capacity of disassembling x86 ELF executables to assembly code in the Intel syntax (i.e. operation destination register, source register; etc.)? Preferably the output disassembler would be fairl

CPU instruction sets for linear algebra?

I'm in a situation where I have to perform some linear algebra calculations with a matrix that almost never changes and a lot of small vectors ( very very few 3x3 or 4x4 matrices and vectors with 3 values ) in C++, I was thinking about using some CPU

CLI and STI do not work

I am an beginner in x86 assembly. I have compiled a small operating system (compiled with nasm onto a floppy disk), and I am having some trouble with it. This operating sysem is designed to turn on Caps, Scroll, and Num Lock, then wait for half of a

How do I know if I can compile with FMA instruction sets?

I have seen questions about how to use FMA instructions set but before I get to start using them, I'd first like to know if I can (does my processor support them). I found a post saying that I needed to look at the output of (working on Linux): more

I want to create a simple assembler in C. Where should I start?

This question already has an answer here: Building an assembler 4 answers How Do You Make An Assembler? [closed] 4 answers I've recently been trying to immerse myself in the world of assembly programming with the eventual goal of creating my own prog

Problems with ATOI in the Linux x86 NASM assembly

I don't understand how to convert a string to an integer. This is for homework, but I do not want answers to the problem -- (AKA Correct code). I'd really appreciate it if someone could explain just what it is that i'm doing wrong! :( Thanks in advan

to implement 64-bit arithmetic on a 32-bit machine

The following code computes the product of x and y and stores the result in memory. Data type ll_t is defined to be equivalent to long long. typedef long long ll_t; void store_prod(ll_t *dest, int x, ll_t y) { *dest = x*y; } gcc generates the followi

NASM programming, a starter guide?

I am interested in programming assembler for Intel x86 architecture and on Linux. After some initial research this lead me to believe out of FASM, NASM and MASM I wanted NASM. From this point on, how easy is it to write a NASM assembler "text file&qu

Calling C code from a boot loader

I'm trying to write a bootloader. I would like to compile some C code so the bootloader can load it into memory and jump there. I have two questions: Is the calling convention the same as on x86? Namely, arguments on stack, left to right. How do I pr

Translate ASM to Delphi Style in English?

A recent Delphi project i've inherited has a procedure in ASM. I'm a complete ASM newbie, so i dont understand it. I've read up on the various ASM instructions to try and decipher the procedures flow, but i still dont get it. Could someone with ASM e

encoding order of x86 instruction prefix bytes

I know that x86 instructions can have a maximum of 4 bytes of prefixes, e.g Lock, rep, segment overrides etc. Is there any particular order in which they should appear, in case multiple prefixes are used?the order can be found in volume 2A of the Int

Representation at the machine level

I'm doing this project and this particular portion is confusing me. We are given this machine level representation and it will read six numbers that I have to figure out. So far I know that this is a loop and it will iterate until it reaches it's sto

Are there real-time open source operating systems for x86?

Are there any open source real time operating systems out there? I've heard of real-time Linux, but most implementations seem to really be a proprietary RTOS (that you have to pay for) that run Linux as a process -- much the same way Ardence's RTX re