abi

What is the direction of stack growth in most modern systems?

你离开我真会死。 提交于 2019-11-26 00:46:13
问题 I am preparing some training materials in C and I want my examples to fit the typical stack model. What direction does a C stack grow in Linux, Windows, Mac OSX (PPC and x86), Solaris, and most recent Unixes? 回答1: Stack growth doesn't usually depend on the operating system itself, but on the processor it's running on. Solaris, for example, runs on x86 and SPARC. Mac OSX (as you mentioned) runs on PPC and x86. Linux runs on everything from my big honkin' System z at work to a puny little

What is an application binary interface (ABI)?

点点圈 提交于 2019-11-26 00:29:25
问题 I never clearly understood what an ABI is. Please don\'t point me to a Wikipedia article. If I could understand it, I wouldn\'t be here posting such a lengthy post. This is my mindset about different interfaces: A TV remote is an interface between the user and the TV. It is an existing entity, but useless (doesn\'t provide any functionality) by itself. All the functionality for each of those buttons on the remote is implemented in the television set. Interface: It is an \"existing entity\"

How do I safely pass objects, especially STL objects, to and from a DLL?

折月煮酒 提交于 2019-11-25 23:48:23
问题 How do I pass class objects, especially STL objects, to and from a C++ DLL? My application has to interact with third-party plugins in the form of DLL files, and I can\'t control what compiler these plugins are built with. I\'m aware that there\'s no guaranteed ABI for STL objects, and I\'m concerned about causing instability in my application. 回答1: The short answer to this question is don't . Because there's no standard C++ ABI (application binary interface, a standard for calling

Where is the x86-64 System V ABI documented?

若如初见. 提交于 2019-11-25 23:28:36
问题 The x86-64 System V ABI (used on everything except Windows) used to live at http://x86-64.org/documentation/abi.pdf, but that site has now fallen off the internet. Is there a new authoritative home for the document? 回答1: The System V x86-64 psABI is maintained on GitHub. H.J. Lu's github page has a wiki with links to the current versions of the x86-64 and i386 SystemV psABI documents, and to the forums where updates are discussed. See the x86 tag wiki for direct links to the latest versions.

智能合约编程语言-solidity快速入门(下)

时光毁灭记忆、已成空白 提交于 2019-11-25 22:57:10
上一篇: 智能合约编程语言-solidity快速入门(上) solidity区块及交易属性 在介绍区块及交易属性之前,我们需要先知道solidity中自带了一些全局变量和函数,这些变量和函数可以认为是solidity提供的API,这些 API 主要表现为Solidity 内置的特殊的变量及函数,它们存在于全局命名空间里,主要分为以下几类: 有关区块和交易的属性 ABI编码函数 有关错误处理 有关数学及加密功能 有关地址和合约 我们在编写智能合约的时候就可以通过这些API来获取区块和交易的属性(Block And Transaction Properties),简单来说这些API主要用来提供一些区块链当前的信息,下表列出常用的一些API: API 描述 blockhash(uint blockNumber) returns (bytes32) 返回给定区块号的哈希值,只支持最近256个区块,且不包含当前区块 block.coinbase (address) 获取当前块矿工的地址 block.difficulty (uint) 获取当前块的难度 block.gaslimit (uint) 获取当前块的gaslimit block.number (uint) 获取当前区块的块号 block.timestamp (uint) 获取当前块的Unix时间戳(从1970/1/1 00:00:00

What are the calling conventions for UNIX & Linux system calls on i386 and x86-64

为君一笑 提交于 2019-11-25 22:15:28
问题 Following links explain x86-32 system call conventions for both UNIX (BSD flavor) & Linux: http://www.int80h.org/bsdasm/#system-calls http://www.freebsd.org/doc/en/books/developers-handbook/x86-system-calls.html But what are the x86-64 system call conventions on both UNIX & Linux? 回答1: Further reading for any of the topics here: The Definitive Guide to Linux System Calls I verified these using GNU Assembler (gas) on Linux. Kernel Interface x86-32 aka i386 Linux System Call convention: In x86

What happens if you use the 32-bit int 0x80 Linux ABI in 64-bit code?

喜你入骨 提交于 2019-11-25 21:39:37
问题 int 0x80 on Linux always invokes the 32-bit ABI, regardless of what mode it\'s called from: args in ebx , ecx , ... and syscall numbers from /usr/include/asm/unistd_32.h . (Or crashes on 64-bit kernels compiled without CONFIG_IA32_EMULATION ). 64-bit code should use syscall , with call numbers from /usr/include/asm/unistd_64.h , and args in rdi , rsi , etc. See What are the calling conventions for UNIX & Linux system calls on i386 and x86-64. If your question was marked a duplicate of this,