assembly

Differences Between ARM Assembly and x86 Assembly

Hello, I'm now going to learn ARM Assembly, to develop for my Windows Mobile 5 iPAQ, but I have some questions: What Are The Main Differences Between ARM Assembly and x86 Assembly? Is Any Differences In The Interrupts(New Types)? Which Are They And What Is The Meaning Of They? Best Assembler To Compile And Where To Get It? Where ...

Benchmarking SSE instructions

I'm benchmarking some SSE code (multiplying 4 floats by 4 floats) against traditional C code doing the same thing. I think my benchmark code must be incorrect in some way because it seems to say that the non-SSE code is faster than the SSE by a factor of 2-3. Can someone tell me what is wrong with the benchmarking code below? And perhap...

How do I disassemble raw x86 code?

I'd like to disassemble the MBR (first 512 bytes) of a bootable x86 disk that I have. I have copied the MBR to a file using dd if=/dev/my-device of=mbr bs=512 count=1 Any suggestions for a Linux utility that can disassemble the file mbr? ...

Which assemblers currently support the AVX instruction set?

I'd like to start and play with some AVX (advanced vector extension) instructions. I know Intel provides an emulator to test software containing these instructions (see this question), but since I don't want to manually write hex code, the question arises as to which assemblers currently know the AVX instruction set? I would be most in...

Create smaller instruction set from x86 assembly

I have a sort of simulator for x86 assembly instructions, but the thing is it doesn't accept the full instruction set. For instance if given an INT command it will terminate. It is possible to run all the binary representation (8bit, 16bit and 32bit) of commands on the simulator and see which one's are valid and which are not. It is fo...

Simple assembly question

MOV [1234H], AX means that the value of AX is copied to 1234 hexadecimal address in memory. So, please correct me if what I am saying is wrong, the [] operator functions as a pointer to, right? This being said, I can't understand the following instruction: MOV [EBX], AX why the use of the [ ]? EBX is a general purpose register inside th...

Assembly @@ label question

Hi. I have been looking at some assembly code and have found that this comes up rather regularly. @@: ... ... ; some instructions ... LOOP @B Sometimes there is also @F. I suppose that @B means to go back to the previous label and @F the the "forward/front" label? Am I right? This only works with "@@" labels? If I have label "labe...

Prefetch for Intel Core 2 Duo

Has anyone had experience using prefetch instructions for the Core 2 Duo processor? I've been using the (standard?) prefetch set (prefetchnta, prefetcht1, etc) with success for a series of P4 machines, but when running the code on a Core 2 Duo it seems that the prefetcht(i) instructions do nothing, and that the prefetchnta instruction i...

Code Connecting Hardware and Software in Modern OS

Im a bit confused on how software interacts with the hardware even though Ive taken a computer organization class. Where can I find the code from a OS like Linux or BSD, or even of C that allows the abstraction of hardware. Are there any good material's which I can read to fully understand the interaction of hardware and software. ...

List of suspected Malicious patterns

I am doing an anti-virus project by disassembling its code and analyzing it. So i want a list of the Suspected Malicious pattern codes, so i can observe which is suspected and which is not? so i want a list of suspected patterns only. Thank You for your Help. Abdelrahman. ...

Starting Assembly

I'm new to assembly language, and would like to learn. I have Vista-64 (will be upgraded to Windows 7 64), and I will soon be reinstalling 32-bit Linux, but I will end up programming on both systems, probably using NASM. I was wondering if 32-bit assembly programs will compile and run on my system. If not, what are the major differences ...

Illegal instruction in ASM: lock cmpxchg dest, src

I've been messing around with some x86 assembly as its come up in a number of my classes. In particular, I've wanted to expose compare-and-swap (CAS) as a user function. This is with the intent that I can implement my own locks. I'm using Linux 2.6.31 with GCC 4.1.1 on an Intel CPU. I have the following: // int cmpxchg(int *dest, int ...

Atomic bitfield operations on 80x86?

Does 80x86 have instructions for atomically testing and setting individual bits of a word? ...

Registers for X86_64 processors

Where can I find the names of the new registers for assembly on this architecture. I am referring to registers in X86 like EAX, ESP, EBX, etc. But id like them in 64bit. I tried searching online but cant find anything or I am just not searching for the right thing. I dont think they are the same as wek I disassembly my C code, I get ...

LOOP, LOOPE, LOOPNE?

Can anyone please explain me the difference between the assembly instructions LOOP, LOOPE and LOOPNE. Thanks. ...

Is there any assembly language debugger for OS X?

So i was wondering if there is any? I know afd on windows but not sure anything about mac? And this his how i am using nasam on the following code: nasm a.asm -o a.com -l a.lst [org 0x100] mov ax, 5 mov bx, 10 add ax, bx mov bx, 15 add ax, bx mov ax, 0x4c00 int 0x21 On windows i know a debugger name afd which help me to step through ...

How can I jump relative to the PC using the gnu assembler for AVR?

I have a binary file that I've disassembled using avr-objcopy. The interrupt vector table looks like: 00000000 : ; VECTOR TABLE 0: 13 c0 rjmp .+38 ; 0x28, RESET 2: b8 c1 rjmp .+880 ; 0x374, INT0 4: fd cf rjmp .-6 ; 0x0 6: fc cf rjmp .-8 ; 0x0 8: fb cf ...

Assembly code as an argument to inline assembler in Visual Studio

I need to pass assembly code as arguments in Visual Studio, therefore have a function e.g.: myasm(char *x) that will accept arguments like "mov eax,eax\n add eax,eax" Unfortunately I can't use GCC compiler for what I'm doing. Is there a way to do this in VS? (Note: the assembly code I'm passing is dynamic so I can't predict what it is ...

Utilizing the LDT (Local Descriptor Table)

I am trying to do some experiments using different segments besides the default code and data user and kernel segments. I hope to achieve this through use of the local descriptor table and the modify_ldt system call. Through the system call I have created a new entry in LDT which is a segment descriptor with a base address of a global va...

Assembly and System Calls

Im having a bit of trouble understanding the more complex system calls in assembly. I wrote a exec system call and it worked great .bss .text .globl _start _start: #exit(0) system call movl $1, %rax movl $0, %rbx int $0X80 Though I am a bit insure and have not been able to find info pertaining to how you...