I'm a little confused as to exactly what segment is used when you have x86 assembly like the below (Intel syntax):
mov ax, [di]
I'm pretty certain it wouldn't be the code segment, I'm thinking either the data segment or the stack? (Or is the stack part of the data segment?)
...
Hi all,
We are trying to implement levensteing distance algorithm in assembly and calling the assembly function from C code. But we have some char comparison problem and could not solve the problem.
Function takes two char* parameters. In the first two lines i mov the these addressess to ecx and edx. iminusOne and jminusOne are indexe...
Given a number, this program computes the factorial, but it no long works with number bigger than 9
.section .data
.section .text
.globl _start
_start:
pushl $10
movl %eax, %ebx
call func
addl $4, %esp
movl %eax, %ebx
movl $1, %eax
int $0x80
.type func,@function
func:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
...
I am reading the book The Art of Assembly Language. I came across this paragraph.
To determine a particular instruction’s opcode, you need only select the
appropriate bits for the iii, rr, and mmm fields. For example, to encode the
mov ax, bx instruction you would select iii=110 (mov reg, reg), rr=00 (ax),
and mmm=001 (bx). This pr...
I am reading the book The Art of Assembly Language. I came across these two lines.
the three byte encoding for mov ax, [1000] would be 0C6h, 00h,
10h and the three byte encoding for mov ax, [2000] would be 0C6h, 00h, 20h.
Can anybody show me how mov ax, [1000] converted to oc6h, ooh, 10h and mov ax, [2000] converted to 0C6h, 00h, 2...
I am running Android 2.2 on a netbook (Android x86).
The keyboard shortcut, Alt + F7 doesn't lead me back to graphics screen ( GUI) from the console.
Does anyone know any alternative to this shortcut ?
...
How does a x86 disassembler know where to break up the instructions?
I am looking at the 8088 instruction set. For example the move instruction has 7 variations that range from 2 to 4 bytes. The instructions themselves seem to follow no particular order. Another reason for Why is x86 ugly?.
For example:
7654321...
I am trying to acces values from an array of integers and have been trying for hours with no luck. Here is my code so far:
All I am trying to do is acces the values in the array "arr", i have seen how to do it with characters but not with integers.
int binarySearch (int* arr, int arrSize, int key, int* count)
{
int result=-1;
...
Can someone please point out some books or online resources which explain in detail and at an advanced level the task management features of x86? I'm specifically interested in understanding the relationship between x86 hardware and the OS (POSIX style) when an interrupt or context switch occurs. Intel manuals are very confusing and I ca...
Is there a way to write a program using pure x86 intel opcodes instead of the assembly mnemonics and instructions and then compile it with ML and LINK. For example if I try and write a 55 instead of push ebp ML thinks it is an integer. Does it require a special compiler or how would you write an opcode program and compile it.
...
I have the following instruction and I'd like to know what the function is of the 0x10 in regards to this LEAL instruction? Is it a multiply or addition or is something else?
leal 0x10(%ebx), %eax
Can someone please clarify? This is x86 assembler on a Linux box.
...
I found a pdf file called: ProgrammingGroundUp-1-0-booksize.pdf, and one of the projects is to make an assembly program that takes in files and converts them to uppercase, `
.section .data
#######CONSTANTS########
#system call numbers
.equ SYS_OPEN, 5
.equ SYS_WRITE, 4
.equ SYS_READ, 3
.equ SYS_CLOSE, 6
.equ SYS_EXIT, 1
#options for ope...
I am looking at the assembly language code of a switch statement.
I understand how the code works and what the cases are. My question is how do I decide on the case names?
Below is the assembly language code, which will be followed with my interpretation of it. I basically just need to use the jump table and fill in the case names.
...
All the Intel CPUs in the last decade (at least) include a set of performance monitors that count a variety of events. Do the latest Intel CPUs, Core i3, i5 and i7 (aka Nehalem) provide a mechanism to count Instructions Per Clock (IPC)? If so, how are they used?
If this is possible, I'll probably be writing the code for this in Asse...
Can anybody explain me this piece of assembly code?
LINEAR_DATA_SEL equ $-gdt
dw 0FFFFh
dw 0
db 0
db 92h ; present, ring 0, data, expand-up, writable
db 0CFh ; page-granular (4 gig limit), 32-bit
db 0
Here I have already googled about the command equ, dw and db but I can't understand what this code act...
Will modern (2008/2010) incantations of Visual Studio or Visual C++ Express produce x86 MUL instructions (unsigned multiply) in the compiled code? I cannot seem to find or contrive an example where they appear in compiled code, even when using unsigned types.
If VS does not compile using MUL, is there a rationale why?
...
Hi,
I develop on a pretty big windows forms .net (C#) application with several assemblys. Originally each assembly was build for the Target Platfom "Any CPU".
Due to a problem with Crystal Reports on x64 machines we had to build the whole project for x86 target platform. I startet rebuilding some of our Projects for x86 and it worked j...
Hello, I am having a lot of trouble accessing a value in an array of chars at a specific location. I am using inline-assembly in C++ and using visual studio (if that is of any help). Here is my code:
char* addTwoStringNumbers(char *num1)
{
// here is what I have tried so far:
movzx eax, num1[3];
mov al, [eax]
}
When I debu...
This is a pretty simple question.. lets say I have the following.
wordArray WORD 810Dh, 0C064h, 93ABh
Now, if I do this...
MOVZX EAX, wordArray
Thats going to move the first value of the array onto EAX.. so EAX would look something like this.. 0000810D. My question is, how can I move ALL of the array onto EAX.. so EAX would look ...
Hi,
I want to get the current value of the EIP register with assembly language. Is that possible?
Thanks.
...