x86-64

x86\\x64\\ia64的区别

ε祈祈猫儿з 提交于 2020-03-04 10:40:11
这几天做MDT时,总是会遇到x86\x64\ia64这几个文件夹。前两者很常见,自从Win7系统出现之后,经常会遇到。于是猜想ia64应该也是CPU的某种架构或版本。现对三者做了下总结。 x86或80x86是英特尔Intel首先开发制造的一种微处理器体系结构的泛称。该系列较早期的处理器名称是以数字来表示,并以“86”作为结尾,包括Intel 8086、80186、80286、80386以及80486,因此其架构被称为“x86”。x86架构于1978年推出的Intel 8086中央处理器中首度出现,它是从Intel 8008处理器中发展而来的,而8008则是发展自Intel 4004的。8086在三年后为IBM PC所选用,之后x86便成为了个人计算机的标准平台,成为了历来最成功的CPU架构,如Pentium、Athlon。现在,Intel把x86-32称为IA-32,全名为“Intel Architecture, 32-bit”。 x86-64架构诞生颇有时代意义。当时了,处理器的发展遇到了瓶颈,内存寻址空间由于受到32位CPU的限制而只能最大到约4G。AMD主动把32位x86(或称为IA-32)扩充为64位。它以一个称为AMD64的架构出现(在重命名前也称为x86-64),且以这个技术为基础的第一个产品是单内核的Opteron和Athlon 64处理器家族

IA64与x64的区别

徘徊边缘 提交于 2020-03-04 10:39:31
说到IA-64与x86-64可能很多人会比较陌生。不知道你在下载系统的时候有没有注意过,有的地方标注了x86/64/ia-64全版本等字样。那x86/x64/ia-64都是什么东西的版本呢?答案就是CPU。 系 统有x64,x86与ia-64三种版本之分,分别用于不同的CPU。较老的CPU只能安装x86版的系统,也就是我们常见的32位系统。因为微软的缘 故,32位系统在过去的很长一段时间内,占据着桌面计算机的主流地位。64位系统能够在较新的x86-64架构的CPU上运行。而ia-64则只能运行于 INTEL的安腾系列处理器。 x86:从1978年来的8086处理器开始,就已经出现了x86架构CPU,即32位处理器。 x86-64:又简称为x64,最初开发为1999年AMD,为了扩充IA64。当时的x86-64架构诞生颇有时代意义,处理器的发展遇到了瓶颈,内存寻址空间由于受到32位CPU的限制而只能最大到约4G。于是就有了x86-64。后被INTEL所采用。 ia- 64:其实ia64的历史早于x86-64x,最初由INTEL和惠普联合推出。由于ia-64不与32位兼容,所以没有受到重视。直到INTEL采用了 AMD的x86-64架构,才正式的批量生产。而后为了日益扩张的计算需求,INTEL重新将IA-64拿出来,发布了安腾系列服务器CPU。 虽然x86-64和IA

Purpose of rdi register for no argument function

别来无恙 提交于 2020-03-04 05:03:40
问题 Consider this simple function: struct Foo { int a; int b; int c; int d; int e; int f; }; Foo foo() { Foo f; f.a = 1; f.b = 2; f.c = 3; f.d = 4; f.e = 5; f.f = 6; return f; } It generates the following assembly: 0000000000400500 <foo()>: 400500: 48 ba 01 00 00 00 02 movabs rdx,0x200000001 400507: 00 00 00 40050a: 48 b9 03 00 00 00 04 movabs rcx,0x400000003 400511: 00 00 00 400514: 48 be 05 00 00 00 06 movabs rsi,0x600000005 40051b: 00 00 00 40051e: 48 89 17 mov QWORD PTR [rdi],rdx 400521: 48

个人环境之ubuntu的apt-get 总结

纵饮孤独 提交于 2020-02-28 03:45:49
前言 apt-get是必须要学会的,如果搞定apt-get,可解决很多问题。接下来鸟才啊总结以往经验。 场景一 指定安装版本 先查看有软件有那些版本可以安装 apt-cache madison gcc-4.8 gcc-4.8 | 4.8.5-4ubuntu8 | http://mirrors.aliyun.com/ubuntu bionic/universe amd64 Packages gcc-4.8 | 4.8.5-4ubuntu8 | http://mirrors.aliyun.com/ubuntu bionic/universe Sources apt-get install -y gcc-4.8=4.8.5-4ubuntu8 场景二 查看那些软件可以安装 apt list // 输出太多了 apt list | grep g++ 场景三 安装gcc g++ 安装gcc,g++ 太麻烦了。第一个是版本太多,第二个同软件的依赖的版本不同,第三没有搞清楚原理,浪费大量的时间。 先查gcc的版本 apt list | grep "g++" WARNING: apt does not have a stable CLI interface. Use with caution in scripts. g++/bionic 4:7.3.0-3ubuntu2 amd64 g++-4.8

Finding an efficient shift/add/LEA instruction sequence to multiply by a given constant (avoiding MUL/IMUL)

假装没事ソ 提交于 2020-02-24 09:59:45
问题 I'm trying to write a C program mult.c that has a main function that receives 1 int argument (parsed with atoi(argv[1]) ), that is some constant k we want to multiply by. This program will generate an assembly file mult.s that implements int mult(int x) { return x * k; } for that constant k . (This is a followup to Efficient Assembly multiplication) For example: if main() in mult.c gets 14 as argument it may generate (though it is not minimal as later emphasized): .section .text .globl mult

Efficiently check an FP bit-pattern for being a whole integer. Faster to branch once on a combination of conditions?

吃可爱长大的小学妹 提交于 2020-02-24 09:05:06
问题 I have the next ASM code: mov r10 , 9007199254740990 ; mask mov r8 , rax shr r8 , 53 sub r8 , 1023 cmp r8 , 52 ; r8 - 52 < 0 setnb ch shrx r11 , r10 , r8 and r11 , rax setne cl ; r11 == 0 test rcx , rcx jz @C_2 ret @C_2: ; integer ret Well, here we have only one branch instruction. And we can rewrite this code by replacing SETcc instructionos on corresponding Jump instructions, and thus we'll get two branch instructions in the code above. My question is, which code will run faster in common

Can ptrace tell if an x86 system call used the 64-bit or 32-bit ABI?

倾然丶 夕夏残阳落幕 提交于 2020-02-24 04:46:04
问题 I'm trying to use ptrace to trace all syscalls made by a separate process, be it 32-bit (IA-32) or 64-bit (x86-64). My tracer would run on a 64-bit x86 installation with IA-32 emulation enabled, but ideally would be able to trace both 64-bit and 32-bit applications, including if a 64-bit application forks and execs a 32-bit process. The issue is that, since 32-bit and 64-bit syscall numbers differ, I need to know whether a process is 32-bit or 64-bit to determine which syscall it used, even

Return a float from a 64-bit assembly function that uses x87 FPU

隐身守侯 提交于 2020-02-20 11:43:50
问题 I am trying to make a program that calculates equations (what equation doesn't matter currently) that use 64-bit registers, floats, and coprocessor instructions. Unfortunately I don't know how to access the final outcome of the equation as a float. I can do: fist qword ptr [bla] mov rax,bla and change the function type to INT and get my value, but I cannot access it as a FLOAT. Even when I leave the result in ST(0) (the top of the coprocessor stack) it doesn't work as expected and my C++

Why do i have this problem with breakpoints on GDB? GDB Stops

吃可爱长大的小学妹 提交于 2020-02-16 10:27:20
问题 I tried to set a break-point on GDB when a function strcpy() is called, but GDB stops, and i don't know how to find the error, im new to GDB and i want to study binary exploitation, so the forum i'm reading does not explain nothing about this, here is the output; (gdb) disassemble main Dump of assembler code for function main: 0x00000000000011c9 <+0>: endbr64 0x00000000000011cd <+4>: push rbp 0x00000000000011ce <+5>: mov rbp,rsp 0x00000000000011d1 <+8>: sub rsp,0x50 0x00000000000011d5 <+12>:

gdb behaves differently for symbols in the .bss, vs. symbols in .data

流过昼夜 提交于 2020-02-15 08:34:27
问题 I recently started learning assembly language for the Intel x86-64 architecture using YASM. While solving one of the tasks suggested in a book (by Ray Seyfarth) I came to following problem: When I place some characters into a buffer in the .bss section, I still see an empty string while debugging it in gdb. Placing characters into a buffer in the .data section shows up as expected in gdb. segment .bss result resb 75 buf resw 100 usage resq 1 segment .data str_test db 0, 0, 0, 0 segment .text