x86

Instructions appended to end of assembly

孤者浪人 提交于 2021-02-09 09:21:46
问题 I am trying to follow this tutorial for creating a binary file, but the linker appears to be appending additional instructions at the end of the assembly. I assume this is the OS's tear-down process. The tutorial attempts to compile a bare bones 32-bit C program on Linux: int main() { } using these commands: gcc -c test.c ld -o test -Ttext 0x0 -e main test.o objcopy -R .note -R .comment -S -O binary test test.bin ndisasm -b 32 test.bin I am running 64-bit Linux, and hence modified the

Instructions appended to end of assembly

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-09 09:21:25
问题 I am trying to follow this tutorial for creating a binary file, but the linker appears to be appending additional instructions at the end of the assembly. I assume this is the OS's tear-down process. The tutorial attempts to compile a bare bones 32-bit C program on Linux: int main() { } using these commands: gcc -c test.c ld -o test -Ttext 0x0 -e main test.o objcopy -R .note -R .comment -S -O binary test test.bin ndisasm -b 32 test.bin I am running 64-bit Linux, and hence modified the

Instructions appended to end of assembly

吃可爱长大的小学妹 提交于 2021-02-09 09:20:15
问题 I am trying to follow this tutorial for creating a binary file, but the linker appears to be appending additional instructions at the end of the assembly. I assume this is the OS's tear-down process. The tutorial attempts to compile a bare bones 32-bit C program on Linux: int main() { } using these commands: gcc -c test.c ld -o test -Ttext 0x0 -e main test.o objcopy -R .note -R .comment -S -O binary test test.bin ndisasm -b 32 test.bin I am running 64-bit Linux, and hence modified the

Do denormal flags like Denormals-Are-Zero (DAZ) affect comparisons for equality?

允我心安 提交于 2021-02-08 19:42:57
问题 If I have 2 denormal floating point numbers with different bit patterns and compare them for equality, can the result be affected by the Denormals-Are-Zero flag, the Flush-to-Zero flag, or other flags on commonly used processors? Or do these flags only affect computation and not equality checks? 回答1: DAZ (Denormals Are Zero) affects reading input, so DAZ affects compares . All denormals are literally treated as -0.0 or +0.0 , according to their sign. FTZ (Flush To Zero) affects only writing

Do denormal flags like Denormals-Are-Zero (DAZ) affect comparisons for equality?

被刻印的时光 ゝ 提交于 2021-02-08 19:42:39
问题 If I have 2 denormal floating point numbers with different bit patterns and compare them for equality, can the result be affected by the Denormals-Are-Zero flag, the Flush-to-Zero flag, or other flags on commonly used processors? Or do these flags only affect computation and not equality checks? 回答1: DAZ (Denormals Are Zero) affects reading input, so DAZ affects compares . All denormals are literally treated as -0.0 or +0.0 , according to their sign. FTZ (Flush To Zero) affects only writing

How to write into XMM Registers in LLDB

别等时光非礼了梦想. 提交于 2021-02-08 19:38:04
问题 I am trying to read and write values from registers in python using the LLDB API. For the General Purpose Registers, I have been using the frame.register['register name'].value to read and write register values, which works successfully for me. However, as I approach the Floating Point Registers, I found that this could not be done anymore, as some of the registers, such as the XMM registers do not have a value attribute e.g frame.register['xmm0'].value would return None . I have looked into

How safe is this swap w/o pushing registers?

这一生的挚爱 提交于 2021-02-08 15:18:30
问题 I'm very new to Assembly and the code below is supposed to swap two integers via two different functions: first using swap_c and then using swap_asm . However, I doubt, whether I need to push (I mean save) each value of registers before assembly code and pop them later (just before returning to main ). In other words, will the CPU get mad at me if I return different register content (not the crucial ones like ebp or esp ; but, just eax , ebx , ecx & edx ) after running swap_asm function? Is

How safe is this swap w/o pushing registers?

走远了吗. 提交于 2021-02-08 15:18:21
问题 I'm very new to Assembly and the code below is supposed to swap two integers via two different functions: first using swap_c and then using swap_asm . However, I doubt, whether I need to push (I mean save) each value of registers before assembly code and pop them later (just before returning to main ). In other words, will the CPU get mad at me if I return different register content (not the crucial ones like ebp or esp ; but, just eax , ebx , ecx & edx ) after running swap_asm function? Is

How safe is this swap w/o pushing registers?

守給你的承諾、 提交于 2021-02-08 15:17:18
问题 I'm very new to Assembly and the code below is supposed to swap two integers via two different functions: first using swap_c and then using swap_asm . However, I doubt, whether I need to push (I mean save) each value of registers before assembly code and pop them later (just before returning to main ). In other words, will the CPU get mad at me if I return different register content (not the crucial ones like ebp or esp ; but, just eax , ebx , ecx & edx ) after running swap_asm function? Is

Are memory orderings: consume, acq_rel and seq_cst ever needed on Intel x86?

北战南征 提交于 2021-02-08 14:36:43
问题 C++11 specifies six memory orderings: typedef enum memory_order { memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, memory_order_acq_rel, memory_order_seq_cst } memory_order; https://en.cppreference.com/w/cpp/atomic/memory_order where the default is seq_cst. Performance gains can be found by relaxing the memory ordering of operations. However, this depends on what protections the architecture provides. For example, Intel x86 is a strong memory model and