Lecture 10.

Slides:



Advertisements
Similar presentations
Register In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than.
Advertisements

Chapter 2 (cont.) An Introduction to the 80x86 Microprocessor Family Objectives: The different addressing modes and instruction types available The usefulness.
Lecture # 12. PIC Printer Interface Printer IRQ7 INT ACK Printer Interface.
Divisor máximo de dois inteiros. unsigned int gcd(unsigned int A, unsigned int B) { if (B > A) return gcd(B,A); else if (B==0) return A; else return gcd(B,A%B);}
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
Lect 3: Instruction Set and Addressing Modes. 386 Instruction Set (3.4) –Basic Instruction Set : 8086/8088 instruction set –Extended Instruction Set :
Flow Diagram: Push flags, CS, IP Pop IP,CS,flags Push AX,BX,CX,DX,ES,DS,SI,DI,BP POP BP,DI,SI,DS,ES,DX,CX,BX,AX.
Tips for R3: Process Initialization When we create processes to represent our 5 test procedures we must correctly initialize its context by placing values.
BY Kamran Yousaf Application of Computer Graphics and Animation Using C++ Language.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2013 Lecture 4: 80386DX memory, addressing.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
Lecture 9. - Synchronous Devices require a timing signal. Clock generated Interval Timer Microprocessor Interval Timer Clk PCLK = MHz PCLK (for.
1/2002JNM1 Positional Notation (Hex Digits). 1/2002JNM2 Problem The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory.
Another Example: #include<BIOS.H> #include<DOS.H>
Programming the I/O Hardware Reference: –textbook: Tanenbaum ch.5.1 – s.htmlwww.cs.umb.edu/ulab/UsingCforHardwareReg.
Microprocessor Microprocessor (cont..) It is a 16 bit μp has a 20 bit address bus can access upto 220 memory locations ( 1 MB). It can support.
(-133)*33+44* *33+44*14 Input device memory calculator Output device controller Control bus data bus memory.
ROM BIOS Chapter 9. The ROM BIOS PC computer come with a set od built in routines collectively called the ROM BIOS. These routines are permanent part.
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
ΜComputer Structure μProcessor Memory Bus System I/O Ports.
#include <dos. h> void interrupt(
CS-401 Computer Architecture & Assembly Language Programming
Mouse Programming With “C” or “C++”
Lecture 2 Programming of 8086 Лектор: Люличева И.А. 1.
Format of Assembly language
Microprocessor Systems Design I
Programming the I/O Hardware
Introduction to 8086 Microprocessor
8254 – SOFTWARE PROGRAMMABLE TIMER
8086 Microprocessor.
Computer Organization & Assembly Language Chapter 3
Instruction Execution Cycle
ADDRESSING MODES.
ADDRESSING MODES.
CS-401 Compute Architecture & Assembly Language Programming
University of Gujrat Department of Computer Science
Mikroişlemci Sistemleri
Example 21H/42H: handle = open("c:\\abc.txt",O_RDONLY);
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
The slides must be understood in Lecture 5
Lecture 22.
שפת סף וארכיטקטורה של מעבד 8086
Programming the I/O Hardware
University of Gujrat Department of Computer Science
Lecture 5: Interrupts in Turbo C++
8086 Registers Module M14.2 Sections 9.2, 10.1.
CS-401 Computer Architecture & Assembly Language Programming
اصول اساسی برنامه نویسی به زبان اسمبلی
Interrupt Mechanism Interrupt Compared With Procedures Call MyProc
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
CS 301 Fall 2002 Computer Organization
Lecture 16.
CS-401 Computer Architecture & Assembly Language Programming
unsigned char far *scr=0xb ;
Symbolic Instruction and Addressing
Lecture 19.
Lecture # 11.
Computer Architecture CST 250
Unit-I 80386DX Architecture
Chapter 6 –Symbolic Instruction and Addressing
Lecture 17.
Intel 8086.
Microprocessor and Assembly Language
Lecture 24.
Presentation transcript:

Lecture 10

unsigned int divisor = 0x21FF; while (divisor >= 0x50) { unsigned long int * time = (unsigned long int *) 0x0040006C void main() { unsigned long int tx; unsigned int divisor = 0x21FF; while (divisor >= 0x50) { outportb(0x43,0xB4); outportb(0x42,*((char*)(&divisor))); outportb(0x42,*(((char*)(&divisor))+1)); outportb(0x61,Inportb(0x61) | 3); tx = *time; tx = tx + 4; while (*time <= tx); divisor =divisor -30; }

#include <dos.h> #include <bios.h> void interrupt (*oldint15) ( ); void interrupt newint15 (unsigned int BP, unsigned int DI, unsigned int SI, unsigned int DS, unsigned int ES, unsigned int DX, unsigned int CX, unsigned int BX, unsigned int AX, unsigned int CS, unsigned int IP, unsigned int flags); void main ( ) { oldint15 = getvect (0x15); setvect (0x15, newint15); keep (0, 1000); }

void interrupt newint15( unsigned int BP, unsigned int DI, unsigned int SI, unsigned int DS, unsigned int ES, unsigned int DX, unsigned int CX, unsigned int BX, unsigned int AX, unsigned int CS, unsigned int IP, unsigned int flags) { if (_AH = = 0x4F) { if (_AL == 0x1F) outport (0x43, 0xB4); outport (0x42, 0xFF); outport (0x42, 0x21); outport (0x61, Inport(0x61) ^ 3); } else (*oldint15) ( );

#include <dos. h> #include <bios #include <dos.h> #include <bios.h> unsigned int divisors[4]={0x21ff,0x1d45,0x1b8a,,0x1e4c}; unsigned long int far *time =(unsigned long int far *)0x0040006C; void main () { unsigned long int tx; int i=0; while (!kbhit()) { while (i<4) { outport(0x43,0xB4); outport(0x42,*((char *)(&divisor[i]))); outport(0x42,*(((char *)(&divisor[i]))+1)); outport(0x61, inport(0x61)|3); tx=*time; tx=tx+4; while (tx >= (*time)); i++; } i=0; } outport(0x61,inport(0x61)&0xFC); }

#include <stdio. h> #include <dos. h> #include <bios #include <stdio.h> #include <dos.h> #include <bios.h> struct tagTones { unsigned int divisor; unsigned int delay; }; struct tagTones Tones[4]={ {0x21ff,3},{0x1d45,2},{0x1b8a,3},{0x1e4c,4}}; int i,ticks,flag=0 ; void interrupt (*oldint15)(); void interrupt (*oldint8)(); void interrupt newint15(); void interrupt newint8();

unsigned char far *scr = (unsigned char far *)(0x00400017); void main () { oldint15=getvect(0x15); setvect(0x15,newint15); oldint8=getvect(0x08); setvect(0x08,newint8); keep(0,1000); }

void interrupt newint15() { if (_AH==0x4f) {. if ((_AL==0x1f)&&((( void interrupt newint15() { if (_AH==0x4f) { if ((_AL==0x1f)&&(((*scr)&12)==12)) { ticks=0; i=0; outport(0x43,0xb4); outport(0x42,*((char *)(&Tones[i].divisor))); outport (0x42,*(((char *)(&Tones[i].divisor))+1)); outport(0x61,inport(0x61)|3); flag=1; } else if ((_AL==0x1E)&&(((*scr)&12)==12)) { outport(0x61,inport(0x61)&0xfc); flag=0; } return; } (*oldint15)(); }

void interrupt newint8() { if (flag==1) {. ticks++; void interrupt newint8() { if (flag==1) { ticks++; if (ticks == Tones[i].delay) { if (i==3) i=0; else i++; outport (0x43, 0xB4); outport(0x42,*((char *)(&Tones[i].divisor))); outport(0x42,*(((char *)(&Tones[i].divisor))+1)); outport(0x61,inport(0x61)|3); ticks = 0; } } (*oldint8)(); }

Parallel Ports (PPI)

Parallel Communication Output D0 D7 Strobe Busy CPU D1 D2 Parallel Out Put Device

Parallel Communication Input D0 D1 D2 Parallel Input Device CPU D7 DR CPU I/O Controller

Only Economically Feasible For Small Distances Parallel Communication Faster Only Economically Feasible For Small Distances