x86

Estimating Cycles Per Instruction

混江龙づ霸主 提交于 2021-02-08 08:14:12
问题 I have disassembled a small C++ program compiled with MSVC v140 and am trying to estimate the cycles per instruction in order to better understand how code design impacts performance. I've been following Mike Acton's CppCon 2014 talk on "Data-Oriented Design and C++", specifically the portion I've linked to. In it, he points out these lines: movss 8(%rbx), %xmm1 movss 12(%rbx), %xmm0 He then claims that these 2 x 32-bit reads are probably on the same cache line therefore cost roughly ~200

Accessing the Program Segment Prefix

回眸只為那壹抹淺笑 提交于 2021-02-08 07:34:47
问题 I'm trying to access the Program Segment Prefix (PSP) in x86 MASM Assembler. As a test, I'd like to print the given command line arguments after running my program. I tried putting the address of the PSP in the dx register, with an offset of 81h : the position of the command line arguments. However, after running the program, I get this in return. I can see the given command line argument, but it is preceded by a lot of gibberish. Any idea why this is happening? I guess I'm not correctly

Setting LARGEADDRESSAWARE on a C# project with references?

依然范特西╮ 提交于 2021-02-08 06:51:53
问题 I have read here on how to set the LARGEADDRESSAWARE flag and this is done to my Windows Service. This Windows Service is however hosting a WCF service based on another project and this service is using library's and so on from other projects. I need the entire application to use the LARGEADDRESSAWARE, is it enouth to set it on the Window Service project(ServiceBase)? Or do I need to set it on all projects? At this point I can´t switch to 64bits so this will have to do. 回答1: It is not an

Setting LARGEADDRESSAWARE on a C# project with references?

邮差的信 提交于 2021-02-08 06:51:14
问题 I have read here on how to set the LARGEADDRESSAWARE flag and this is done to my Windows Service. This Windows Service is however hosting a WCF service based on another project and this service is using library's and so on from other projects. I need the entire application to use the LARGEADDRESSAWARE, is it enouth to set it on the Window Service project(ServiceBase)? Or do I need to set it on all projects? At this point I can´t switch to 64bits so this will have to do. 回答1: It is not an

Setting LARGEADDRESSAWARE on a C# project with references?

混江龙づ霸主 提交于 2021-02-08 06:51:05
问题 I have read here on how to set the LARGEADDRESSAWARE flag and this is done to my Windows Service. This Windows Service is however hosting a WCF service based on another project and this service is using library's and so on from other projects. I need the entire application to use the LARGEADDRESSAWARE, is it enouth to set it on the Window Service project(ServiceBase)? Or do I need to set it on all projects? At this point I can´t switch to 64bits so this will have to do. 回答1: It is not an

Required alignment of .text versus .data

让人想犯罪 __ 提交于 2021-02-08 06:50:59
问题 I've been toying around with the ELFIO library. One of the examples, in particular, allows one to create an ELF file from scratch – defining sections, segments, entry point, and providing binary content to the relevant sections. I noticed that a program created this way segfaults when the code segment alignment is chosen less than the page size (0x1000): // Create a loadable segment segment* text_seg = writer.segments.add(); text_seg->set_type( PT_LOAD ); text_seg->set_virtual_address(

Required alignment of .text versus .data

故事扮演 提交于 2021-02-08 06:50:21
问题 I've been toying around with the ELFIO library. One of the examples, in particular, allows one to create an ELF file from scratch – defining sections, segments, entry point, and providing binary content to the relevant sections. I noticed that a program created this way segfaults when the code segment alignment is chosen less than the page size (0x1000): // Create a loadable segment segment* text_seg = writer.segments.add(); text_seg->set_type( PT_LOAD ); text_seg->set_virtual_address(

Mapping Between LLVM IR and x86 Instructions

依然范特西╮ 提交于 2021-02-08 06:36:43
问题 Is there an easy way to map to LLVM instructions from their associated assembly instructions in the output binary? Given an instruction in an x86 binary, I would like to be able to determine with which LLVM IR instruction it is associated. One possibility would be to compile the binary with debug symbols turned on and then associate the instructions based off of source code line, but that seems like a hack and is prone to having a many-to-many mapping between x86 and LLVM IR when ideally it

Mapping Between LLVM IR and x86 Instructions

妖精的绣舞 提交于 2021-02-08 06:35:39
问题 Is there an easy way to map to LLVM instructions from their associated assembly instructions in the output binary? Given an instruction in an x86 binary, I would like to be able to determine with which LLVM IR instruction it is associated. One possibility would be to compile the binary with debug symbols turned on and then associate the instructions based off of source code line, but that seems like a hack and is prone to having a many-to-many mapping between x86 and LLVM IR when ideally it

int 13h doesn't appear to read sectors containing my kernel

眉间皱痕 提交于 2021-02-08 05:07:19
问题 I am trying to load up a little data using my bootloader on a USB, but apparently int 13h won't work! Bootloader: [bits 16] [ORG 0x7c00] jmp 0x0000:start start: cli xor ax, ax mov ss, ax mov sp, 0x7c00 mov ax, cs mov ds, ax mov es, ax mov fs, ax mov gs, ax sti mov [driveno], dl reset: ;reset drive xor ax, ax mov dl, [driveno] int 0x13 or ah, ah jnz reset mov ah, 0x02 mov al, 0x01 mov bx, 0x0000 mov es, bx mov bx, 0x7e00 mov dl, [driveno] xor dh, dh mov cx, 0x0002 int 0x13 or ah, ah jnz reset