assembly language IBM pc microprocessor, Lecture notes of Microcomputers

notes for book assembly language by Yutha yu and Charles

Typology: Lecture notes

2018/2019

Uploaded on 11/27/2019

astronomer-abdurrehman
astronomer-abdurrehman 🇵🇰

1 document

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 1
Microcomputer Systems
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download assembly language IBM pc microprocessor and more Lecture notes Microcomputers in PDF only on Docsity!

Chapter 1

Microcomputer Systems

Components of a Microcomputer System

  • (^) System Unit
    • (^) Contains circuit boards
    • (^) Motherboard
      • (^) main circuit board
      • (^) contains expansion slots for additional add-in boards
    • (^) CPU - Microprocessor - "brain of the computer"
    • (^) Memory circuits - store information
    • (^) I/O Circuits - Communicate with I/O Devices
  • (^) I/O Devices - peripheral devices
    • (^) Keyboard
    • (^) Display Screen - Monitor
    • (^) Disk Drives
    • (^) Printer

Memory Address

  • (^) Each memory address refers to 8 bits or 1 byte of data
  • (^) On 8086 microprocessor, each memory address is a 20 bit number (80286 uses a 24 bit address!)
  • (^) Thus 2^20 or 1,048,576 bytes = 1 megabyte of memory can be addressed with an 8086 microprocessor
  • (^) Note: The address of a byte in memory and the contents of a byte in memory are not the same thing

Bit Positions

Byte 7 6 5 4 3 2 1 0 Word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 High Byte Low Byte Note: When a word is stored in memory, the low byte is stored in the lower address and the high byte is stored in the higher address.

Buses

  • (^) A set of wires connecting different computer components that allow the CPU to communicate with memory and I/O circuits via signals
  • (^) Address bus
    • (^) holds the address of the memory location to be processed
  • (^) Control bus
    • (^) CPU sends control signals on the control bus to control various part of a computer system
  • (^) Data bus
    • (^) Receives data sent by memory circuits
  • (^) Refer to Figure 1.5 in the text

CPU

  • (^) Executes program instructions expressed in machine language - a series of binary bits
  • (^) Instructions are from 1 to 6 bytes long
  • (^) The instruction set for each CPU is unique - consists of a series of very basic operations
  • (^) 8086 Microprocessor Organization (Ref: Figure 1.6)
    • (^) Execution Unit (EU)
    • (^) Bus interface Unit (BIU)

Bus Interface Unit (BIU)

  • (^) Facilitates communications between EU and I/O circuits or memory
  • (^) Responsible for transmitting addresses, data, and control signals on the buses
  • (^) Five registers - hold addresses of memory locations
    • (^) CS - Code Segment
    • (^) DS - Data Segment
    • (^) SS _ Stack Segment
    • (^) ES - Extra Segment
    • (^) IP - Instruction Pointer - Contains the address of the next instruction to be executed by EU
  • (^) Internal Bus - connects EU with BIU
  • (^) Instruction prefetch
    • (^) while EU is executing an instruction, the BIU fetches up to 6 bytes of the next instruction and places them in the instruction queue - speeds up processing

I/O Ports

  • (^) I/O devices are connected to the computer through I/O circuits
  • (^) Each I/O circuit contains registers called I/O ports - some are used for data and others are used for control commands
  • (^) I/O ports are connected to the bus system and have an I/O address - these I/O addresses can only be referred to in input or output instructions
  • (^) CPU communicates with the I/O ports which in turn communicate with the I/O devices
  • (^) Serial Ports
    • (^) transfer data 1 bit at a time (Used for keyboards and a few slow printers)
  • (^) Parallel Ports
    • (^) transfer data 8 bits at a time (Used for disk drives and most printers)

Clock

  • (^) A clock circuit controls the processor by generating clock pulses
  • (^) The time between two pulses is the clock period
  • (^) The number of pulses per second is the clock rate or the clock speed - measured in Megahertz ( 1 million pulses per second)
  • (^) On the 8086 - a memory read takes 4 clock periods while a multiplication takes more than 70 clock periods!
  • (^) The faster the clock circuit, the faster the processor operates until it ultimately reaches its maximum clock speed

Common I/O Devices

  • (^) Floppy Disks
    • (^) 5 1/4 inch - low density (360K) high density (1.2M)
    • (^) 3 1/2 inch - low density (720K) high density (1.44M)
  • (^) Hard disks - fixed disk
  • (^) CD ROMS
  • (^) Keyboard
    • (^) has its own microprocessor that sends coded signals to computer
  • (^) Monitor
    • (^) controlled by video adapter circuit
  • (^) Printers
    • (^) give hardcopy output

Machine Language

  • (^) Each CPU can only execute its own machine language
  • (^) Machine Language is stored in binary code - a series of 0's and 1's
  • (^) Very difficult to write ML programs!
  • (^) Each family of CPU's has its own distinct machine language

Assembly Language

  • (^) Uses symbolic names to represent operations, registers, and memory locations
  • (^) Assembler
    • (^) a program that converts assembler language statements to machine language
  • (^) Still difficult because instruction set is so primitive
  • (^) One ALC statement usually translates to 1 ML statement
  • (^) Just as each computer has its own Machine Language - each computer has its own Assembler Language

Advantages of Assembly Language

  • (^) Efficiency
    • (^) Usually produces a faster, shorter machine language program
  • (^) I/O to certain specific locations can be done easily in ALC but is impossible in some high level languages
  • (^) Most high level languages accept ALC subroutines
  • (^) By studying assembler language, you can gain a feeling for how the computer “works” and why things happen the way they do inside a computer

Sample Program

TITLE PGM1_1: SAMPLE PROGRAM ;----------------------------> IN YU'S BOOK ON PAGE 14 .MODEL SMALL .STACK 100h .DATA A DW 2 B DW 5 SUM DW? .CODE MAIN PROC ;----------------------------> INITIALIZE DS MOV AX,@DATA MOV DS,AX ;----------------------------> ADD A AND B - PLACE RESULT IN SUM MOV AX,A ADD AX,B MOV SUM,AX ;----------------------------> EXIT TO DOS MOV AX,4C00h INT 21h MAIN ENDP END MAIN