UMBC | CMSC 313 -- Assembly Language Segment | Previous | Next |
Changing the copy of a variable that is in a register does not change the copy of the variable that is in member! The register copy is a very temporary copy that will be destroyed!
32-bit Name | 16-bit Name | 8-bit Names | Additional Purpose | Notes |
---|---|---|---|---|
EAX | AX | AH, AL | Also used as the accumlator | |
EBX | BX | BH, BL | Also used as the base index register | |
ECX | CX | CH, CL | Also used as the counter register | |
EDX | DX | DH, DL | Also used as the I/O pointer | |
ESI | SI | none | Indexing register used to point to the source | |
EDI | DI | none | Indexing register used to point to the destination | |
EBP | BP | none | Used as the Frame Pointer | When mixing assembly language and any other language, DO NOT use this register |
ESP | SP | none | Stack Point. | DO NOT USE THIS REGISTER FOR ANYTHING! |
In the case of the EAX, EBX, ECX, and EDX registers if you change the [A-D]H or [A-D]L, you change the [A-D]X and the E[A-D]X registers! Also if you change the 16-bit register, you change the 32-bit register, since the bottom half the of the 32-bit register is the 16-bit register!
Name | Segment | Notes |
---|---|---|
CS | Code | |
DS | Data | |
SS | Stack | |
ES | Extra Segment register | |
FS | Extra Segment register | |
GS | Extra Segment register |
There are only 17 defined, and in this class, we are only concerned with four. The following detailed information is provided by Intel.
Bit | ID | Long Name | Purpose and Notes |
---|---|---|---|
0 | CF | Carry Flag | Set if an arithmetic operation generates a carry or a borrow out of the most-significant bit of the result; cleared otherwise. This flag indicates an overflow condition for unsigned-integer arithmetic. It is also used in multiple-precision arithmetic. |
6 | ZF | Zero Flag | Set if the result is zero; cleared otherwise. |
7 | SF | Sign Flag | Set equal to the most-significant bit of the result, which is the sign bit of a signed integer. (0 indicates a positive value and 1 indicates a negative value.) |
10 | DF | Direction Flag | Controls the String instructions. Setting the DF flag causes the string insturctions to auto- decrement (that is, to process strings from high addresses to low addresses). Clearing the DF flag causes the string instructions to auto-increment (process strings from low addresses to high addresses). |