x86

MIPS processors : Are they still in use? Which other architecture should I learn?

I've been programming for x86 & x86-64 in assembly language for few months. Now, I want to move on to some different kind of processors. MIPS, SPARC, PowerPC, Itanium, ARM of these I found ARM is being widely use. But the books I see that tutorials & books teach about MIPS more than all these other architectures. Why is MIPS so popul...

GCC/X86, Problems with relative jumps

I'm trying to do a relative jump in x86 assembly, however I can not get it to work. It seems that for some reason my jump keeps getting rewritten as an absolute jump or something. A simple example program for what I'm trying to do is this: .global main main: jmp 0x4 ret Since the jmp instruction is 4 bytes long and a relativ...

x86 assembly abs() implementation?

I need to get the difference of 2 signed integers. Is there an ABS() function in x86 assembly language so I can do this. Any help would be greatly appreciated. ...

Sort an array via x86 Assembly (embedded in C++)?? Possible??

I am playing around with x86 assembly for the first time and I can't figure out how to sort an array (via insertion sort).. I understand the algorithm, but assembly is confusing me as I primarily use Java & C++. Heres all I have so far int ascending_sort( char arrayOfLetters[], int arraySize ) { char temp; __asm{ push eax ...

Why does this 'hello world' x86 bootloader code written for NASM work without the [BITS 16] and [ORG 0x7C00] directives?

push word 0b800h pop es xor di, di mov [es:di], word 441h jmp $ times 510 - ($-$$) db 0 db 55h db 0AAh ...

Visual Studio 2010 Download?

Hi Guys, Generally wondering if there are multiple versions of Visual Studio 2010 to download i.e. I can only find x86 and unsure if this is the version I want for Win7 x64 [which I am running] Are there multiple versions available or is the only release version x86 which just install x64 components? ...

Illegal instruction in Assembly

I really do not understand why this simple code works fine in the first attempt but when putting it in a procedure an error shows: NTVDM CPU has encountered an illegal instruction CS:db22 IP:4de4 OP:f0 ff ff ff ff The first code segment works just fine: .model small .stack 100h .code start: mov ax,@data mov ds,ax mov es,ax ...

x86 assembly idioms

I've been trying to get a good hold on the x86 assembly language, and was wondering if there was a quick-and-short equivalent of movl $1, %eax. That's when I thought that a list of idioms used frequently in the language would perhaps be a good idea. This could include the preferred use of xorl %eax, %eax as opposed to movl $0, %eax, or ...

reading from File in assembly

i am trying to read a username and a password from a file in x86 assembly for the perpose of authentication obviously the file consists of two lines , the user name and the password how can i read the two lines seperately and compare them? My attempt: proc read_file mov ah,3dh lea dx,file_name int 21h mov bx, ax xor si,si ...

running x86 program _on_ llvm

Is it possible to use llvm to run x86 programs? I.e. I want to use llvm as an x86 simulator to run x86 programs and then instrument the x86 program. Thanks! ...

Change an array's value in x86 assembly (embedded in C++)

I am messing around with assembly for the first time, and can't seem to change the index values of an array. Here's the method I am working on int ascending_sort( char arrayOfLetters[], int arraySize ) { char temp; __asm { //??? } } And these are what I tried mov temp, 'X' mov al, temp mov arrayOfLetters[0], al ...

Help improving a simple assembly function

I just handed in this function in an assignment. It is done (hence no homework tag). But I would like to see how this can be improved. Essentially, the function sums the squares of all the integers between 1 and the given number, using the following formula: n(n+1)(2n+1)/6 Where n is the maximum number. The function below is made to...

How can I write a "Hello World" app in assembly language?

Possible Duplicate: how to write hello world in assembler under windows? I've often heard of applications written using the language of the gods, assembly language. I've never tried though, and I don't even have a clue how to do it. If I wanted to dabble, how would I go about doing it? I know absolutely nothing about what is ...

The WeTab will run Android applications but uses an Atom CPU. What does this mean for NDK and MonoDroid?

I'm guessing MonoDroid compiles directly into ARM code. And the NDK, too. ...

Question about the Intel's IA-32 software developer manual

I'm studying the Intel's IA-32 software developer manual. In particular, I'm reading the following manual: http://www.intel.com/Assets/PDF/manual/253666.pdf. Let's take for example the ADD instruction. On page 79 it is written that you can add an r8 (8-bit register) to an r/m8 (8-bit register or memory location). A few rows below, it is ...

how to know location of return address on stack c/c++

i have been reading about a function that can overwrite its return address. void foo(const char* input) { char buf[10]; //What? No extra arguments supplied to printf? //It's a cheap trick to view the stack 8-) //We'll see this trick again when we look at format strings. printf("My stack looks like:\n%p\n%p\n%p\n%p\n...

Will fixed-point arithmetic be worth my trouble?

I'm working on a fluid dynamics Navier-Stokes solver that should run in real time. Hence, performance is important. Right now, I'm looking at a number of tight loops that each account for a significant fraction of the execution time: there is no single bottleneck. Most of these loops do some floating-point arithmetic, but there's a lot ...

Why is x86 ugly? aka Why is x86 considered inferior when compared to others?

Hello, recently I've been reading some SO archives and encountered statements against x86 architecture. http://stackoverflow.com/questions/2667256/why-do-we-need-different-cpu-architecture-for-server-mini-mainframe-mixed-cor says "PC architecture is a mess, any OS developer would tell you that." http://stackoverflow.com/qu...

Simple question on 8086 assembly language

I'm studying 8086 assembly language at high school and I have this question: For example I have this number ABCD (hex). How is it stored on the memory? Does the AB go for example to memory address 01 and the CD goes to address 02? ...

Checking if file is 32bit or 64bit - on Windows

I'm compiling a program on my 64bit machine, but I'm not sure if it produces 32-bit or 64-bit output.. How can I check if a file is 32bit or 64bit on Windows? ...