Assignment Help, Cloud Based ERP System, Microsoft NAV Certification
WELCOME !!

Please Register, ask for assignment solutions & post the solutions if you know any.

LETS START POSTING YOUR IDEAS AND THOUGHTS AND BUILD THE COMMUNITY OF EXPERTS.

Assignment Help, Cloud Based ERP System, Microsoft NAV Certification

Stock Market, Online Tutoring, Cloud Based ERP System, Microsoft Dynamics Reporting, Microsoft Nav Certification


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

For this tutorial it is assumed that the reader:

- has some basic knowledge about processor architectures;
- wants to begin to work in assembly language;
- has some programming knowledge.

Registers

Registers are places in the CPU where a number can be stored and manipulated. There are three sizes of registers: 8-bit, 16-bit and on 386 and above 32-bit. There are four different types of registers:

- general purpose registers,
- segment registers,
- index registers,
- stack registers.

First, we are going to describe the main registers. Later, we are going to describe the stack registers. The main registers are 16-bit registers. There are four general purpose registers: AX, BX, CX and DX. They are split up into 8-bit registers. AX is split up into AH which contains the high byte and AL which contains the low byte. On 386's and above there are also 32-bit registers, these have the same names as the 16-bit registers but with an 'E' in front i.e. EAX. You can use AL, AH, AX and EAX separately and treat them as separate registers for some tasks.

Index Registers

These registers are sometimes called pointer registers. They are 16-bit registers and are mainly used for string instructions. There are three index registers SI (source index), DI (destination index) and IP (instruction pointer). On 386's and above there are also 32-bit index registers: EDI and ESI. You can also use BX to index strings.

Stack Registers

BP and SP are stack registers and are used when dealing with the stack. We will discuss about them when we will talk about the stack.

Stack Registers

The designers of the 8088 decided that the maximum need for memory space will be one megabyte. So, the chip they build cannot go above that. The problem is to access a whole megabyte 20 bits are needed. But registers only have 16 bits so 4 more bites are needed. They came up with what they thought was a clever way to solve this problem: segments and offsets. This is a another way to do the addressing with two registers but not using 32 bits. To compute every single address the segment address as well as the offset are needed. A segment is usually 64kBytes long. To address a location inside a segment, we need the offset (16 bytes long).

The Stack

As the number of registers used is low, how do they manage to manipulate the data? There is something called a stack which is an area of memory which you can save and restore values to. To physically imagine this we can conside a stack of plates. The last one you put on is the first one that you take off. This is sometimes referred to as Last On First Off (LOFO) or Last In First Out (LIFO). But, you have to be sure that you do not put to much data in the stack.

Equates

In assembly language, constant values are known as equates, referring to the EQU directive that associates values with identifiers such as "BaseAddress" and "MaxValue". It is important to note that equates may appear anywhere in the program without restriction. Several examples are given below:

Count EQU 10
Number EQU 5
Price = Count * Number
MyCat EQU "Giully"

- after declaring a symbol with EQU you cannot change its associated value,
- the values declared with "=" can be changed as often as you want,
- EQU can declare all kinds of equates including numbers, expressions and characters,

Further Tutorial will be published on next day
[i]

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum