Assembly machine languages
This presentation is the property of its rightful owner.
Sponsored Links
1 / 19

Assembly & Machine Languages PowerPoint PPT Presentation


  • 107 Views
  • Uploaded on
  • Presentation posted in: General

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

Download Presentation

Assembly & Machine Languages

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Assembly machine languages

Assembly & Machine Languages

A Brief Overview

Jonathan-Lee

Jones


Overview of the module

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

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

Overview


Differences between machine language and assembly language

Differences between machine language and assembly 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


Differences between machine language and assembly language1

Differences between machine language and assembly language

Machine 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 language2

Differences between machine language and assembly language

Machine 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 language3

Differences between machine language and assembly language

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

  • 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 language1

Machine Language

Types of Instruction

Flow control

Branch (jump to address)

Conditional Branch (tests values)

Subroutine Calls

Return(from Subroutine)

Data Processing

op-code – what operation is required

source 1 – operand 1source 2 – operand 2destination

Data Move

(actually a copy not a move)


Machine language2

Machine Language

Processing instructions

  • How many bits required? addresses of operands and results

    • assume a 32 bit address for memorythis would allow for 232 bytes of addressable memorythis 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 !!

0101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110

01011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010110111001011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010110111001011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010110111001011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010110111001011011100101101110011011011100101101110011011011100101101110010110111001011011100101101110010110111001011011100101101110010110111001101101110010110111001101101110010110111001011011100101101110010110111001011011100101101110010110111001011011100110110111001011011100110110111001011011100101101110010110111001011011100101101110010111101110


Pep 8 virtual computer

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 computer1

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

Programming in Assembly Language

Program in assembly language

Program in machine

language

Input

Output

Assembler


Problem display hello

Problem: Display “Hello”

  • CHARO0x0048,i;

  • CHARO0x0065,I;

  • CHARO0x006C,I;

  • CHARO0x006C,i;

  • CHARO0x006F,I;

  • STOP

  • .END


Problem read and sum three values and print the sum

Problem: Read and sum three values and print the sum


  • Login