[Solved] how to input floating point numbers in assembly language… and how to add subtract and multiply these floating point numbers [closed]

how to input floating point numbers in assembly language… and how to add subtract and multiply these floating point numbers [closed] solved how to input floating point numbers in assembly language… and how to add subtract and multiply these floating point numbers [closed]

[Solved] Spectre: Is SIMD the reason?

No, the “high-end” feature that matters on those ARM CPUs is out-of-order execution, with branch-prediction + speculative execution. In-order CPUs with NEON (like Cortex A-53) aren’t on the list of affected CPUs, because Spectre depends on speculative execution. Spectre primes the branch predictors so an indirect branch in privileged code is mispredicted to go somewhere … Read more

[Solved] function returns address of local variable, but it still compile in c, why?

Even I get an warning a function returns an address from local variable, it compiles. Isn’t it then UB of compiler? No, but if it were, how could you tell? You seem to have a misunderstanding of undefined behavior. It does not mean “the compiler must reject it”, “the compiler must warn about it”, “the … Read more

[Solved] What is the most efficient way to zero all bits below the most significant set bit?

There’s no single instruction that can do this. BMI1 blsi dst,src can isolate the lowest set bit, not the highest. i.e. x & -x. If x86 had a bit-reversed version of blsi, we could use that, but it doesn’t. But you can do much better than what you were suggesting. An all-zero input is always … Read more

[Solved] Does AT&T syntax work on intel platform?

att vs intel syntax has been covered many times, here and other places. Assembly language is a language defined by the assembler, the particular program used to convert the ASCII assembly language into machine code for the particular target you are interested in. Unlike say a C or C++ compiler where there is a standard … Read more

[Solved] x86 assembly – masm32: absolute breakdown of multiplication and division [closed]

The answer to this question can be very easily found by looking at the proper page of the Intel 64 and IA-32 Instruction Set Reference. In this case, you’re looking for the MUL and DIV instructions (in case you’re operating on unsigned operands) or IMUL and IDIV instructions, which are used for signed integer multiplication … Read more

[Solved] Should all code compiled for 32 bit machines be in 4 byte chunks?

Instruction size does not related to data or address bus size. Some 16-bit x86 CPUs have 3 totally different sizes with 8-bit data bus, 20-bit address bus and variable length instruction size. Modern 32-bit or 64-bit x86 have variable length instruction too for backward compatibility. Just look at the movl $0x542412e6, %eax and pushl 0x08048dd6 … Read more