The Computer / Memory & the CPU
Subtitles of the Movie
An Assembly Language instruction is written to work directly on a specific piece of hardware. You need to understand that hardware, the memory of the computer, is what is known as RAM, Random Access Memory. Now, that doesn't mean you get information out of it, or put it into it in a random way, it just means that you can choose any location in memory at random and address that memory location directly. You address it by using its number. This number is called its Address. Every byte in memory has its own address so you can consistently store information in and get information back from the same location. This numeric address can take different forms, but in our case it's a simple 32-bit number so you can directly address any byte in memory by using its own 32-bit number. Having such an addressing scheme causes a computer to be known as a 32-bit computer. So, this is the largest possible address. This is why 32-bit computers address a maximum of 4 gigabytes of RAM. It's possible to have more RAM than this, and we'll get into that a little later. The CPU, the Central Processing Unit, has some special locations for storing and working with data. These locations are called Registers and with Intel style chips they sort of evolved. Before there were 32-bit machines there were 16-bit machines, and before that there were 8-bit machines. This would be a bit who cares except that some of the architecture is still alive and kicking around inside the CPU that you're using now. To heck with history, let's just look at what you've got now. You've got four Registers shaped like this. The whole Register is 32 bits in size and you can address the whole thing at once, or you can use another name and address only the lower half of it as a 16-bit Register. The name of the 32-bit Register is ESI, the 16-bit lower half of it is called simply SI. There are a total of four of these Registers. They are: SI, DI, BP, and SP. The 16-bit versions have the same names as they did in earlier architectures. The Es were added in the expansion to 32-bits. I guess E stands for Extended, or Expanded, but you just need to remember that E stands for 32-bits, and that's not all. There are four more Registers shaped like this. Again, the letter E stands for the whole 32 bits, but the naming convention changes after that. The letter X stands for the 16-bit part, the letter H stands for the high-order 8 bits, the byte on the left, and the letter L stands for the low-order 8 bits, the byte on the right. For example, the A Register goes by one of these four names depending on which part of it you want to address: EAX is the whole thing, the full 32 bits; simply AX addresses only the 16-bit portion of it; AH is the name of the high-order byte; and AL is the name of the low-order byte. And there are four of these Registers. They're named: A, B, C, and D. You should be aware that using the names to address only part of a Register will in no way affect the other parts of the Register, so you can use these addressing schemes to put numbers together or pull them apart. But wait! There's more. There is the Instruction Pointer, the IP Register, is a 32-bit register that always holds the address of the next instruction to be executed. This is a very specialized Register. Whenever an instruction is to be executed the one this Register addresses is loaded and used. At that time the IP Register is moved forward to the next instruction. You can't write directly to this Register. What happens is, when you issue a branch instruction the new address is stored in this Register and away it goes. You need to be aware of the CS, DS, SS, and ES Registers. They are the Segment Registers. They are set by the Operating System and with the programming model that we'll be using, you can't write to them. Basically they determine which four gigabytes that you are able to address. OK, there's one more. There is a Register that is even more special than the IP Register, it is the 32-bit EFLAGS Register. This one is never used as a binary number like the others. This one is really a collection of named bits. I'll go into detail about the Flags in this one in the next lesson.
Tutorial Information
| Course: | Assembly Language Programming |
| Author: | Arthur Griffith |
| SKU: | 33995 |
| ISBN: | 1-935320-44-0 |
| Release Date: | 2009-05-28 |
| Duration: | 5.5 hrs / 70 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 81,350 Video Tutorials (20,800 free)
- Video Available as Flash or QuickTime
- Over 782 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 