assembly

Does using an Intel register for its "intended purpose" increase efficiency?

This article claims that each register has an intended purpose and more importantly, When the engineers at Intel designed the original 8086 processor, they had a special purpose in mind for each register. As they designed the instruction set, they created many optimizations and special instructions based on the function ...

Is there any SSE2+ book?

Is there any book that teaches SSE starting with version 2? I couldn't find any and there aren't many tutorials/articles on the net. Thanks in advance! ...

How can I become good at assembly?

The answer to this question is, of course, "write some assembly code!" But I can do that: I know basic x86 syntax, the types of registers and how to use them, subroutines, etc etc. When I took an assembly class, each assignment had a maximum number of instructions that we were allowed to use. If we went over, then we would lose points ...

What's the file format used by gcc in OSX?

I'm trying to learn assembly using NASM, the pcasm-book.pdf from Dr Paul Carter - http://www.drpaulcarter.com/pcasm/ - on my Mac OS X Snow Leopard. I'm trying to link the previous compiled C sample to asm samples: gcc first.o driver.c asm_io.o -o first But it's returning it: driver.c:3: warning: ‘cdecl’ attribute ignored ld: warning...

PowerPC initialization

Hi! Does someone know how to initialize a PowerPC 32-bit processor (e.g. PPC-440), similar to Intel's x86 protected mode switch and consequent initialization of address tables and the like? Is there documentation about the first steps an OS should take care of on these processors? Regards, ...

Help with Assembly. Segmentation fault when compiling samples on Mac OS X.

Hi, I'm trying to learn assembly using Dr Paul Carter's pcasm book: http://www.drpaulcarter.com/pcasm/ The author doesn't packaged Mac OS X samples, then I've started using from linux sources. Here is the first sample, that uses his library asm_io. I'm getting Segmentation Fault when running it. Why? What need to be changed to run in ...

Printing out a number in assembly language?

mov al,10 add al,15 How do I print the value of 'al'? ...

Side-effects of x86 assembly right-shift operator SHR?

I'm tracing through a program with an ASM debugger ollydbg and I come across this code snippet, which is a loop segment: CPU Disasm Address Hex dump Command Comments 007D05EC |. 33C9 XOR ECX,ECX 007D05EE |. 8BFF MOV EDI,EDI 007D05F0 |> 8B54B4 10 /MOV EDX,DWORD PTR S...

Using __asm to call a function from hex offset.

I don't know assembly so I'm not sure how to go about this. I have a program which is hooking into another. I have obtained the offset to where the function is located within the hooked program's .exe #define FuncToCall 0x00447E5D So now how can I use __asm{} to call that function? ...

AT&T inline syntax

can anyone show my the correct AT&T syntax to do what i'm doing below in INTEL i've shown my attempts at AT&T, but they don't compile... unsigned int CheckIfGenuineIntel(void) { unsigned int VendorIdentificationString[4] = {0, 0, 0, 0}; #if defined( _DO_INTEL_ ) __asm__ __volatile__ ( "xor eax, eax\n\t" "cpu...

How can I get IDA Pro to "see" xrefs to a string?

Currently, I'm disassembling a Mach-O executable in IDA Pro. I've gone through and found the string I'm interested in, but when I try to find xrefs to it, none can be found. I'm sure that the strings are referenced in the original code, but IDA Pro doesn't seem to be able to find out how they are referenced. Are there any tricks that ca...

Editing assembly on Mac OS X

I'm currently disassembling a Mach-O executable(the executable runs on Mac OS X, to be specific) in IDA Pro on windows. I have one instruction which I want to change, but it doesn't seem that IDA Pro allows you to do this. So, I tried using otool on OS X to dump the assembly(which it does fine). However, after editing the assembly in oto...

inline asm buffer loop

Ok here's my problem. I want to loop through a simple char buffer using inline asm and VC++; My agenda is to create a loop that reads information from memory as fast as physically possible heres my code char buffer[howmany]; memset(buffer,33,howmany); char arr = 0; __asm { MOV eax,seg buffer ;operand size conflict MOV eds,eax ...

Beginners Assembly Language

Hello people. I was just wondering where one could start learning assembly language from. could you please suggest some place that can get me kick started with it ? ...

x86 Assembly Reference Sheet

In my latest quest to learn some assembly language I'm finding myself constantly going to the web to find the definitions or descriptions for a particular register or mnemonic, ect. I'm looking for a handy Reference Sheet that I can print up and refer to every time I see a symbol and I "can't quite remember" what it was. Has anyone com...

Graphics on a bootloader

Managed to create a simple bootloader... and with VESA 2.0 I managed to change the resolution to 1024x768x32, also managed to setup a Linear Frame Buffer... Where can I find tutorials for using the frame buffer? Like lets say to display a picture before it finishes to load? So far I saw one sample on how to "draw" an ipod...called CdPod...

How do you print a smiley-face in assembly?

I wrote a program in assembler and compiled it. It is meant to print a blue smiley face and then wait for the user to press a key before it terminates. It does do that last bit but it doesn't print the smiley face. Can someone explain what have I done wrong ? CSEG segment org 100h Begin: mov ax,0B800h mov es,ax mov di,0 mov ah,31 mov ...

ZX Spin emulator, built-in assembly errors

I'm having problems understanding how to get an assembly file to run inside the ZX Spin emulator using the built-in assembler. I'm able to assemble my program but it seems to crash each time I attempt to run the assembled object code. I cannot find any documentation on how this is meant to be set to run. The message I get with version...

What is the fastest way to test if a double number is integer (in modern intel X86 processors)

Our server application does a lot of integer tests in a hot code path, currently we use the following function: inline int IsInteger(double n) { return n-floor(n) < 1e-8 } This function is very hot in our workload, so I want it to be as fast as possible. I also want to eliminate the "floor" library call if I can. Any suggestions? ...

Segmentation fault when executing program compiled from x86 assembly?

Hi everybody! I'm new to assembly language and I have to implement a function, in my case sin(x), that could be called from a C source file. I have to make 2 separate files: *.c and *.s When compiling through gcc on ubuntu all good, but when the program executes it gives me the error "Segmentation fault"... To compile I type: gcc -c -o...