calling-convention Questions

3

Solved

I am working with ARM assembly, where I have to write one subroutine for which I am following the ARM calling convention(this will have to be integrated with some separate higher level implementati...
Numerate asked 19/9, 2012 at 0:20

1

I'm currently doing a deep-dive into Assembly land, mainly from the perspective of x86_64, C, and System V AMD64, generally targeting Linux. It's pretty straightforward that the calling convention...
Wolter asked 9/9, 2019 at 19:3

3

Solved

1)How C structures get passed to function in assembly. I mean pass by value, not pass by reference. 2)By the way, how callees return structure to its callers? I'm so sorry for the poor expression ...
Bankhead asked 3/9, 2019 at 7:13

2

Solved

I'm trying to understand the implication of System V AMD64 - ABI for returning by value from a function. For the following data type struct Vec3{ double x, y, z; }; the type Vec3 is of class M...
Caxton asked 21/8, 2019 at 16:31

3

Solved

I try to understand the implication of System V AMD64 - ABI's calling convention and looking at the following example: struct Vec3{ double x, y, z; }; struct Vec3 do_something(void); void use(s...
Meredithmeredithe asked 6/8, 2019 at 13:34

1

Solved

When compiling the following code snippet (clang x86-64 -O3) std::array<int, 5> test() { std::array<int, 5> values {{0, 1, 2, 3, 4}}; return values; } It produced the typical assem...
Lassiter asked 19/6, 2019 at 12:56

2

Solved

I want to pass a parameter to an assembly function from C. On a UNIX-like system, the first six parameters go into rdi, rsi, rdx, rcx, r8, and r9. On Windows, the first four parameters go into r...
Charentemaritime asked 9/5, 2013 at 7:57

1

Solved

From the wikipedia x86 calling convention, it says that for the Microsoft x64 calling convention: The registers RBX, RBP, RDI, RSI, RSP, R12, R13, R14, and R15 are considered nonvolatile (calle...
Baudoin asked 27/3, 2019 at 22:39

1

In some circumstances, we use tags to discriminate between functions. A tag is usually an empty struct: struct Tag { }; Suppose that I have a function, which uses this tag: void func(Tag, int a...
Swoon asked 22/3, 2019 at 16:26

3

Solved

I believe I understand how the linux x86-64 ABI uses registers and stack to pass parameters to a function (cf. previous ABI discussion). What I'm confused about is if/what registers are expected to...
Byers asked 2/8, 2013 at 19:22

4

Solved

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/x...
Kopple asked 29/3, 2010 at 5:48

1

Solved

From the x86-64 psABI: 9.1 C++ For the C++ ABI we will use the IA-64 C++ ABI and instantiate it appropriately. The current draft of that ABI is available at: http://mentorembedded.github...
Illbehaved asked 23/11, 2018 at 12:47

2

Solved

I was reviewing some code and I came across something similar to this. File foo.c: int bar(int param1) { return param1*param1; } File main.c: #include <stdio.h> int bar(int param1, int...
Jaeger asked 22/11, 2018 at 15:25

1

I don't understand what the benefit of not passing a parameter in RAX, Since the return value is in RAX it is going to be clobbered by the callee anyway. Can someone explain?
Welldisposed asked 9/10, 2018 at 6:13

1

Solved

When I compile the following C source with gcc version 8.1.1, I get a warning: ‘stdcall’ attribute ignored [-Wattributes]. Why does gcc choose to ignore this attribute and what can I do to make it...
Pigeontoed asked 9/10, 2018 at 5:23

5

I want to know how passing arguments to functions in C works. Where are the values being stored and how and they retrieved? How does variadic argument passing work? Also since it's related: what ab...
Keck asked 9/12, 2010 at 7:9

1

In Assembly Language, Seventh Edition for x86 Processors by Kip Irvine, on page 211, it says under 5.53 The x86 Calling Convention which addresses the Microsoft x64 Calling Convention, When ca...
Mcabee asked 2/10, 2018 at 19:36

1

Solved

I am not quite familiar with assembly code. Excuse me if this question is naive. I have a simple C program: int f1(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9) { int c...
Kinaesthesia asked 28/9, 2018 at 3:8

2

Solved

I'm curious about the parameter passing procedure in the x86-64 environment and therefore I wrote a snippet of code. //a.c extern int shared; int main(){ int a=100; swap(&a, &shared); } ...
Circumflex asked 7/9, 2018 at 2:39

1

Solved

Why is it that 32-bit C pushes all function arguments straight onto the stack while 64-bit C puts the first 6 arguments into registers and the rest on the stack? So the 32-bit stack would look lik...
Josuejosy asked 22/8, 2018 at 23:26

2

I'm looking into porting a script engine written for Windows to Linux; it's for Winamp's visualization platform AVS. I'm not sure if it's even possible at the moment. From what I can tell the code ...
Treenatreenail asked 11/6, 2010 at 9:0

1

Solved

Why does al contain the number of vector parameters in assembly? Why are vector parameters any different from normal parameters for the callee?
Hower asked 23/7, 2018 at 23:55

1

Solved

Update: It seems that, the problem is coming due to protobuf. I am fine with other solution as well, which help me to fix the Google protobuf issues. This problem boils down to: How to integrate ...
Intermeddle asked 29/6, 2018 at 7:47

3

Solved

int max(int n, ...) I am using cdecl calling convention where the caller cleans up the variable after the callee returns. I am interested in knowing how do the macros va_end, va_start and va_ar...
Unthinkable asked 11/9, 2012 at 13:58

4

Solved

I'm working on the creation of an ActiveX EXE using VB6, and the only example I got is all written in Delphi. Reading the example code, I noticed there are some functions whose signatures are foll...
Myrtia asked 18/9, 2008 at 19:28

© 2022 - 2024 — McMap. All rights reserved.