Mid-term Exam Basics & intuitive All materials till-to-date – very simple! Ref. book – Assembly Language Programming and Organization of the IBM PC, by.

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

R4 Dynamically loading processes. Overview R4 is closely related to R3, much of what you have written for R3 applies to R4 In R3, we executed procedures.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#4)
Set 20 Interrupts. INTERRUPTS The Pentium has a mechanism whereby external devices can interrupt it. Devices such as the keyboard, the monitor, hard disks.
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
CSS 372 Lecture 1 Course Overview: CSS 372 Web page Syllabus Lab Ettiquette Lab Report Format Review of CSS 371: Simple Computer Architecture Traps Interrupts.
Processes CSCI 444/544 Operating Systems Fall 2008.
CS2422 Assembly Language & System Programming November 2, 2006.
Kip Irvine: Assembly Language for Intel-Based Computers Overview Stack Operations (PUSH and POP) Procedures Procedure Parameters Software Interrupts MS-DOS.
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
Guide To UNIX Using Linux Third Edition
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
‘C’ LANGUAGE PRESENTATION.  C language was introduced by Dennis Ritchie..  It is a programming language, which can make a interaction between user and.
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
Assembly & Machine Languages
Programming the Microprocessor A Course in Microprocessor Electrical Engineering Dept. University of Indonesia.
Interrupts. 2 Definition: An electrical signal sent to the CPU (at any time) to alert it to the occurrence of some event that needs its attention Purpose:
Fundamentals of Assembly language
Computer Organization
ICS312 Set 4 Program Structure. Outline for a SMALL Model Program Note the quiz at the next lecture will be to reproduce this slide.MODEL SMALL.586 ;
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.
ORG ; FOUR INT 21H and INT 10H Programming and Macros Dec Hex Bin
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.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
MIPS coding. SPIM Some links can be found such as:
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
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.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
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.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Microcode Source: Digital Computer Electronics (Malvino and Brown)
Multiplication and Division Instructions & the 0Ah function.
Objective At the conclusion of this chapter you will be able to:
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
L AB 2. P ROGRAM STRUCTURE The assembly language program consist of code, data and stack. Data segment: contains all the variable definition..Data Code.
21/11/2005CAP2411 Input & Output Instructions CPU communicates with the peripherals through I/O registers called I/O ports. There are 2 instructions, IN.
Software Interrupt Instruction ‘int’ A ‘int’ instruction is like a special kind of subroutine call. Will discuss details later ‘int’ stands for INTERRUPT.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
Lecture 9 (The Stack and Procedures). 1 Lecture Outline Introduction The Stack The PUSH Instruction The POP Instruction Terminology of Procedures INDEC.
In Class Program Write, assemble and test a program: –Use the DB directive to define the following list of numbers and name it array: 31h, 32h, 33h, 34h.
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.
BIOS and DOS Interrupts Basic Input /Outpu System Disk Operating System.
Assembly Language Lecture 2. Lecture Outline Program Structure Memory models Data Segment Stack Segment Code Segment Input and Output Instructions INT.
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
Program Structure Example for Data Segment CRLF EQU 0DH, 0AH PROMPT DB 'Enter a digit between 0 and 9', 0 VAR1 DB ? ARRAY DW 1234h, 23h, 0FF54h.
A computer consists of five functionally independent main parts.
1st prog! Q: Read a char – from a keyboard & display it at the beginning of the next line! ====== A.
Microprocessor and Assembly Language
Microprocessor and Assembly Language
Computer Organization & Assembly Language
CS 301 Fall 2001 – Chapter 3 Slides by Prof. Hartman, following “IBM PC Assembly Language Programming” by Peter Abel 9/17/2018.
Chapter 8 Input/Output I/O basics Keyboard input Monitor output
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
The slides must be understood in Lecture 5
Final Exam Review Department of Electrical and Computer Engineering
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
Chapter 4 –Requirements for coding in Assembly Language
Symbolic Instruction and Addressing
Chapter 4 –Requirements for coding in Assembly Language
INTRODUCTION ABOUT ASSEMBLY
Unit:08 Software Interrupts
Assembler Directives end label end of program, label is entry point
Chapter 6 –Symbolic Instruction and Addressing
By Nasser Halasa Assembly Language.
Microprocessor and Assembly Language
Presentation transcript:

Mid-term Exam Basics & intuitive All materials till-to-date – very simple! Ref. book – Assembly Language Programming and Organization of the IBM PC, by Y. Yu & C. Marut Written exam

Smile – though your heart is breaking! Enjoy with study!

4.7 Program Structure Machine lang progs consist of – Code – Data – Stack Each part occupies a memory segment

4.7.1 Mem Models.MODEL memory_model; directive Mem. Models  – SMALL  Code in 1 segment, data in 1 seg. – MEDIUM  Code in 1+ seg, data in 1 seg – COMPACT… – LARGE…array in max. 64KB – HUGE

Data segment Contains all the variable definitions Const. definitions too in most cases [cost. defn – no memory is involved, so anywhere].DATAdirective.DATA HASINADW2 KHALEDADW5 ERSHADEQU b ; named constants – equates

Stack segment To set a block of memory to store the stack.STACKsize ; max stack size ; size is optional no..STACK100H ; sets 100h Bytes for the stack area. ; if no size is mentioned – 1 KB is assigned

Code segment Contains a program’s instructions.CODE name ; name is optional ; NO need for name in SMALL program -Insides a code segment – instructions are organized as procedures.

A simple procedure name PROC ; body of the procedure nameENDP ; end procedure

Defn. of a CODE segment.CODE MAINPROC ; main procedure instructions MAINENDP ; other procedures go here

…together! A typical form for SMALL model.MODEL SMALL.STACK100h.DATA ;data definitions go here.CODE;SMALL – so no name MAINPROC ;instructions go here MAINENDP ;other instructions go here ENDMAIN

4.8 I/O Instructions Instructions to access I/O ports directly – – IN – OUT ; provides first I/O ; less used

2 types of I/O service routines – 1.BIOS [Basic I/O System] routines  BIOS routines r stored in ROM,  interact directly with the I/O ports  see chap DOS [Disk OS] routines  can do more complex tasks

INT instruction To invoke a DOS or BIOS routine – INT [Interrupt] instruction is used. Interrupt  A signal to a computer that stops the execution of a running program so that another action can be performed. INTint_no.

int_no.  is a number that specifies a routine INT 16h  invokes a BIOS routine that performs keyboard input – Chap. 15 for more INT21h  invokes a large no. of DOS functions – Appendix C for more

INT 21h ( invokes no. of DOS functions ) A particular function is requested by placing a function no. in the AH register & invoke INT 21h Function No.Routine 1single-key input 2single-character output 9character string output

INT 21h functions expect input values to be in certain reg. & return output in other reg. Function 1: Single-key input Input: AH = 1 Output:AL = ASCII code if character key is pressed = 0 if non-character key is pressed

Function 2: Single-character output / control func. Input: AH = 2 DL= ASCII code of the display char or control char Output:AL = ASCII code of the display char or control char Function 2: Some control functions ASCIISymbolFunction 7BELbeep sound 8BSbackspace 9HTtab …

1 st prog! Q: Read a char – from a keyboard & display it at the beginning of the next line!