SCRAM Introduction - Department of Computer Science

SCRAM Introduction

Philipp Koehn 13 September 2019

Philipp Koehn

Computer Systems Fundamentals: SCRAM Introduction

13 September 2019

A Simple Computer

1

? Fully work through a computer ? circuit ? assembly code

? Simple but Complete Random Access Machine (SCRAM) ? every instruction is 8 bit ? 4 bit for op-code: 9 different operations (of 16 possible) ? 4 bit for address: 16 bytes of memory

? Background reading on web page: "The SCRAM"

Philipp Koehn

Computer Systems Fundamentals: SCRAM Introduction

13 September 2019

Operations

2

Operation HLT LDA LDI STA STI ADD SUB JMP JPZ

Code 0000 0001 0010 0011 0100 0101 0110 0111 1000

Description Halt, stop execution Load value from memory into accumulator Indirectly load value from memory into accumulator Store value from accumulator into memory Indirectly store value from accumulator into memory Add value from memory to accumulator Subtract value from memory from accumulator Jump to specified address Jump to specified address if zero flag is set

Philipp Koehn

Computer Systems Fundamentals: SCRAM Introduction

13 September 2019

Indirect Load?

3

? LDA x ? loads the value from address x

? LDI x ? looks up the value at address x ? treats that value as an address ? loads the value at that address

? Indirect load = use of pointer variable

Philipp Koehn

Computer Systems Fundamentals: SCRAM Introduction

13 September 2019

Instruction Encoding

4

Instruction Data

0001 0101

LDA

5

Load contents from address 5 into memory

Philipp Koehn

Computer Systems Fundamentals: SCRAM Introduction

13 September 2019

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download