HUMBOLDT-UNIVERSITÄT ZU BERLIN
COMPUTER SCIENCE DEPARTMENT
Systems Architecture Group

Head:Prof. Dr. Jens-Peter Redlich
Secretary: Silvia Schoch
Phone:+49(30)2093-41150

 

     

Lab (Praktikum) - Operating Systems Principles

Introduction

In our lab, an imaginary computer (HAL) will be used to experiment with elementary principles of computers and operating systems. We will implement an interpreter/emulator for the HAL computer and extend its features continuously throughout the semester.

An Instruction Set Architecture (ISA) defines how instructions are interpreted by a processor. The term "architecture" refers to the logical structure of the system that must be implemented in order for the instruction set to perform computations. This logical structure usually comprises memory, registers and their interactions with a central processing unit.

The ISA tends to form the interface between computer hardware and software. The architecture is usually implemented in hardware using electrical circuitry with many transistors to obtain a system that is able to perform logical operations. Computer scientists create software programs known as compilers that are able to translate code in high level languages into sequences of instructions.

For our purpose the ISA layer should be implemented in software.

 

The HAL architecture consists of:

  • a central processing unit (CPU),

  • memory buffer register (MBR, Accumulator),

  • main memory for programs (size m),

  • I/O module with l interfaces and n registers (register 0-9 for internal use, e.g. program counter)

The instruction set is defined as followed.

An instruction consists of 2 parts:

  • instruction name

  • operand (optional)

A HAL program is thereby a sequence of instructions, which are sequentially stored in the memory (one memory cell for each instruction). The following table describes the instruction set supported by HAL:

Name

Operand

Description

START

 

starts the program

STOP

 

stops the program

OUT

s

prints out the content of accumulator on I/O interface s

IN

s

reads from I/O interface s and stores the value in accumulator

LOAD

r

loads the content of register r into accumulator

STORE

r

stores the content of accumulator in register r

LOADNUM

k

loads the constant k into accumulator

JUMPNULL

a

conditional branching (jump if accumulator has zero value)

JUMPNEG

a

conditional branching (jump if accumulator has negative value)

JUMPPOS

a

conditional branching (jump if accumulator has positive value)

JUMP

a

unconditional branching

ADD

r

adds the content of register r to accumulator

ADDNUM

k

adds the constant k to accumulator

SUB, MUL, DIV

 

see ADD

SUBNUM, MULNUM, DIVNUM

 

see ADDNUM

A HAL program is always executed sequentially.

Example:

Add two numbers (from I/O channel 1) and print the result (on I/O channel 2):


Legal disclaimer. .  © 2024 Humboldt-Universität zu Berlin, Computer Science Department, Systems Architecture Group.Contact: sar@informatik.hu-berlin.de .