assembly « Development « C Data Type Q&A

Home
C Data Type Q&A
1.binary
2.bit
3.byte
4.char
5.character
6.decimal
7.Development
8.float
9.hex
10.integer
11.prime
12.random
13.struct
C Data Type Q&A » Development » assembly 

1. Fastest way to find out minimum of 3 numbers?    stackoverflow.com

In a program I wrote, 20% of the time is being spent on finding out the minimum of 3 numbers in an inner loop, in this routine:

static inline unsigned int
min(unsigned int ...

2. double-precision numbers in inline assembly (GCC, IA-32)    stackoverflow.com

I'm just starting to learn assembly and I want to round a floating-point value using a specified rounding mode. I've tried to implement this using fstcw, fldcw, and frndint. Right now ...

3. "C variable type sizes are machine dependent." Is it really true? signed & unsigned numbers ;    stackoverflow.com

I've been told that C types are machine dependent. Today I wanted to verify it.

void legacyTypes()
{
    /* character types */
    char k_char = 'a';

 ...

4. How to determine the port numbers for peripheral devices?    stackoverflow.com

I know that peripheral devices such as a hard driver, a floppy driver, etc are controlled by reading/writing certain control registers on their device controllers. I am wondering about the following ...

5. Left shift of only part of a number    stackoverflow.com

I need to find the fastest equivalence of the following C code.

int d = 1 << x; /* d=pow(2,x) */
int j = 2*d*(i / d) + (i % d);
What I thought ...

6. Measure the exact time (number of cycles) of a set of instructions    stackoverflow.com

I have some sectors on my drive with poor reading. I could measure the reading time required by each sector and then compare the time of the good sectors and the ...

7. Why number++ uses EAX while number-- uses ECX?    stackoverflow.com

;disas for number++
mov eax, [number]
add eax,1
mov [number],eax
;disas for number--
mov ecx, [number]
sub ecx,1
mov [number],ecx
Why number++ uses EAX while number-- uses ECX ? What's the convention for dispatching registers ?

8. In C ensure that the number of assembly instructions is fixed for multiple sections of code    stackoverflow.com

In a virtual machine I'm writing, I want to be able to dispatch commands in a manner similar to the following pseudo code.

add: reg[memory[pc+1]] =  reg[memory[pc+1]] + reg[memory[pc+2]]; pc += ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.