x86

8086 Assembler - Generating the object code from opcodes

I'm working on an assembler for the 8086 . My question is how do you convert the hex opcodes to an executable file like .EXE,.ELF,.COM,a.out etc .Looking for links/resources for this and should the assembler do the linking process or is it done by the OS automatically? ...

Assembly Keyboard IO Port

Hello, I have seen the following topic. I am interested in contacting the keyboard via the IN / OUT instructions and setting various modes, such as turning on the caps lock led. So far I have encountered problems doing so. The following link may help. I have tried various combinations such as mov al,0EDh ;ED command - Send L...

What is "graphics memory aperture base" in Intel chipsets?

Hi everybody, i'm trying to understand how I can paint simple graphics in x86 protected mode on Intel chipsets; I already (kind of) know how to do that with VGA interface, and I'm trying to understand how I could use G35 Express to do the same. For this purpose I'm studying this document. I can't understand what's "graphics memory apert...

How can I set the default build target to x86 for all projects, in Visual Studio 2008?

Is there is a way to set the default build action to x86, instead of Any CPU in Visual Studio 2008? That way all new projects will be compiled for x86, and great features like edit and continue will work. Perhaps a registry hack or somthing simple, like a global option. Thanks, Carl ...

Help deciphering a few lines of assembly

I have found these few lines of assembly in ollydbg: MOV ECX,DWORD PTR DS:[xxxxxxxx] ; xxxxxxxx is an address MOV EDX,DWORD PTR DS:[ECX] MOV EAX,DWORD PTR DS:[EDX+116] CALL EAX Could someone step through and tell me what's happening here? ...

Assembler question: dereference eax when it contains 0

How can the following instructions make any sense? xor eax,eax mov eax,[eax] When you XOR eax, you get zero most of the time, so can you dereference what is at address [eax] (in this case eax contains 0) and put it back into eax? Someone please clarify? ...

Exception handling

I was trying to write a code to handle exceptions, but overriding another exception handler, is it possible? I was developing an exe in asm to debug a dll, and detect some exceptions that are raised (access violation) but the dll has its own exception handling, so a normal SEH should not work, i would like to know if there is any kind o...

gdb problem setting hardware watchpoint/how to set software watchpoint

An earlier question explained that on x86 the size of objects being watched is limited by debug registers. here. As expected, I can "watch" a double variable. But I can't watch a double datamember, eg watch pObject->dPrice produces Hardware watchpoint 1: pObject->dPrice But when you try to continue execution, it says Could not in...

x86 opcode encoding: sib byte

Im currently trying to write a disassembler. I found the following list of opcodes and their meanings, so i decided to parse it at runtime: http://mprolab.teipir.gr/vivlio80X86/pentium.txt But i am stuck at the opcode 0x00: It is followed by a reg/modbyte. Parsing it was not much of a problem for me. But i'm having trouble with the Scal...

X86 Assembly - accessing a chip

Dear all, Lets say that my GPU includes a chip called ADT7473. I am interested in receiving information from this chip about the temperature of my card. My question is, how to access this chip? is that accomplished using the IN/OUT instructions? EDIT: I might add those lines found in the chip's documentation : Table 18. Temperatu...

how to read/write a register

I see some code which are going to read/write some peripheral registers. I see the write operations are all followed with some delays. It seems to me that SW needs to wait for the value takes effect on HW. Some web page say register will get update every clock cycle. I guess that's the reason for waiting. Well, my questions are: Does r...

order and barrier:what is the equivalent instruction on x86 for 'lwsync' on PowerPC?

My code is simple as below.I found rmb and wmb for read and write,but found no general one.lwsync is available on PowerPC,but what is the replacement for x86?Thanks in advance. #define barrier() __asm__ volatile ("lwsync") ... lock() if(!pInst); { T* temp=new T; barrier(); pInst=temp; } unlock...

Logical error in prime numbers.

Hi, I am new to assembly language. I have written a program for taking an input and then displaying whether the number is prime or not. Here is my source code. .intel_syntax noprefix .include "console.i" .data Num: .long 0 .text ask: .asciz "Enter a +ve number : " ansp: .asciz " is prime." ...

How to manage development of PowerShell snap-ins with x86 and x64 versions

I am currently writing a PowerShell snapin that has specific dependencies on mixed-mode assemblies (assemblies containing native code) that specifically target x64 or x86. I have both versions of the dependent assembly, but I am wondering how best to manage the build and deployment of this snapin, specifically: Is it necessary to have ...

DebugDiag shows weird data in an Analysis file

Could you please explain why I have so weird results in my Analysis output got from DebugDiag x86 v1.1 on Win7? Heap Summary Number of heaps 41 Heaps Total reserved memory 103,948,920.51 TBytes Total committed memory 190,850,373.51 TBytes and so on. Obviously, I have no so many RAM. I've already apply a fix...

Conditional move problem

Code fragment from Assembly exercise (GNU Assembler, Linux 32 bit) .data more: .asciz "more\n" .text ... movl $more, %eax # this is compiled cmova more, %eax # this is compiled cmova $more, %eax # this is not compiled Error: suffix or operands invalid for `cmova' I can place string address to %eax using movl...

How to convert ASM to read-able code?

I have an exe which I have opened with PE Explorer Disassembler. Now I can see the asm code, which looks like that: push ebx push esi mov ebx,eax mov eax,[ebx+38h] push eax mov eax,[ebx+3Ch] push eax mov ecx,edx mov eax,ebx mov edx,[ebx+30h] mov esi,[eax] call [esi+7Ch] ...

explanation about push ebp and pop ebp instruction in assembly..

hi.... i used stack in assembly but i didn't got idea about push ebp and pop ebp. .intel_syntax noprefix .include "console.i" .text askl: .asciz "Enter length: " askb: .asciz "Enter breadth: " ans: .asciz "Perimeter = " _entry: push ebp # establishing stack-frame mov ebp, esp sub esp, 12 Promp...

C# How do you get the operating system architecture (x86 or x64)?

Possible Duplicate: How to detect Windows 64 bit platform with .net? How can I retrieve the operating system architecture (x86 or x64) with .NET 2.0? I have not found any good method to get the OS architecture on Google. What I found was how to tell whether the process is 32-bit or 64-bit. If there isn't anyway to find out i...

in following code showing output 0 instead of 8.

.intel_syntax noprefix .include "console.i" .data ask1: .long 0 ask2: .long 0 ans : .long 0 .text ask: .asciz "Enter number: " ans1: .asciz "multiplication= " _entry: Prompt ask GetInt ask1 Prompt ask GetInt ask2 mov eax, ask1 mov...