CS401 HANDOUTS | Computer Architecture & Assembly Language Programming



CS401: Computer Architecture & Assembly Language Programming


Course Category: Computer Science/Information Technology

Course Outline

Basic Computer Architecture, Intel IAPX88 Architecture, Register Architecture, Addressing Modes, Address Wraparound, Branching, Conditional Jumps, Unconditional Jump, Bit Manipulation, Multiplication Algorithm, Shifting and Rotations, Extended Operations, Masking Operations, Subroutines, Stack, Parameter Passing through Stack , Display Memory, Display Memory Formation, Screen Location Calculation, String Instructions STOS, LODS, SCAS, MOVS and CMPS,










CS401: Computer Architecture & Assembly Language Programming Handouts
CS401: Computer Architecture & Assembly Language Programming Handouts


CS401: Computer Architecture & Assembly Language Programming

REGISTRS Computer Architecture & Assembly Language Programming Handouts

The main purpose of a computer is to perform tasks, and tasks require operands. Operands are the data from which we want to perform a specific task. Consider the function of extension; involves adding two numbers to get their total. We can have one address directly on the address bus and as a result have one item on the data bus. At the same time the second operand cannot be delivered within the processor. Once the second one is selected, the first operand is no longer available.

For this reason, there are temporary storage areas within the processor called registers. Now one operand can be read from the register and added to another read directly to the memory. Both are accessible at the same time, one inside the processor and the other outside the data bus. The result can be written to a different location as the task is complete and we can access a different memory cell. Sometimes we hold both systems in the registers so that we can work as well as we can within the processor no doubt faster than we have to go outside and bring a second operand.

The registers are like a ram scratch pad inside the processor and their performance is very similar to normal memory cells. They have certain areas and remember what is placed inside them. They are used when we need more than one data object within the processor at a time. The concept of the registers will be clarified as we continue to write our first plan.


There is a central register for all processors called an accumulator. Traditionally all mathematical and logical functions are performed in an accumulator. The word size of the processor is defined by the width of its accumulator. The 32bit processor has a 32-bit accumulator.

Pointer, Index, or Base Register

The name varies from the manufacturer, but the basic distinguishing feature is that it has no data but holds the data address. The reason can be understood by examining the “for” loop in high-level language, the elements that come out of the loop in the list of ten items found in successive memory cells. The zero point changes all duplicates. That is the address where the work done changes. The reference register is used in such a case to take the local address of the current system.

Now the value in the index register cannot be taken as data, but the address of the data. Usually whenever we need access to a memory location its address is unknown until working time we need a reference register. Without this register we will need to clearly document each review separately.

In new buildings the difference between the accumulator and the index register is not clear. They have standard registers with many functions and can perform both functions. They have special behavior but basic tasks can be performed in all general registers.

Flags Register or Program Status Word

This is a special register for all properties called the flag register or name of the program name. As an accumulator it registers 8, 16, or 32 bits but unlike the accumulator it does not mean anything as a unit, rather each piece has different meanings. The pieces of the accumulator work together harmoniously as a unit and each part means the same thing.

The pieces of the flag register work independently and individually, and together their value means nothing. An example of a common occurrence in the flag-carrying register. The object can be slightly contained as in binary arithmetic the object can be zero or one. When a 16bit number is added to a 16bit accumulator, and the result is 17 bits 17th bit is inserted into the control section of the flag register. Without this 17 bit answer the answer is incorrect. More examples of flags will be discussed when referring to a specific Intel subscription set.

Program Counter or Instruction Pointer

Everything has to be translated into a binary number so that our dumb processor can understand it, be it the operand or the function itself. The instructions themselves should therefore be interpreted numerically. For example adding numbers we understand the word “add.” We translate this word into numbers to make the researcher understand it. This number is the actual computer command. All objects, legacy and encapsulation formats in high quality languages ​​translate down into numbers just by the language of integration at the end. Addition, multiplication, variation; all major programs are made using these simple structures. The number is on the line as this is the only thing the computer can understand.


Common opcodes for all existing processors for data transmission, statistics and logical deception etc. However their mnemonics vary depending on the will of the manufacturer. Some manufacturers name mnemonics for data transmission commands such as “move,” others call it “upload” and “store” and some existing names. But the basic set of commands is the same for all processors. The integration of these instructions makes learning a new processor faster and easier. Just a group with orders says a lot about order.

Program Control Instructions

The instruction pointer points to the next instruction and instructions run one after the other with the help of this register. We can say that the instructions are tied with one another. In some situations we don’t want to follow this implied path and want to order the processor to break its flow if some condition becomes true instead of the spatially placed next instruction. In certain other cases we want the processor to first execute a separate block of code and then come back to resume processing where it left.


Stack is a data structure that works from the beginning to the end. It can contain many elements and there is only one way to get in and out of the container. When an element is inserted it stays above all other elements and when the element is removed the occupant is first removed. To visualize a building imagine a test tube and place balls in it. The second ball will reach the top and the third ball will reach the second. Only when the ball is released can it be pulled up.

The function of placing an element on top of a stack is called the push element and the function of removing the element at the top of the stack is called the output element. The final push comes out first; last in the first behavior. CS401 HANDOUTS


PUSH lowers the SP (stack index) in pairs and transfers the word from the active source to the top of the stack now identified by the SP. PUSH is often used to set limits on a stack before calling a process; generally, it is a basic way to store temporary data in a container.


POP transfers the current name of the stack (marked with SP) into the workplace and raises the SP in pairs to point to the top of the stack. POP can be used to temporarily remove dynamics from stack to registers or memory. Note that the PUSH function is called the source function as the data moves to the stack from the operand, while the POP function is called the destination as the data moves from the stack to the function.


CALL activates the offline process, storing data in the stack to allow the RET command (return) to the control system to control the message following CALL. At the CALL of the straight inner part, the SP is reduced by two and the IP is pushed into the stack. Related process to remove from CALL command and add to command notification. In CALL for direct intersegment, SP drops twice, and CS is pushed into the stack. CS replaces the component name contained in the command. The SP also dropped by two. The IP is pushed into the stack and replaced by the offset name in the message. CS401 HANDOUTS



CS401: Computer Architecture & Assembly Language Programming


Computer Science/Information Technology

Computer Architecture & Assembly Language Programming Handouts, CS401 HANDOUTS, VU HANDOUTS, ALL SUBJECTS VU HANDOUTS

Leave a Reply

Your email address will not be published.