Docsity

Computer Architecture and Organization - Assembly Language, Study notes of Computer Architecture and Organization

Partial preview of the text

Download Computer Architecture and Organization - Assembly Language and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Unit-1: Assembly Language

Programming

Re-Cap

1. ………… Register contains the 8-bit opcode instruction

being executed

2. ………………Register employed to temporarily hold the right –

hand instruction from a word in memory.

3. ………………..contains the address of the next instruction –pair

to be fetched from memory

4. …………………employed to temporarily hold operands and

results of ALU operations

5. …………………register employed to temporarily hold data and

instructions.

 Recap  Session Objectives & Teaching Learning Material  Session Plan  IAS computer Instruction Set  Assembly Language Programming  Example  Assignment  References OutLine

Session Objectives

◦ To provide the fundamentals of system and defi.

Teaching Learning Material

◦ LCD, White board Marker, Presentation slides

Objectives & Teaching Learning Material

Instruction Opcode Description  LOAD MQ 00001010 AC ← MQ  (^) LOAD MQ, M(X) 00001001 MQ ← M(X)  STOR M(X) 00100001 M(X) ← AC  LOAD M(X) 00000001 AC ← M(X)  LOAD – M(X) 00000010 AC ← – M(X)  (^) LOAD |M(X)| 00000011 AC ← |M(X)|  LOAD – |M(X)| 00000100 AC ← – |M(X)| IAS Data Transfer Instructions (7)

Instruction Opcode Description  (^) JUMP M(X,0:19) 00001101 next instruction M(X,0:19)  (^) JUMP M(X,20:39) 00001110 next instruction M(X,20:39)

IAS Unconditional Branch

Instructions (2)

Instruction Opcode Description

 ADD M(X) 00000101 AC ← AC+M(X)

ADD |M(X)| 00000111 AC ← AC+|M(X)|

 SUB M(X) 00000110 AC ← AC─M(X)

SUB |M(X)| 00001000 AC ← AC ─ |M(X)|

 MUL M(X) 00001011 AC, MQ ← MQ×M(X)

DIV M(X) 00001100 MQ, AC ← MQ/M(X)

 LSH 00010100 AC ← AC x 2

RSH 00010101 AC ← AC / 2

IAS Arithmetic Instructions

Instruction Opcode Description  STOR M(X,8:19) 00010010 M(X,8:19) ← AC(28:39)  STOR M(X,28:39) 00010011 M(X,28:39) ← AC(28:39) IAS Address Modify Instructions (2)

Assume that data variables ‘Y’ & ‘Z’ available

at memory locations 800 & 801 resly. And X

will be stored 802 onwards.

LOAD MQ, M(801) MQM[801]

MUL M(802) AcMQ * M[802]

STOR M(803) M[803]Ac

LOAD MQ AcMQ

STOR M(804) M[804]Ac

Solution for X=Y*Z

LOAD M(801) MUL M(802) STOR M(803) LOAD MQ STOR M(804) 0 0051 0052 0053 0054 0055 0056 0801 0802 0803 0804 0805 LOAD M(801) MUL M(802) STOR M(803) LOAD MQ STOR M(804) MARPC MBRM[MAR] IRMBR<0..7> MARMBR<8..19> IBRMBR<20..39> ACMBR MBRM[MAR] IRIBR<0..7> MARIBR<8..19> MBRM[MAR] ACAC * MBR < 0..39> PCPC+ MARPC MBRM[MAR] IRMBR<0..7> MARMBR<8..19> IBRMBR<20..39> MQAC * MBR < 40..79> M[MAR]MBR MBRAC IRIBR<0..7> ACMQ PCPC+ IRMBR<0..7> IBRMBR<20..39> MARMBR<8..19> M[MAR]MBR MBRAC LOAD MQ, M(801) MQM[801] MUL M(802) AcMQ * M[801] STOR M(803) M[803]Ac LOAD MQ AcMQ STOR M(804) M[804]Ac

IAS Computer Flow of Operation Flow- Chart

Write an assembly language programming

for the following code fragment and

Interpret to IAS computer flow of

operations.

if(x=0)

c=a*b;

else

c=a/b;

Where

Data variables are avaible from loation

address 500 onwards and program can be

stored at memory location 200 onwards.

Assignmet

William Stallings “Computer Organization

and architecture” Prentice Hall, 7th edition,

References