assembly

how can I get the ARM MULL instruction to produce its output in a uint64_t in gcc?

Hello, I would like to introduce some assembly code into a c99 codebase. I want to use the UMULL instruction from the ARM CPU to multiply 2 uint32_t and get the result immediately into a uint64_t. Now a uint64_t needs 2 registers, so how do I specify the output and the constraints of the asm block? ...

will code in a 32-bit OS VM running on a 64-bit host machine compile/debug to IA-32 or IA-64 code?

I have a laptop with an intel i3 processor running windows 7 64-bit. I am wondering, can I set up a VM running, say, windows XP 32-bit, and be able to code targeting the intel 32 architecture? will my code compile, run, debug, the same way it would on a native 32bit machine? thanks! ...

Are there any really compact DES implementation in ARM assembler?

I have a bootloader limited to 32K Bytes, when the DES is added (about 6384 Bytes), it exceeds the limit. So anybody know any DES implementation in ARM assembler as small as possible? thanks! ...

Assembly: what are semantic NOPs?

I was wondering what are "semantic NOPs" in assembly? ...

Odd optimization problem under MSVC

I've seen this blog: http://igoro.com/archive/gallery-of-processor-cache-effects/ The "weirdness" in part 7 is what caught my interest. My first thought was "Thats just C# being weird". Its not I wrote the following C++ code. volatile int* p = (volatile int*)_aligned_malloc( sizeof( int ) * 8, 64 ); memset( (void*)p, 0, sizeof( int ...

When computer is powered on: How does it know from which instruction it needs to start executing?

When computer is powered on: How does it know from which instruction it needs to start executing? First its the BIOS program that needs to be executed. So, what exactly happens there? I want to know the process till OS is loaded. ...

Assembly Language: can anyone recommend good introductory resources?

Possible Duplicate: Whats the best beginner book for Assembly Language? I want to learn assembly language. Can you tell me what books are good for beginners? Also I see there are many different versions of assembly. Which one to learn and why? ...

How do I make a loop in assembly language?

I have written the code so far as: .code main Clrscr mov dh,10 ;row 10 mov dl,20 ;column 20 call Gotoxy ;locate cursor PromptForIntegers WriteString ;display string ReadInt ;input integer ArraySum WriteString ;display string WriteInt ;displ...

Beginner problem with inline assembly

I am using VS2008 C++ (no libs). This is my code: __asm { jmp start msg: db "http://www.stackoverflow.com" dtfld: db "00/00/0000" tmfld: db "00:00:00" start: I am getting the following errors: Error 1 error C2400: inline assembler syntax error in 'opcode'; found 'bad token' Error 2 e...

What AOP tools exist for doing aspect-oriented programming at the assembly language level against x86 application files for native OS X and MS-Windows native executables?

Looking for a tool I can use to do aspect-oriented programming at the assembly language level. For experimentation purposes, I would like the code weaver to operate native application level executable and dynamic link libraries. I have already done object-oriented AOP. I know assembly language for x86 and so forth. I would like to be...

Using the prompt for integers in assembly language

Hi by using the strings promptl BYTE "Enter a signed integer: ",0 prompt2 BYTE "The sum of the integers is: ",0 will It prompt a user for two integers using assembly language and how do I add the two integers using Assembly language? ...

How can I print a number larger than 32 bits in mips assembly?

In my mips assembly code, I used the multi instruction to multiply 2 large numbers since the result could not fit in one register. This means that the number is saved in the hi and lo special registers. My problem is how do I print the result of the multiplication. I can access hi and lo and put them in other registers (i.e. $t0, $t1)...

Accessing a label from outside a function

The code: /* ctsw.c : context switcher */ #include <kernel.h> static void *kstack; extern int set_evec(int, long); /* contextswitch - saves kernel context, switches to proc */ enum proc_req contextswitch(struct proc_ctrl_blk *proc) { enum proc_req call; kprintf("switching to %d\n", getpid(proc)); asm volatile("pushf\n" ...

Rounding to an integer - Rounding control field?

I am trying to write a function named roundD that rounds its first argument to an integer value according to the mode specified by its second argument. I will be writing the function in assembly language, using gcc’s inline assembler. I do not want to use any predefined functions.. I think i need to set the Rounding Control field of t...

Inline assembler call for subroutine

Hi, I have question about inline assembler. It's possible to call another assembler subroutine from inline assembler within the same function? For example: void FindValidPID(unsigned int &Pid) { __asm { sub esp, 20h mov eax, Pid add eax,eax call sub123 ; another assm subroutine mov Pid, ...

How fast is division?

hi, i was once supposed to make a short assembler code for dividing with numbers that are not power of 2. My solution was subtracting the divider in cycles and the number of cycles was the actual result. Is there anything faster? What's the usual way to sort this out? ...

Any tool/software in windows for viewing ELF file format?

Hello, There are lots of PE file browsers. Here is a list of good ones if you are interested: PE File format viewers: PE Explorer http://www.pe-explorer.com/ PE VIew: http://www.magma.ca/~wjr/ PEBrowse Professional http://www.smidgeonsoft.prohosting.com/pebrowse-pro-file-viewer.html PE Browse Professional Interactive ...

How should I get started on writing device drivers?

I would like to learn how to write device drivers because I think it would be fun. I use a Mac OS X Macbook, but I also have an Ubuntu machine (running on a Mac Min). I am pretty familiar with C and currently am reading this book. I have found some links online such as Mac Dev Center. I am doing this because it would be fun. I think ther...

How can I optimize my C / x86 code?

int lcm_old(int a, int b) { int n; for(n=1;;n++) if(n%a == 0 && n%b == 0) return n; } int lcm(int a,int b) { int n = 0; __asm { lstart: inc n; mov eax, n; mov edx, 0; idiv a; mov eax, 0; cmp eax, edx; jne lstart; mov eax, n; mo...

Taking an Assembly Course, Stuck in DOS!

I'm taking a course on Microprocessor Programming as part of my Electronic Engineering degree. Unfortunately, in the labs, we have to work in DOS using MASM. Now, I don't really find DOS a hindrance, but I just don't have it on a computer at home (and none of the computers that I have have floppy drives), so I am unable to practice writ...