Hi awesomes~
Currently I am writing some assembly language procedures. As some convention says, when I want to return some value to the caller, say an integer, I should return it in the EAX register. Now I am wondering what if I want to return a float, a double, an enum, or even a complex struct. How to return these type of values?
I c...
I would like a simple example for how to do the following in in-line assembly, x86, visual studio
for (int i=1; i<N; ++i)
{
// do something
}
...
__asm
{
mov bl, byte [0x0068F51C]
call 0x004523C0
}
This code gives this error:
main.cpp(57): error C2400: inline assembler syntax error in 'second operand'; found '['
main.cpp(58): error C2415: improper operand type
Line 57 is the line with the mov instruction. I don't see what I'm doing wrong here, especially the call instruct...
Hello all. I'm having a MIPS issue here. What I'm trying to do is have the user input any number and have the program spell out the name of each digit in the number. So for example, the user inputs 495 and the machine would spell out "Four Nine Five". I'm trying to push each digit of the number onto the stack, then pop each one off. ...
I've been working in C and CPython for the past 3 - 5 years. Consider that my base of knowledge here.
If I were to use an assembly instruction such as MOV AL, 61h to a processor that supported it, what exactly is inside the processor that interprets this code and dispatches it as voltage signals? How would such a simple instruction like...
I know that add is faster as compared to mul function.
I want to know how to go about using add instead of mul in the following code in order to make it more efficient.
Sample code:
mov eax, [ebp + 8] #eax = x1
mov ecx, [ebp + 12] #ecx = x2
mov edx, [ebp + 16] #e...
We can use stuff like this in visual studio:
__asm
{
mov x1,offset thunk_begin;
mov x2,offset thunk_end;
}
But as quoted from here:
Since Visual Studio does not recognize
assembly code, Visual Studio will have
to be told what program to call to
compile the assembly code.
I'm really confused.
...
I am trying to store a value in the lParam of a LV_ITEM:
;...
mov eax, value
mov lvi.lParam, eax
invoke SendMessage, hList, LVM_INSERTITEM, 0 addr lvi
lvi is a (LOCAL) LV_ITEM, and hList is the handle of my ListView Control. If this item is now clicked, i try to read it's value:
invoke SendMessage,hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSE...
Hey guys,
The code below is just showing a Message Box on the screen.
The addresses are hardcoded to facilitate:
int main ()
{
asm("xorl %eax, %eax \n"
"xorl %ebx, %ebx \n"
"xorl %ecx, %ecx \n"
"xorl %edx, %edx \n"
"pushl %ecx \n" //$0x0
"pushl $0x20206...
So I'm dealing with a fat binary, and I'm trying to find the method offset for frame [FOOClass abcdMethod].
Using otool I get the __text segment addr and offset. The only problem is that offset in decimal given in the output equals the starting address of the __text segment.
My question is. How can someone deduct the offset of the me...
Does anyone know of an SSE ehanced version of libtiff? Even just an SSE enhanced version of a CCITT Group4 encoder would do, I could do the work of sliding that one in libtiff myself. I only need to work with bitonal images.
Thank you
...
Hi everyone,
As an experiment i am trying to write the following program which allows me to generate code during runtime. i.e. i do the following:
1. Fill a buffer with op-codes of the instructions i want to execute.
2. Declare a function-pointer and make it point to the start of the buffer.
3. Call the function using the above func-pt...
void foo(int a)
{ printf ("In foo, a = %d\n", a); }
unsigned char code[9];
* ((DWORD *) &code[0]) = 0x042444FF; /* inc dword ptr [esp+4] */
code[4] = 0xe9; /* JMP */
* ((DWORD *) &code[5]) = (DWORD) &foo - (DWORD) &code[0] - 9;
void (*pf)(int/* a*/) = (void (*)(int)) &code[0];
pf (6);
Anyone knows where in the ab...
0x042444FF; /* inc dword ptr [esp+4] */
0x042444FF is the machine code,while inc dword ptr [esp+4] is the assembly code, I know
machine code is NOT cross-platform,as it depends on many factors.
What about assembly code, does it depends on CPU ?
...
0x042444FF; /* inc dword ptr [esp+4] */
I need this tool to know which part means inc , dword or vice versa.
...
I'd like to copy and call a function, but the code below segfaults when calling the buffer. What do I have to change? (Linux, x86)
#include <string.h>
#include <malloc.h>
#include <stdio.h>
int foo () { return 12; }
void foo_end () {}
int main () {
int s = (unsigned long long) foo_end - (unsigned long long) foo;
int (*f) () = (int...
In the Call Stack window of visual studio, it reports:
[Frames below may be incorrect and/or missing, no symbols loaded for IPCamera.ax]
What does it mean by Frames, and why missing symbols may cause it incorrect?AFAIK,symbols are just for debugging info,missing symbols will only make the source invisible .
...
Hey I can program in C,little bit in Python and Pascal and I really want to learn assembly. I'm 18 and finishing high school, programming is my hobby because school work sure isn't much of a challenge.
I've downloaded a few books on Assembly they are: The Art of Assembly,Assembly for Beginners, Assembly for Complete Beginners and Wrox P...
move the contents of the register bx into the register ax
MOV ax, bx
Why is the syntax so strange?
Mov ax, (to) bx actually means move contents of bx to ax ,is there any historical reason to define it this way?
...
69A8AB13 int 3
69A8AB14 int 3
69A8AB15 mov edi,edi
69A8AB17 push ebp
69A8AB18 mov ebp,esp
mov edi,edi doesn't make sense for me,what's it for?
...