calling-convention

Delete call from call log after call end

柔情痞子 提交于 2019-12-17 10:46:05
问题 I am new to Android development. I want to make a call to a number but I don't want to store the number in my Call log. How can I delete the number from call log after the call ends? 回答1: First you have to set up a broadcast receiver to detect the phone state. Here's the exact same question: Stackoverflow - Intent to be fired when a call ends? And now for deleting the call log entry, here is the first link on google: Call log deletion in Android In the example he deletes all call entry for a

Segmentation fault on printf - NASM 64bit Linux

不问归期 提交于 2019-12-17 07:51:15
问题 I trying to input four floats using scanf , store them onto the stack, and then use vmovupd to copy them over to a register for use. My problem is when I try to output those 4 numbers, the program seg faults at printf . I presume it is something with the stack but I've tried popping numerous times (multiple instructions at once) to no avail. I'm still new to Assembly coding so using gdb is a bit too advanced for me. You will notice that I have included a file called debug . It allows me to

Segmentation fault on printf - NASM 64bit Linux

怎甘沉沦 提交于 2019-12-17 07:51:04
问题 I trying to input four floats using scanf , store them onto the stack, and then use vmovupd to copy them over to a register for use. My problem is when I try to output those 4 numbers, the program seg faults at printf . I presume it is something with the stack but I've tried popping numerous times (multiple instructions at once) to no avail. I'm still new to Assembly coding so using gdb is a bit too advanced for me. You will notice that I have included a file called debug . It allows me to

What is the calling convention for the main function in C?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 01:36:39
问题 Each function in C must have a calling convention, but what is the calling convention for the main function (I think it is the cdecl calling convention but I am not sure)? 回答1: That depends on the architecture and platform. A lot of x86 C runtime specifications require that main be cdecl , but it's by no means guaranteed. The bottom line is you're not going to find this information in the C standard because the language is not tied to any one architecture. You might have more luck reading the

Indexing args as an array in the Windows x86-64 ABI [closed]

只愿长相守 提交于 2019-12-14 00:08:52
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I'm trying to port a wrapper function from 32bit to x86-64 asm for the Windows ABI. The function depends on indexing into its arguments as an array. I know that MSVC cannot do inline assembly in X64 projects, but i am interested to build the equivalent function into a X64 .asm

Why Assembly x86_64 syscall parameters are not in alphabetical order like i386

末鹿安然 提交于 2019-12-12 17:43:13
问题 There is that one question that troubles me. So ... Why in x86_32 the parameters are passed in registers that I feel are in alphabetically ( eax , ecx , edx , esi ) and ranked order ( esi , edi , ebp ) +---------+------+------+------+------+------+------+ | syscall | arg0 | arg1 | arg2 | arg3 | arg4 | arg5 | +---------+------+------+------+------+------+------+ | %eax | %ebx | %ecx | %edx | %esi | %edi | %ebp | +---------+------+------+------+------+------+------+ section .text global _start

VB6 declaration for C++ function gives “Bad DLL calling convention”

廉价感情. 提交于 2019-12-12 04:59:50
问题 What is the correct VB6 declaration for this C++ function? LPCWSTR* MW_ListReaders(_ULONG Context, int* NumberOfReaders); The following gave me "Bad DLL calling convention": Private Declare Function ListReaders Lib "MyDLL.dll" (ByVal Context As Long, _ ByRef NumberOfReaders As Integer) As Long 回答1: There is no calling convention specified in that C++ declaration. Most C/C++ compilers default to __cdecl . If the function does actually use __cdecl then you will not be able to call it in VB6:

How to set function arguments to execute different set of m-files?

半世苍凉 提交于 2019-12-12 03:28:21
问题 I am using Matlab. I have a main function main.m . And I have two sets of m-files, named: Set A = {Area_triangle.m, Perimeter_triangle.m} Set B = {Area_square.m, Perimeter_square.m} Is there any methods such that it can achieve main(triangle) can execute m-files in set A while main(square) can execute m-files in set B? Thanks in advance 回答1: To run a Matlab-script stored in an m-file, you can use run . With a switch-statement, it's easy to determine which set should be used. Then we can

How do I compile boost using __cdecl calling convention?

最后都变了- 提交于 2019-12-12 01:54:59
问题 I have a project compiled using __cdecl calling convention (msvc2010) and I compiled boost using the same compiler using the default settings. The project linked with boost but I at runtime I got an assert message like this: File: ...\boost\boost\program_options\detail\parsers.hpp Line: 79 Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer

gcc 4.7.2 in Debian wheezy doesn't always properly align stack pointer. Is this a bug?

老子叫甜甜 提交于 2019-12-12 01:43:57
问题 Casually, when reading the assembler listing of a sample C program, I noted that the stack pointer is not 16 bit aligned before calling function foo: void foo() { } int func(int p) { foo(); return p; } int main() { return func(1); } func: pushq %rbp movq %rsp, %rbp subq $8, %rsp ; See here movl %edi, -4(%rbp) movl $0, %eax call foo movl -4(%rbp), %eax leave ret The subq $8, %rsp instruction makes RSP not aligned before calling foo (it should be "subq $16, %rsp"). In System V ABI, par. 3.2.2,