Hi all,
I would like to do some "inline" assemly programming in Sparc and I am wondering how I can do that with register passing.
Best to explain my issue with a small example
int main()
{
int a = 5;
int b = 6;
int res;
asm_addition(a,b);
printf("Result: %d\n", res);
return(0);
}
// My assembler addition
.global...
Hey Guys, I'm hoping someone will be able to help troubleshoot what I think is a linker script issue.
I'm encountering a strange problem after adding a call to a new function. Without the function call, my object files link correctly, however, with the new function call added, I get an undefined reference to a symbol from another object...
I'm working with the llvm-clang compiler, compiling simple C functions down to assembly on an ARMv7-A processor. I am trying to figure out what this instruction does.
SUB sp, sp, #65, 30
Obviously it's making room on the stack pointer for some local variables, but I've never seen an ARM SUB instruction with four operands. I'm guessin...
In X86 assembly, is it possible to clear the Parity Flag in one and only one instruction, working under ANY initial register configuration?
This is equivalent to creating a result register with an ODD number of bits, with any operation that sets flags (expressly excluding "mov").
For contrast, setting the parity flag can be done in o...
How to write an instruction that clears bits 0 and 1 in the AL register using assembly?
...
how can i write a string (eg. "Hello") to stdout from the stack? without, data-segments, that is.
void main() {
__asm__(
"movl $0x4, %eax \n\t"
"movl $0x1, %ebx \n\t"
// put "Hello" on the stack and load its address into %ecx
"movl $0x5, %edx \n\t"
...
This question is asked because the author is building a compiler (src -> asm) and is in the process of writing code for generating assembly code.
One of the first things that happens when a program executes on a Linux (any OS really) based operating system is that the stack gets set up and the SP register is assigned with the memory add...
Hi,
I would like to have this x86 ASM code ported to C or C++, as I don't understand ASM =)
Searching Google it seams Relogix and IDA Pro can do it. But I don't suppose they are cheap, given I only have this one source.
Understanding the math or the algorithm how it works would be just as good, as I am going to use OpenGL anyway.
Are...
I don't understand why this code
#include <iostream>
using namespace std;
int main(){
int result=0;
_asm{
mov eax,3;
MUL eax,3;
mov result,eax;
}
cout<<result<<endl;
return 0;
}
shows the following error.
1>c:\users\david\documents\visual studio 2010\projects\assembler_instructions\ass...
suppose i have a following program
[org 0x100]
jmp start
kbisr:........
..............
............
............
iret
start: ..........
...............
;now to reside the portion of program that is above the start lable what i do is
mov dx,start
add dx,15
mov cl,4
shr dx,cl
mov ax,0x3100
int 0x21
Now Suppose the offset of start is 01...
Hi,
I have a problem about counting the length of a string.
I always get some number like 2432, thou I pass a string like "abc".
I think the problem is in this line
mov bl, byte [esi]
but I would not know why.
Maybe it is something with character length in bits?
Could the problem be a 64bit operating system or dual core processor? ...
Hello,
I have messed around a few times by making a small assembly boot loader on a floppy disk and was wondering if it's possible to make a boot loader in c++ and if so where might I begin? For all I know im not sure it would even use int main().
Thanks for any help.
...
I am writing an editor in assembly 64bit mode in linux.It runs correctly when I debug the program in GDB but it does not run correctly when I run it normally it means it has runtime errors when I use ./programName .
...
In principle, squaring the value of a register isn't hard:
mov ax, [var]
mov cx, [var]
mul cx // square of answer is in DX:AX
But I got to thinking -- the course that I'm learning Assembly for prizes efficiency very highly; a difference of even a single line less could be worth up to 5 points.
I realize this is micro-optimiza...
Well, I am studing some inline assembly in Delphi and the assembly crypto routine is all going great, until I try to parse the ShortString into the Textbox.
The violation I get is as follows:
The full code is here:
procedure TForm2.Button1Click(Sender: TObject);
var
len,keylen:integer;
name, key:ShortString;
begin
name := ShortSt...
Edit: Answered my own question. See below. -_-
I have a variable defined in the .data segment as follows:
retVal DW 0100h ;stores hex fraction of the intermediate value. Starts at 1.00
This is the value that I add or subtract to to get my return value.
The first time it shows up in the code segment is at the following point:
sub [...
I can't seem to figure out what eax contains after this peice of assembly:
mov edi, [edi+4]
lea eax, [edi+88h]
With edi pointing to a class
...
So I've never done any assembly programming (although I did some reading/reasoning out the results from small segments of x86 and arm assembly in CS classes).
I'm sort of curious how people do serious assembly programming both in the days when c/other (barely) high level languages were considered too slow and today.
Do people use Hig...
Is it common for compilers (gcc for instance) to generate an instruction that loads some empty memory element into a register? Like... lw at,0(sp) where memory[sp + 0] = 0. This basically just places 0 into $at ($R1.) I ask because I'm looking through an executable file's hex dump (executable file is the result of the compilation of a...
When I was in the sixth grade, my parents purchased for me a TI-86 graphing calculator. I recall that it was purchased on the same day that "Titanic" on DVD went on sale in the United States. In the years that followed I learned that although the device is advertised as a graphing calculator, it really is a pocket-sized portable compute...