assembly

How can I multiply two 64bit numbers using x86 assembly language?

As the title states, I need to multiply two 64bit numbers in Assembly, or two 16digit hexadecimal numbers. Help please? I'm only allowed to use registers %eax, %ebx, %ecx, %edx, and the stack. EDIT: Oh, I'm using ATT Syntax on the x86 EDIT2: Not allowed to decompile into assembly... ...

Pseudo random generator, Assembler

Which "random" numbers generator algorithm is the best for an assembler program? Something easy, not a long piece of code. Not external library allowed, just trying to keep it simple. @Bill Barksdale: I'm looking for an easy algorithm to use in a assembler program assigned in a course. ...

What can cause MASM to display "junk"?

I have some code which is supposed to display a short message. Here's the pertinent code: DATA SEGMENT 'DATA' MSG DB 0AH, 0DH, 'Hello, Adam', '$' CHAR DB 00H DATA ENDS CODE SEGMENT 'CODE' PRINT_MSG: MOV AH, 09H ;Command to print string of characters MOV DX, OFFSET MSG ;Mov address of message into DX INT 21H ;DOS ...

Grub and getting into Real Mode (low level assembler question)

I've been working on a toy OS and have been using grub as my boot loader. Recently when trying to use VGA I found that I couldn't use hardware interrupts. This I found was because I had been slung into protected mode by grub. Anyways the question boils down to - Does anybody know how to get back into real mode without having to get ri...

MIPS Assembly Pointer to a Pointer?

I think I know how to handle this case, but I just want to make sure I have it right. Say you have the following C code: int myInt = 3; int* myPointer = &myInt; int** mySecondPointer = &myPointer; P contains an address that points to a place in memory which has another address. I'd like to modify the second address. So the MIPS cod...

Where can I find the world's fastest atof implementation?

I'm looking for an extremely fast atof() implementation on IA32 optimized for US-en locale, ASCII, and non-scientific notation. The windows multithreaded CRT falls down miserably here as it checks for locale changes on every call to isdigit(). Our current best is derived from the best of perl + tcl's atof implementation, and outperform...

Mips - Is it important?

My question: Is the mips programming language that benificial to know? I'm a CS student and am taking a assembly class which focuses on Mips. I'm very comfortable writing in high level languages, but Mips has me a little bit down. Is Mips something that I should really focus on and try to completely grasp it? Will it help me in the f...

Should I learn Assembly programming?

I know this might seem like a duplicate post... but precisely what I am trying to compare here is the developers getting driven by zeal to create great web apps and profitable apps... to the spirit of the retro In the noise of web development, functional programming etc, the old art of Assembly programming, reverse engineering etc seems...

What are the best tools for reverse engineering z80 machine code?

A particular assembler/disassembler or something else entirely? ...

Using Visual Studio 2008 to Assemble, Link, Debug, and Execute MASM 6.11 Assembly Code

I would like to use Visual Studio 2008 to the greatest extent possible while effectively compiling/linking/building/etc code as if all these build processes were being done by the tools provided with MASM 6.11. The exact version of MASM does not matter, so long as it's within the 6.x range, as that is what my college is using to teach 16...

GCC inline assembler, mixing register sizes (x86)

Does anyone know how I can get rid of the following assembler warning? Code is x86, 32 bit: int test (int x) { int y; // do a bit-rotate by 8 on the lower word. leave upper word intact. asm ("rorw $8, %0\n\t": "=q"(y) :"0"(x)); return y; } If I compile it I get the following (very valid) warning: Warning: using `%ax' instead...

How to get GCC to use more than two SIMD registers when using intrinsics?

I am writing some code and trying to speed it up using SIMD intrinsics SSE2/3. My code is of such nature that I need to load some data into an XMM register and act on it many times. When I'm looking at the assembler code generated, it seems that GCC keeps flushing the data back to the memory, in order to reload something else in XMM0 an...

Why can't I change the value of a segment register? (MASM)

So I decided to teach myself assembly language. I know on a very basic level how this stuff works, but I have never programmed so close to the hardware and I thought that I should definitely know this stuff. I was playing around with different registers and general syntactical stuff and I have realized that my program will not compile ...

Assembler file as input for a driver build with the WDK tools

How to get an assembler file to be compiled and linked into a driver build. To clarify a bit The SOURCES file : TARGETTYPE=DRIVER DRIVERTYPE=WDM TARGETPATH=obj TARGETNAME=bla INCLUDES=$(DDK_INC_PATH) TARGETLIBS=$(DDK_LIB_PATH)\ks.lib SOURCES=x.cpp y.cpp z.asm The problem occurs with the z.asm file. NMAKE complains that it does no...

Combining two executables

I have a command line executable that alters some bits in a file that i want to use from my program. Is it possible to create my own executable that uses this tool and distribute only one executable? [edit] Clarification: The command line tool takes an offset and some bits and changes the bits at this offset in a given file. So I want ...

where can I find a description of *all* MIPS instructions,

Does anyone know of a web site where I can find a list of 32-bit MIPS instructions/opcodes, with the following features: Clearly distinguishes between real opcodes and assembly-language macros Describes the instruction behavior including differences depending on privilege level. Indicates in which instruction set revision the instructi...

How do you get assembler output from C/C++ source in gcc?

How does one do this? If I want to analyze how something is getting compiled, how would I get the emitted assembly code? ...

Where can I find tools for learning assembler on OS X?

I'd like to learn assembler. However, there are very few resources for doing assembler with OS X. Is there anyone out there who has programmed in assembly on a Mac? Where did you learn? And, is there any reason I shouldn't be doing assembly? Do I risk (significantly) crashing my computer irreparably? ...

Is x86 assembler via .NET possible?

Is there such a thing as an x86 assembler that I can call through C#? I want to be able to pass x86 instructions as a string and get a byte array back. If one doesn't exist, how can I make my own? To be clear - I don't want to call assembly code from C# - I just want to be able to assemble code from instructions and get the machine code...

Is there a need to use assembly these days?

Many claim that, when performance is at a premium, it's sufficient to write and compile C code to get near-optimal code that is additionally quite portable. I don't see much of a assembly/assembler discussion on stackoverflow (about 0,3% of the questions right now are tagged any of those tags, many of which refer to .NET Assemblies). H...