Все вопросы: [x86]

221 вопросов

похожие теги: android-x86x86-64jasmin-x86x86-16
3
голосов
2ответов
1523 просмотров

How to compile multiple files together with ml in assembly x86?

I'm working in x86 assembly in 16bits. I have three files that need to share 'variables between them' - basically, the data segment. When I compile them, as in the following: ml file1.asm,file2.asm,file3.asm io.lib They cannot access each other's variables How do I share a data segment, and th...

11
голосов
5ответов
6848 просмотров

How to load a kernel from disk with BIOS int 13h in NASM assembly?

I've been stuck with this for weeks now and have no idea where I'm going wrong because NASM hasn't given me any errors. The code is pretty self explanatory because of the comments. this is the code that is loaded from the BIOS ;-------------------------------------------- ; 'boot.asm' ; load...

7
голосов
3ответов
31978 просмотров

JMP to absolute address (op codes)

I'm trying to code a exe packer/protector as a way of learning more about assembler, c++, and how PE files work. I've currently got it working so the section containing the EP is XORed with a key and a new section is created that contains my decryption code. Everything works out great except when...

2
голосов
4ответов
1793 просмотров

Can I atomically increment a 16 bit counter on x86/x86_64?

I want to save memory by converting an existing 32 bit counter to a 16 bit counter. This counter is atomically incremented/decremented. If I do this: What instructions do I use for atomic_inc(uint16_t x) on x86/x86_64? Is this reliable in multi-processor x86/x86_64 machines? Is there a pe...

1
голосов
1ответов
1631 просмотров

XORing at the address stored in EAX

How can you XOR the value stored in EAX? The problem is at this line: xor eax, key EAX contains the address of the value i want to XOR. How can I accomplish this? I though it would be something along the lines of: xor [eax], key but that doesn't work (syntax error) decrypt proc startAddr...

0
голосов
1ответов
1568 просмотров

using 32 bit installshield for packaging 64 bit binaries

iam using 32 bit installshield to package 64 bit binaries. everything works fine but default location is pointing to c:\program files(x86)\companyname\productname. even though i've selected 64bit at every possible place, somehow it is defaulting to x86 programfiles folder. Any kind of help would ...

106
голосов
6ответов
39247 просмотров

Why is SSE scalar sqrt(x) slower than rsqrt(x) * x?

I've been profiling some of our core math on an Intel Core Duo, and while looking at various approaches to square root I've noticed something odd: using the SSE scalar operations, it is faster to take a reciprocal square root and multiply it to get the sqrt, than it is to use the native sqrt opco...

7
голосов
3ответов
8903 просмотров

Disable Hardware & Software Interrupts

Is it possible to disable all interrupts with a ASM/C/C++ program to get full control about the processor? If yes -> how? If not -> how do "atomic" operation system calls work (for example entering a critical section)? Thanks for your help!

2
голосов
4ответов
1459 просмотров

Whats a good place to start learning assembly?

I need to learn assembly using SSE instructions and need gcc to link the ASM code with c code. I have no idea where to start and google hasn't helped.

3
голосов
6ответов
1331 просмотров

Are there any instructions in x86 assembly that exist only in 64-bit mode?

Some old x86 instructions are undefined in 64-bit mode. For instance LDS, LES and LSS, or short opcodes of the INC r16 (40 + rw) and INC r32 (40 + rd) instructions. Are there any instructions that are defined only in 64-bit mode, and not in 32-bit protected mode? Edit: The context is developm...

9
голосов
4ответов
4843 просмотров

Assembly and multicore CPUs

What x86-64 instructions are used to enable/disable other cores/processors and how does one start executing code on them? Is there documentation somewhere on how this is done by the operating system?

1
голосов
2ответов
368 просмотров

Is there a way to store part of a 16 bit value in an 8 bit variable in Assembly?

I created one variable that stores a 16 bit variable, and I'm tring to store the upper half in an 8 bit variable. How do I do this? EDIT: its for the IA-32, and I don't think i can use registers EDIT2: I am allowed to use registers.

6
голосов
3ответов
2969 просмотров

How is linux simultaneously 32bit and 64bit? Or is that something handled in glibc?

How is Linux simultaneously 32bit and 64bit? Or is that something handled in glibc? I run CentOS 5.3 and it is a "64 bit" version; although I build things for 64 bit and 32 bit. From what I think I know, Windows supposedly has a 32bit emulator. Does Linux do the same thing? Is it in userspace or...

16
голосов
4ответов
48359 просмотров
44
голосов
19ответов
15404 просмотров

Porting 32 bit C++ code to 64 bit - is it worth it? Why?

I am aware of some the obvious gains of the x64 architecture (higher addressable RAM addresses, etc)... but: What if my program has no real need to run in native 64 bit mode. Should I port it anyway? Are there any foreseeable deadlines for ending 32 bit support? Would my application run faster ...

0
голосов
3ответов
2567 просмотров

Convert Inline C Assembler (Intel syntax to AT&T)

I am trying to convert this function from MSVC++ to MINGW (this is the original MSVC function) VOID __declspec(naked) BNSTUB() { __asm { pushad; call OnChatPacketReceived; TEST EAX,EAX; popad; jnz oldCall; MOV EAX,0; MOV DWORD PTR DS:[EBX+0...

7
голосов
4ответов
5199 просмотров

How un-portable is assembly language, /really/?

I understand that writing anything in assembly, or adding assembly to any program harms its portability. But, how bad? I mean, basically all PC's are x86 or x64 these days, right? So, if I embed assembly into a C program, why wouldn't it still compile no matter where it went? Does this notion of...

1
голосов
2ответов
336 просмотров

how to allow .com in a url path using IIS6 on Win2003 R2 x64?

it seems IIS6 on Win2003 R2 Enterprise x64 SP2 will not allow you to use .com in a url path. e.g if i create a folder foo.com in my web root, containing a default.htm, this url results in a 404: http://localhost/foo.com/default.htm however, following the exact same steps on Win2003 R2 Standard...

0
голосов
2ответов
1075 просмотров

Implementing math.h functions in assembler

I have used gdb to step through the assembler code that implement the standard C sin() function in the standard C math library (-lm -march=pentium3 -mfpmath=387). There is a lot of stub there and I don't know why they have not simply inlined the fsin assembler instruction. The same happens with o...

5
голосов
3ответов
3102 просмотров

Microsoft ASM interview question?

I was looking online through samples of interview questions asked in the past by Microsoft and came across this one: The following asm block performs a common math function, what is it? cwd xor ax, dx sub ax, dx Can somebody please answer this and explain the answer to me? Thanks!! Up...

4
голосов
3ответов
162 просмотров

Is there a caching penalty for mixing binary data and instructions within close proximity of each other?

I'm procedurally generating 128-byte blocks with some set n-byte header reserved for machine-language functions that I'm simply calling via in-line assembly. They aren't defined anywhere and are generated at run-time into pages allocated into memory with access for execution. However, I want to...

5
голосов
3ответов
8720 просмотров

Configure ASP.NET to use x86 on x64 Windows

I am trying to deploy GAL Modifier, which is an ASP.NET website which uses Microsoft Access on a Windows 2003 x64 machine. However there is no JET driver on x64 (see here), so the change is to use change the target CPU to x86. However as it is a web site there is no option in Visual Studio exce...

1
голосов
3ответов
2024 просмотров

x86 Assembly, misleading Error

I am trying to learn assembly, and have a program in AT&T syntax, for use with GNU AS Which I believe should work. I receive this error with GDB: Program received signal SIGSEGV, Segmentation fault. .PROGRAM () at concatenator.s:60 60 call strlen Current language: auto; curr...

37
голосов
4ответов
5576 просмотров

Alignment requirements for atomic x86 instructions vs. MS's InterlockedCompareExchange documentation?

Microsoft offers the InterlockedCompareExchange function for performing atomic compare-and-swap operations. There is also an _InterlockedCompareExchange intrinsic. On x86 these are implemented using the lock cmpxchg instruction. However, reading through the documentation on these three approach...

21
голосов
13ответов
4093 просмотров

Intel x86 assembly optimization techniques for expanding 8 bits to 8 boolean bytes of 0 or 1

I am learning assembler quite a while and I am trying to rewrite some simple procedures \ functions to it to see performance benefits (if any). My main development tool is Delphi 2007 and first examples will be in that language but they can be easily translated to other languages as well. The pr...

3
голосов
3ответов
4075 просмотров

DOS Interrupt in masm x86 assembly crashing

I've just begun learning some x86 assembly on win32, and I've used masm with visual studio 2008 using the custom build rule that comes with the ide for .asm files. I've been trying to use the DOS interrupt to print to the console, but instead I receive the message: "Unhandled exception at 0x00401...

3
голосов
2ответов
1360 просмотров

Lightweight x86 Emulator for .NET / Executing x86 code in a managed environment

Our company is migrating its entire product line from a C++ codebase to the .NET Framework. We have a very large codebase, and this migration is being done incrementally over the course of many years. We would like to enjoy some of the benefits of pure managed code, such as Silverlight, but the...

2
голосов
4ответов
325 просмотров

How would I go about creating my own VM?

I'm wondering how to create a minimal virtual machine that'll be modeled after the Intel 16 bit system. This would be my first actual C project, most of my code is 100 lines or less, but I have the core fundamentals down, read K&R, and understand how things ought to work, so this pretty much ...

20
голосов
6ответов
36139 просмотров

How to read and write x86 flags registers directly?

From what I've read, seems like there are 9 different flags. Is it possible to read/change them directly? I know I can know for example if the zero flag is set after doing a cmp/jmp instruction, but I'm asking if it's possible to do something like mov eax, flags or something. Also, for writin...

3
голосов
4ответов
3981 просмотров

x86 asm graphics settings for resolutions higher than 640x480?

I've just started using assembly language (felt like learning something new), and have run into a few questions (so far) that all the tutorials I've been looking through don't answer, or are too old to know. 1) I've tried a few searches (maybe I just don't know the right keywords), but I can't f...