LMC Assembly Making Programming Friendlier. Machine Code Issues Have to remember numeric opcodes Have to think about physical memory locations – What.

Slides:



Advertisements
Similar presentations
GCSE Computing Lesson 5.
Advertisements

 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Cpe 252: Computer Organization1 Lo’ai Tawalbeh Programming The Basic Computer Chapter 6:
Learning how to use the Little man computer
The Little man computer
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
1 Registers and MAL - Part I. Motivation So far there are some details that we have ignored instructions can have different formats most computers have.
19-1 Programming… The Pencil and Paper Computer The Pencil & Paper Instruction Set: (table on p148) The Operand specifies a memory location.
LMC Little Moron Computer
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
The Little Man Computer
An Interactive Web-Based Simulation of a General Computer Architecture
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
Computer Science 101 Assembly Language. Problems with Machine Language Uses binary - No English-like words to make it more readable Uses binary - No English-like.
Computer Science 101 How the Assembler Works. Assembly Language Programming.
CHAPTER 6: The Little Man Computer
Lecture 1 Introduction to Computing Machinery. Colossus Joseph Marie Jacquard Charles Babbage Augusta Ada Countess of Lovelace.
Chapter 8: The Very Simple Computer
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
Computer Architecture Lecture 11 by Engineer A. Lecturer Aymen Hasan AlAwady 10/3/2014 University of Kufa - Information Technology Research and Development.
Assembly Language Friday, Week 5 Monday, Week 6. Assembly Language  Set of mnemonic names for the instructions in a particular computer's machine language.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
The Little-Man Computer Damian Gordon. The Little-Man Computer Most computer architectures conform to the so-called von Neuman Architecture. This means.
Computer Systems Organization
Dale & Lewis Chapter 5 Computing components
WHAT IS THE VALUE OF X? x = 0 for value in [3, 41, 12, 9, 74, 15] : if value < 10 : x = x + value print x.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
Assembly Language Programming of 8085 BY Prof. U. V. THETE Dept. of Computer Science YMA.
Binary! Objectives Recap what a instruction is Look at how binary can be used to store – Opcode – data.
This is where you can reset and run your program. If your program has an “INP” (input) command, you will type it in this box here. Using the LMC These.
Central Processing Unit Decode Cycle. Central Processing Unit Current Instruction Register (CIR) I1 The fetch cycle has transferred an instruction from.
Mastering LMC Coding Part #1 Introduction to Low Level Languages Introduction to Little Man computer Simple examples (demos) with video tutorials included.
First Foray into Programming (the hard way). A reminder from last lesson: A machine code instruction has two parts:  Op-code  Operand An instruction.
Instruction Memory value Description ADD1xx Add the value stored at memory address xx to the value in the accumulator register SUB2xx Subtract the value.
1. 2 TimeActivity 9:45Welcome and introductions 10:00What is a computer? 10:15What’s inside? 10:45Activity: A simple view of how computers work 11:15Coffee/tea.
A Level Computing – A2 Component 2 1f, 1g, 1h, 1i, 1j.
The Little man computer
CHAPTER 6: The Little Man Computer
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
CHAPTER 6: The Little Man Computer
Lesson Objectives A note about notes: Aims
Computer Organization and Design
Starter Read the Feedback Click on Add new Feedback Open Realsmart
BASIC COMPUTER ORGANIZATION AND DESIGN
Computer Architecture
The Little Man Computer
Computer Programming Machine and Assembly.
High Level Programming Languages
Assembler CASE Tool.
CHAPTER 6: The Little Man Computer
Introduction to Computing
ECEG-3202 Computer Architecture and Organization
Making Programming Friendlier
Do it now – PAGE 10 You will find your do it now task in your workbook – look for the start button! Tuesday, 15 January 2019.
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Computer Architecture
Business Programming I
LC-2: The Little Computer 2
LMC Little Man Computer What do you know about LMC?
Little Man Computer Lesson 2
DO IT NOW The LMC has the following instruction set:
Little Man Computer There’s a little man in the mailroom that follows each instruction to the letter but he can only follow one instruction at a time.
A Level Computer Science Topic 5: Computer Architecture and Assembly
Learning how to use the Little man computer
Create Folder Unit 5 (All work for this unit to be stored here)
Algoritmos y Programacion
Little Man Computer.
Presentation transcript:

LMC Assembly Making Programming Friendlier

Machine Code Issues Have to remember numeric opcodes Have to think about physical memory locations – What if I need to add 6 lines of code to this program?

Assembly Assembly Code : human readable machine code

Assembly Little Man Computer Assembly: Assembly Machine code 0 INP901 1 STA FIRST307 2 LDA TEN506 3 ADD FIRST107 4 OUT902 5 HLT000 6 TEN DAT FIRST DAT 0000 AssemblyMachine codeInstruction HLT000end (halt) ADD1xxadd SUB2xxsubtract STA3xxstore STore Accumulator value LDA5xxload LoaD into Accumulator BRA6xxbranch always BRanch Always BRZ7xxbranch if 0 BRanch if Zero BRP8xxbranch if >= 0 BRanch if zero or Positive INP901input OUT902output DAT data location Used to specify a memory location

DAT DAT Value: "this location is data" – Value is placed into memory 5 HLT000 6 TEN DAT FIRST DAT 0000

Identifier Identifier : Name for a memory location – Can come before any instruction IDENTIFIER INSTRUCTION … 5 HLT000 6 TEN DAT FIRST DAT 0000

No XX Assembly can use names for memory locations AssemblyMachine code 0 INP901 1 STA FIRST307 2 LDA TEN506 3 ADD FIRST107 4 OUT902 5 HLT000 6 TEN DAT FIRST DAT 0000

Names And Branch Use as target of branch: – #1 This is called LOOPSTART We add one to accumulator – #3 Branch to the instruction named LOOPSTART Assembly 0 LDA ZERO 1 LOOPSTART ADD ONE 2 OUT 3 BRA LOOPSTART 4 HLT 5 ZERO DAT 0 6 ONE DAT 1

Named Locations Named locations not affected by adding/removing code Ex: Add EXTRA lines – Assembly fine – Machine version broken AssemblyMachine code 0 INP901 1 STA FIRST307 2 LDA TEN506 3 ADD FIRST107 4 EXTRA 5 6 OUT902 7 HLT000 8 TEN DAT FIRST DAT 0000

Assembler An Assembler converts assembly to machine code: