Queen's School of Computing CISC324 - Winter 2023 Instructor: Dr. Anwar Hossain Due Date: Jan. 29 - 11:59 PM 3 Queen's UNIVERSITY Background and Outcomes In this lab, we will learn how to run some simple Assembly language instructions. An assembly language is a type of low-level programming language that is intended to communicate directly with a computer's hardware. Unlike machine language, which consists of binary and hexadecimal characters, assembly languages are designed to be readable by humans. Low-level programming languages such as assembly language are a necessary bridge between the underlying hardware of a computer and the higher-level programming languages-such as Python or JavaScript-in which modern software programs are written. Assembly is widely used in operating system development. In the late '90s, 90% of operating systems are developed using assembly, Ex :- MS-DOS (1.25 and 2.0) are written in x86 assembly. Later versions (4.0) were shifted to C. Bulk of Windows is written in C and C++ with a slight combination of Assembly. Assembly Language The assembly language that we will work with is based on the x86 instruction set architecture. General Purpose Registers General purpose registers are additional registers that are present in CPU which is used for either memory address or data whenever needed. For example, storing current register content when there is an interruption. Let us consider an 8086 processor. There are eight general purpose register in 8086 microprocessor which are explained below: 15 8 7 0 AX AH AL Accumulator Data Group BX BH CX CH BL CL Base Counter DX DH DL Data SP Stack Pointer Pointer and Index Group SI Source Index Base Pointer BP DI Destination Index 1
Queen's School of Computing CISC324 - Winter 2023 Instructor: Dr. Anwar Hossain Due Date: Jan. 29 - 11:59 PM Queen's UNIVERSITY AX This is the accumulator of 16 bits and is separated into two 8-bits registers AH and AL to likewise perform 8-bits instruction. It is usually utilized for arithmetical and logical directions, yet in 8086 chips it isn't required to have an accumulator as the objective operand. Example - ADD AX, AX (AX= AX+AX) BX This is the base register of 16 bits and is separated into two 8-bits registers BH and BL to likewise perform 8-bits instruction. It stores the value of offset. Example - MOV BL, [500] (BL= 500H) CX This is the counter register of 16 bits and is separated into two 8-bits registers CH and CL to likewise perform 8-bits instruction. It is generally utilized for looping and rotations. Example MOV CX,0005 MOV CL,5000 DX This is the data register of 16 bits and is separated into two 8-bits registers DH and DL to likewise perform 8-bits instruction. It is generally used for multiplication of an input/output port address. Example - Mul BX (DX,AX=AX*BX) SP This is the stack pointer of 16 bits that points to the topmost element of the stack. BP This is the base pointer of 16 bits that is used to access parameters that have