Lecture 11 Last notes on interrupts and exam review Dr. Dimitrios S. Nikolopoulos CSL/UIUC.

Slides:



Advertisements
Similar presentations
DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
Advertisements

NEG Instruction Change operand content into two’s complement (negative value) and stored back into its operand mov bl, b neg bl; bl = mov.
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
Computer Organization & Assembly Language
80x86 Instruction Set Dr. Qiang Lin.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#4)
8086 : INSTRUCTION SET By, Pramod Sunagar Assistant Professor
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Chapter 7 Programming with DOS and BIOS Function Calls Objectives: The use of DOS and BIOS function call How to read the PC’s keyboard How to send text.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 5 Arithmetic and Logic Instructions.
Flow Control Instructions
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Kip Irvine: Assembly Language for Intel-Based Computers
Shift and Rotate Instructions
Microcomputer & Interfacing Lecture 3
8.4 Instruction Execution Times TOBIN PROC FAR SUB AX,AX MOV DX,AX MOV CX,4 NEXTD: PUSH CX SUB BP,BP MOV CX,4 GETNUM: RCL BX,1 RCL BP,1 LOOP GETNUM.
BR 6/001 Ways to Handle I/O (Input/Ouput) For Output –Use Irvine16 Functions Writechar, WriteBin, WriteInt, Writehex, Writestring –Use DOS (Int 21h) Functions.
Lecture 10 Interrupts, Part 2, putting it all together Dr. Dimitrios S. Nikolopoulos CSL/UIUC.
Micro-Computer Applications: Procedures & Interrupts Dr. Eng. Amr T. Abdel-Hamid ELECT 707 Fall 2011.
Lab 5 Part C Write to the screen a character string that uses a ‘$’ to indicate the end of the string. Do not write the ‘$’ to the screen. Use DOS Interrupt.
BIOS1 Basic Input Output System BIOS BIOS refers to a set of procedures or functions that enable the programmer have access to the hardware of the computer.
BIOS1 Basic Input Output System BIOS BIOS refers to a set of procedures or functions that enable the programmer have access to the hardware of the computer.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
BIOS and DOS Programming in DOS INT 10 and 21H. Interrupts There are some extremely useful subroutines within BIOS or DOS that are available to the user.
1 Screen and Keyboard Operations Suthida Chaichomchuen
1 Chapter 5: Procedures and Interrupts Assembly Language for Intel-Based Computers, Kip R. Irvine 3rd edition 3/17/2000.
ICS312 Set 9 Logic & Shift Instructions. Logic & Shift Instructions Logic and Shift Instructions can be used to change the bit values in an operand. The.
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
Lecture 7 A closer look at procedures Dr. Dimitrios S. Nikolopoulos CSL/UIUC.
5. Assembly Language. Basics of AL Program data Pseudo-ops Array Program structures Data, stack, code segments.
Video systems. Lesson plan Review the code for the previous exercise Video systems Review for midterm exam.
8086 Microprocessor Interrupts By: Vijay Kumar. K Reference From Slide Share.
21/11/2005CAP2411 Input & Output Instructions CPU communicates with the peripherals through I/O registers called I/O ports. There are 2 instructions, IN.
1 Logic, Shift, and Rotate Instructions Read Sections 6.2, 7.2 and 7.3 of textbook.
Software Interrupt Instruction ‘int’ A ‘int’ instruction is like a special kind of subroutine call. Will discuss details later ‘int’ stands for INTERRUPT.
10H Interrupt. Option 0H – Sets video mode. Registers used: – AH = 0H – AL = Video Mode. 3H - CGA Color text of 80X25 7H - Monochrome text of 80X25 Ex:
EEL 3801 Part IV The Assembler. OFFSET Operator Returns address of variable used as operand. Actually, it represents the offset from the beginning of.
Review Yuanqing Cheng. Outline Part I: Introduction of X86 based computing system Part II: Assembly programing Part III: Interfacing circuit design.
October 1, 2003Serguei A. Mokhov, 1 SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003.
Irvine, Kip R. Assembly Language for Intel-Based Computers. Chapter 7: Integer Arithmetic Slides to Accompany Assembly Language for Intel-Based Computers,
ECE291 Lecture 10 Interrupts II. ECE 291 Lecture 9Slide 2 of 22 Lecture outline Installing/Removing ISRsInstalling/Removing ISRs Interrupt SchedulingInterrupt.
Control Structure vs. Assembly Language NASM. If-then-else If conditional then then_actions jump to endif else else_actions endif.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
Microprocessor & Assembly Language Arithmetic and logical Instructions.
BIOS and DOS Interrupts Basic Input /Outpu System Disk Operating System.
Calling Procedures C calling conventions. Outline Procedures Procedure call mechanism Passing parameters Local variable storage C-Style procedures Recursion.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
File Operations. FILE PROCESSING For the purposes of the following discussion, reading means copying all or part of an existing file into memory Writing.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Data Transfers, Addressing, and Arithmetic
Microprocessor and Assembly Language
Additional Assembly Programming Concepts
Microprocessor Systems Design I
EE3541 Introduction to Microprocessors
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Multiplication and Division Instructions
Machine control instruction
Assembly Language Programming Part 2
(The Stack and Procedures)
INSTRUCTION SET OF 8086 PAWAN KUMAR SINGH.
4.4 Bit Manipulation Instructions
Chapter 8 Central Processing Unit
(The Stack and Procedures)
Shift & Rotate Instructions)
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Multiplication and Division Instructions
Multiplication and Division Instructions
(The Stack and Procedures)
Presentation transcript:

Lecture 11 Last notes on interrupts and exam review Dr. Dimitrios S. Nikolopoulos CSL/UIUC

ECE291 Lecture 112 Installing ISR Interrupts can be installed, chained, or called Install New interrupt replace old interrupt Chain into interrupt Service myCode first Call Original Interrupt Service MyCode last MyIntVector Save Registers Service Hardware Reset PIC Restore Registers IRET MyIntVector Save Registers MyCode Restore Registers JMP CS:Old_Vector MyIntVector PUSHF CALL CS:Old_Vector Save Registers MyCode Restore Registers IRET

ECE291 Lecture 113 INT 21h DOS provides INT 21h, which is called the DOS function dispatcher and supports functions such as: read from the keyboard, write to the screen, write to the printer, read and write to disk files, etc. INT 21h must be told which function is being requested –this information is passed by placing the function number in the AH register –depending on the function being used, other information may be needed

ECE291 Lecture 114 INT 21h, AH = 02h DOS 1+ - WRITE CHARACTER TO STANDARD OUTPUT AH = 02h DL = character to write Return: AL = last character output (despite the official docs which state nothing is returned) Notes: ^C/^Break are checked, and INT 23 executed if pressed. Standard output is always the screen under DOS 1.x, but may be redirected under DOS 2+. The last character output will be the character in DL unless DL=09h on entry, in which case AL=20h as tabs are expanded to blanks. If standard output is redirected to a file, no error checks (write- protected, full media, etc.) are performed

ECE291 Lecture 115 INT 21h, AH = 6 DOS 1+ - DIRECT CONSOLE OUTPUT AH = 06h DL = character to output (except FFh) Return: AL = character output (despite official docs which state nothing is returned) (at least DOS ) Notes: Does not check ^C/^Break. Writes to standard output, which is always the screen under DOS 1.x, but may be redirected under DOS 2+

ECE291 Lecture 116 Displaying A Single Character Using INT 21h Example: Suppose that the letter ‘A’ is to be printed to the screen at the current cursor position Can use function 02h or 06h INT 21h must also be told which letter to print – the ASCII code must be placed into DL register MOVDL, ‘A’ MOVAH, 06h INT21h

ECE291 Lecture 117 INT 21h, AH = 09h DOS 1+ - WRITE STRING TO STANDARD OUTPUT AH = 09h DS:DX -> '$'-terminated string Return: AL = 24h (the '$' terminating the string, despite official docs which state that nothing is returned) Notes: ^C/^Break are checked, and INT 23 is called if either pressed. Standard output is always the screen under DOS 1.x, but may be redirected under DOS 2+. Under the FlashTek X-32 DOS extender, the pointer is in DS:EDX

ECE291 Lecture 118 Displaying A Character String Using INT 21h DOS function 09h displays a character string that ends with ‘$’ MSGDB‘This is a test line’,’$’ … MOVDX, MSG MOVAH, 09h INT21h The string will be printed beginning at the current cursor position

ECE291 Lecture 119 INT 21h, AH = 01h DOS 1+ - READ CHARACTER FROM STD INPUT, WITH ECHO AH = 01h Return: AL = character read Notes: ^C/^Break are checked, and INT 23 executed if read. ^P toggles the DOS-internal echo-to-printer flag. ^Z is not interpreted, thus not causing an EOF if input is redirected. Character is echoed to standard output. Standard input is always the keyboard and standard output the screen under DOS 1.x, but they may be redirected under DOS 2+

ECE291 Lecture 1110 Reading A Single Character Using INT 21h DOS function 01h reads a single character typed from the keyboard and echoes that character to the screen MOVAH, 01h INT21h The computer will wait until the user presses a key, then input character will be in AL

ECE291 Lecture 1111 INT 10h The DOS function calls allow a key to be read and a character to be displayed but the cursor is difficult to position at a specific location on the screen. The BIOS function calls allow more control over the video display and require less time to execute than the DOS function calls BIOS provides interrupt INT 10h, known as the video interrupt, which gives access to various functions to control video screen Before we place information on the screen we should get the position of the cursor: function 03h reads cursor position (DH=Row, DL=Column, BH=Page #) function 02h sets cursor position (DH=Row, DL=Column, BH=Page #)

ECE291 Lecture 1112 INT 10h Function 0Fh finds the number of the active page –the page number is returned in the BH register The cursor position assumes that –the left hand page column is column 0 progressing across a line to column 79 –the row number corresponds to the character line number on the screen, the top line being line 0

ECE291 Lecture 1113 Monolithic example

ECE291 Lecture 1114 Instructions Mov Arithmetic (add adc sub sbb div idiv mul imul dec inc neg) Logic (and or xor not cmp loop) Shifting (shl shr sar sal rol ror rcl rcr) Procedures (call ret retf int iret, similarities/differences) Jumping (jmp j– loop loop??)

ECE291 Lecture 1115 Exam review Registers –What they are –What they do or are used for –How they are accessed Memory –Its overall structure –How it is addressed –Contents (addresses and data) –Segment:offset notation and finding effective addresses –What registers can address it –What memory access instructions are valid Variables/Arrays/Tables –How to declare –How to access –What effect various directives have on memory

ECE291 Lecture 1116 Exam review Arithmetic and logic –How the instructions we looked at work –In general what flags they affect –Difference between signed and unsigned operands Jumping –Know how to handle signed vs. unsigned operands—know what flag conditions apply to each –Know the different types of jumps (short, near, far, conditional) –Be able to evaluate an instruction and determine what a given conditional jump statement will do

ECE291 Lecture 1117 Exam review Procedures and macros –Understand the entire procedure calling mechanism –How CALL, FAR CALL, and INT work and how they differ –Know the difference between procs and macros Interrupts –Know what the int vec tab is and where it’s located –Know how ISR’s differ from regular procedures –Fundamentals of interrupts (priority, critical regions, etc.) –Understand the function of the 8259A programmable interrupt controller

ECE291 Lecture 1118 Exam preview Structure and organization –160 points theory and program analysis –40 points coding problem Example coding problem –Change characters in a string from lower case to upper case –Calculate area of a rhombus