Assembly & Machine Languages

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Low-Level Programming Languages and Pseudocode Chapter 6.
Low-Level Programming Languages and Pseudocode Chapter 6.
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
19-1 Programming… The Pencil and Paper Computer The Pencil & Paper Instruction Set: (table on p148) The Operand specifies a memory location.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
Execution of an instruction
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Low-Level Programming Languages
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Overview The von Neumann Machine - the programmable digital computer Introducing the LC-3 Computer - A “toy” computer for us to learn from Computer machine.
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
State Machines Used to Design Sequential Circuits.
Computer Architecture
CPS120: Introduction to Computer Science
4-1 Chapter 4 - The Instruction Set Architecture Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring.
Instruction Set Architecture
Machine Instruction Characteristics
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
CS 147 June 13, 2001 Levels of Programming Languages Svetlana Velyutina.
Lecture 15 Today’s lecture MARIE programming Assembler
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
Computer Operations A computer is a programmable electronic device that can store, retrieve, and process data Data and instructions to manipulate the data.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Computer Architecture CSE 3322 Lecture 2 NO CLASS MON Sept 1 Course WEB SITE crystal.uta.edu/~jpatters.
Chapter 7 Low-Level Programming Languages (slides modified by Erin Chambers)
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
The Instruction Set Architecture. Hardware – Software boundary Java Program C Program Ada Program Compiler Instruction Set Architecture Microcode Hardware.
Georgia Institute of Technology Speed part 1 Barb Ericson Georgia Institute of Technology May 2006.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Assembly Language Programming of 8085 BY Prof. U. V. THETE Dept. of Computer Science YMA.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Hello world !!! ASCII representation of hello.c.
Operating Systems A Biswas, Dept. of Information Technology.
First Foray into Programming (the hard way). A reminder from last lesson: A machine code instruction has two parts:  Op-code  Operand An instruction.
Chapter 7: Low-Level Programming Languages Chapter 7 Low-Level Programming Languages Page 66 In order to execute instructions on a CPU, those instructions.
F453 Module 8: Low Level Languages 8.1: Use of Computer Architecture.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
GCSE COMPUTER SCIENCE Computers 1.5 Assembly Language.
Control Unit Lecture 6.
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
Assembly Language Assembly Language
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
Chapter 4 The Von Neumann Model
The Processor and Machine Language
BIC 10503: COMPUTER ARCHITECTURE
Mobile Development Workshop
MARIE: An Introduction to a Simple Computer
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Low Level Programming Languages
MARIE: An Introduction to a Simple Computer
CPU has 6 special locations called registers
Program Execution.
Chapter 6 Programming the basic computer
CS501 Advanced Computer Architecture
Hmmm Assembly Language
Algoritmos y Programacion
Chapter 4 The Von Neumann Model
Presentation transcript:

Assembly & Machine Languages A Brief Overview Jonathan-Lee Jones

Overview of the Module What operations can a computer can perform The Pep/8 virtual machine Immediate and direct addressing modes Writing simple machine-language programs Machine language and assembly language Creating and running an assembly-language program Writing simple programs using the Pep/8 virtual machine Concept of assembler instructions

What operations can a computer can perform Interact with I/O reading input Writing output reading the program (in memory) reading constant values (in memory) reading and writing variables (in memory) Executing instructions in machine language

Overview

Differences between machine language and assembly language The language made up of binary coded instructions built into the hardware of a particular computer and used directly by the computer

Differences between machine language and assembly language This is very hard to understand by a human. It is a series of numbers, originally binary, but hexadecimal is more common today.

Differences between machine language and assembly language This originated from the early days of computing, where there were limited mechanisms of input; such as punched cards and even just a series of dials and switches.

Differences between machine language and assembly language A language that uses mnemonic codes to represent machine-language instructions Much easier for the human to understand and read – though nowhere near as easy as high level languages. Harder for the computer to read! Requires and assembler to use. An assembler is program that reads each of the instructions in mnemonic form and translates it into the machine-language equivalent

Machine Language Machine language – The language made up of binary coded instructions built into the hardware of a particular computer and used directly by the computer Every processor type has its own set of specific machine instructions. The relationship between the processor and the instructions it can carry out is completely integrated. Each machine-language instruction does only one very low-level task Typically we have one instruction per “word” Types of Instruction data movement data processing op-code – what operation is required source 1 – operand 1 source 2 – operand 2 destination flow control (jumps)

Machine Language Types of Instruction Data Processing Flow control op-code – what operation is required source 1 – operand 1 source 2 – operand 2 destination Flow control Branch (jump to address) Conditional Branch (tests values) Subroutine Calls Return(from Subroutine) Data Move (actually a copy not a move)

Machine Language 0101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110 01011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010110111001011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010110111001011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010110111001011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010110111001011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010111101110 Processing instructions How many bits required? addresses of operands and results assume a 32 bit address for memory this would allow for 232 bytes of addressable memory this would need 96 bits for the addresses in an instruction lets suppose 16 bits for the op-code (216 instructions) Each instruction is 112 bits !!

PEP/8 Virtual Computer Instruction Format Operation code – Specifies which instruction is to be carried out Register specifier – Specifies which register is to be used (we will only use A for the moment) Addressing-mode specifier – Says how to interpret the operand part of the instruction

PEP/8 Virtual Computer Some Sample Instructions 0000 Stop Execution 1100 Load operand to A Register 1110 Store contents of A Register into operand 0111 Add operand to A Register 1000  Subtract operand to A Register 01001  Input character to operand 01010 Output character from operand Direct Addressing mode 000 Indirect addressing mode 001 11000000 0000000000000111 11000001 0000000000011111 11100000 0000000000000111 11000001 0000000000001010 01110000 0000001000001010 11000001 0000001000001010 01001001 0000000000001010 01010000 0000000001000001 01010001 0000000000001010

Programming in Assembly Language Program in assembly language Input Output Program in machine language Assembler

Problem: Display “Hello” CHARO 0x0048,i; CHARO 0x0065,I; CHARO 0x006C,I; CHARO 0x006C,i; CHARO 0x006F,I; STOP .END

Problem: Read and sum three values and print the sum