assembly

How to take the seed for a random generator from the clock, programming in assembler

Compiler, TASM 5 Architecture x86. For a random number generator algorithm, take tha clock as the seed. I found that solution: AcquireSeed PROC PUSH AX PUSH CX PUSH DX MOV Ah, 00h ; Int INT 1AH ; return the clock in CX:DX MOV seed, DL ; save the less significant byte of the clock at seed (declared at .da...

Unable to run assembly program

Hi, I have just started reading Introduction to 80x86 Assembly Language and Computer Architecture.I am trying to use NASM, to run the first example shown in chapter 3 ,but unsuccessfully.Has anyone read the book,and run the examples? ...

Key concepts to learn in Assembly

I am a firm believer in the idea that one of the most important things you get from learning a new language is not how to use a new language, but the knowledge of concepts that you get from it. I am not asking how important or useful you think Assembly is, nor do I care if I never use it in any of my real projects. What I want to know ...

x86 Assembly - 'testl' eax against eax?

Hi All, I am trying to understand some assembly. Assembly as follows, I am interested in the testl line: 000319df 8b4508 movl 0x08(%ebp),%eax 000319e2 8b4004 movl 0x04(%eax),%eax 000319e5 85c0 testl %eax,%eax 000319e7 7407 je 0x000319f0 I am trying to understand that point of ...

SPARC assembly

I've been curious in the past few months in trying my hand at doing some assembly for the SPARC processor (either V8 or V9). My question is this, I have no access to a SPARC machine, is there an emulator & assembler/linker for SPARC running on an x86(Linux)? I've looked at QEMU but Im not too sure as this is what I need/ ...

COM from x86 assembly?

Is it possible to call into COM objects via x86 assembly language? If so, how? Why would I want to do this? Let's say I've got two programs that I don't have source for - all I've got are the binaries. One of them implements a COM interface, the other doesn't. I want to inject code into the first program to call into the second using th...

What's a good C decompiler?

I am searching for a decompiler for a C program. The binary is a 32-bit Linux executable. Objdump works fine, so basically I am searching for something which attempts to reconstruct the C source from the asm source. ...

What's the best "beginner" book for Assembly Language?

What's the best "beginner" book for Assembly Language? ...

How do you use gcc to generate assembly code in Intel syntax?

The gcc -S option will generate assembly code in AT&T syntax, is there a way to generate files in Intel syntax? Or is there a way to convert between the two? ...

Borland x86 inlined assembler; get a label's address?

Hello I am using Borland Turbo C++ with some inlined assembler code, so presumably Turbo Assembler (TASM) style assembly code. I wish to do the following: void foo::bar( void ) { __asm { mov eax, SomeLabel // ... } // ... SomeLabel: // ... } So the address of SomeLabel is placed into EAX. This doesn't ...

Some x86 ASM Reference/Tutorials?

I'm trying to find some references in regards to x86 Assembly languages. Tutorials/Examples to help my understanding. -Thanks ...

x86 Assembly Keyboard Input

OK, I feel very very stupid for getting hung up on such a basic concept, but I can't seem to find a difinitive answer for this question anywhere. I'm in the process of trying to hack together the first bits of a kernel. I currently have the entire kernel compiled down as C code, and I've managed to get it displaying text in the console ...

How cache memory works?

Today when I was in computer organization class, teacher talked about something interesting to me. When it comes to talk about Why cache memory works, he said that: for (i=0; i<M; i++) for(j=0; j<N; j++) X[i][j] = X[i][j] + K; //X is double(8 bytes) it is not good to change the first line with the second. What is your opinion...

x86 assembly registers -- Why do they work the way they do?

Why is %EAX = %AX and %AX = (%AH + %AL). Why isn't there a counterpart to %AX to equal %EAX? ...

What is the definitive book on assembly language and Computer Architecture

I am taking a Computer Architecture course next semester and besides the required book I also like to get some other resources. It seems that there tends to be one book that stands above the rest in most areas of computing,(The Dragon Book, K&R). So I am wondering if there is a consensus on a definitive book on x86 asm and computer ar...

x86 question about bit comparisons

Im having a problem with a final part of my assignment. We get in a stream of bits, etc etc, in the stream is an integer with the number of 1's in the text portion. I get that integer and its 24 which is correct, now i loop through the text data i get and i try to count all the 1's in there. But my proc is always returning zero. I was a...

How to include the assembly code in my C code in Turbo C?

hello friends, How to include any assembly code lines into my C program ? In turbo c is there a possibility to add an assembly code file (.asm) to a project of few .c files? ...

What's the purpose of the nop opcode?

I'm going through MSIL and noticing there are a lot of nop instructions. The MSDN article says they take no action and are used to fill space if the opcode is patched. They're used a lot more in debug builds than release builds. I know that these kinds of statements are used in assembly languages to make sure an opcode fits on a word bou...

What knowledge do you need to create a patch for your game or application?

I've always been mystified how software vendors can ship their application or game, and then later provide a different set of executables that change the behaviors of the previous build. How is this done? Do the original application and the patch have to adhere to some kind of rule? Or does the patch crawl into the original executable an...

How do I do inline assembly on the IPhone?

How is it done? What steps do I need to take and what pitfalls and gotchas are there to consider? ...