Registers

The following reserved symbols denote CPU registers in the inline assembler:

CPU registers

32-bit general purposeEAX EBX ECX EDX32-bit pointer or index

ESP EBP ESI EDI

16-bit general purposeAX BX CX DX

16-bit pointer or index

SP BP SI DI

8-bit low registers AL BL CL DL

16-bit segment registers

CS DS SS ES

32-bit segment registers

FS GS

8-bit high registers AH BH CH DH

Coprocessor register stackST

When an operand consists solely of a register name, it is called a register operand. All registers can be used as register operands, and some registers can be used in other contexts.

The base registers (BX and BP) and the index registers (SI and DI) can be written within square brackets to indicate indexing. Valid base/index register combinations are [BX], [BP], [SI], [DI], [BX+SI], [BX+DI], [BP+SI], and [BP+DI]. You can also index with all the 32-bit registersfor example, [EAX+ECX], [ESP], and [ESP+EAX+5].

The segment registers (ES, CS, SS, DS, FS, and GS) are supported, but segments are normally not useful in 32-bit applications.

The symbol ST denotes the topmost register on the 8087 floating-point register stack. Each of the eight floating-point registers can be referred to using ST(X), where X is a constant between 0 and 7 indicating the distance from the top of the register stack.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment