Mouse Question #1 Which INT number is used for the mouse?

Slides:



Advertisements
Similar presentations
Computer Programming Spring-2007
Advertisements

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.
University of Tehran 1 Microprocessor System Design Interrupt Omid Fatemi
As you play this presentation, fill in the Word Window Worksheet. On the following slide, click on each labeled part of the window to identify the part.
ICS312 Set 6 Operands. Basic Operand Types (1) Register Operands. An operand that refers to a register. MOV AX, BX ; moves contents of register BX to.
Mouse handling Suthida Chaichomchuen
Video systems (continue). Practice Modify the program to get a string from a keyboard to display the input string on the middle of the screen with reverse.
Lecture 6 Machine Code: How the CPU is programmed.
Assembly Language for Intel-Based Computers Chapter 15: BIOS-Level Programming (c) Pearson Education, All rights reserved. You may modify and.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| WISL |||||||||||| 1 User Commands WISL Tutorials.
SET 19 PROGRAMMING THE MOUSE. Mouse Features All mouse operations within a program are performed by standard INT 33H functions of the form: MOV AX, function.
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.
8.7 Memory management Program E Program D System memory DOS INT 21, function 48H: Allocate Memory Specification: allocates a number of memory paragraphs.
Flow Control Instructions
Kip Irvine: Assembly Language for Intel-Based Computers
80x86 Processor Architecture
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.
Graphing Linear Equations From the beginning. All the slides in this presentation are timed. You do not need to click the mouse or press any keys on the.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#8) By Dr. Syed Noman.
Equivalent Fractions Equivalent Fractions Using Cross-Multiplication.
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.
Lecture 11 Last notes on interrupts and exam review Dr. Dimitrios S. Nikolopoulos CSL/UIUC.
ECE291 Computer Engineering II Lecture 13 Dr. Zbigniew Kalbarczyk University of Illinois at Urbana- Champaign.
The x86 PC Assembly Language, Design, and Interfacing By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey © 2010, 2003, 2000, 1998 Pearson.
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.
Assembly Language for x86 Processors 6th Edition
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.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 27 - Phone Book Application Introducing Multimedia.
GRAPHICS AND MOUSE PROGRAMMING IN C. Turbo C has a good collection of graphics libraries. If you know the basics of C, you can easily learn graphics programming.
1 Screen and Keyboard Operations Suthida Chaichomchuen
Lab 8 Bit-Mapped Graphics Moving from text-based graphics to bit- mapped graphics. Easy to draw graphic points and lines using INT 10h, Function 0Ch (write.
1 Microprocessor-based Systems Course 8 Design of input/output interfaces.
Text-Mode Programming Question #1 What are the three levels of access to the video display when writing characters on the screen in text mode?
Computer Science 112 Fundamentals of Programming II Command Buttons and Responding to Events.
Topic: The Cartesian Axis/Graphing Objective: I will be able to plot given points on an axis. How do I graph (x, y) coordinates on a Cartesian axis? Today’s.
Quick Access Toolbar Provides easy access to frequently used commands. Commands are always available, regardless of task being performed. Contains Save,
Binary Number Output To display a number in binary format, a program looks at each bit in the number and sends the ASCII equivalent of a ‘1’ (31h) or a.
Video systems. Lesson plan Review the code for the previous exercise Video systems Review for midterm exam.
CIS 3.5 Lecture 2.2 More programming with "Processing"
Variables Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Mouse Inputs in Processing. Interacting with the Mouse mouseX and mouseY: pg mouseXmouseY –The position of the mouse in the canvas pmouseX and.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
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:
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 2 More Programming with Processing.
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.
LEA instruction The LEA instruction can be used to get the offset address of a variable Example ORG 100h MOV AL, VAR1 ; check value of VAR1 by moving it.
FUNCTION TRANSLATIONS ADV151 TRANSLATION: a slide to a new horizontal or vertical position (or both) on a graph. f(x) = x f(x) = (x – h) Parent function.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
2/20/2016CAP 2211 Flow Control Instructions. 2/20/2016CAP 2212 Transfer of Control Flow control instructions are used to control the flow of a program.
Calling Procedures C calling conventions. Outline Procedures Procedure call mechanism Passing parameters Local variable storage C-Style procedures Recursion.
Internal Programming Architecture or Model
Lecture 11 Text mode video
Section 4.2.  Label the quadrants on the graphic organizer  Identify the x-coordinate in the point (-5, -7)
File Operations. FILE PROCESSING For the purposes of the following discussion, reading means copying all or part of an existing file into memory Writing.
Computer Graphics Lecture 04 Point Taqdees A. Siddiqi
Mouse Programming With “C” or “C++”
Format of Assembly language
Presentation on Real Mode Memory Addressing
9/17/2018 Kiến Trúc Máy Tính.
Symbolic Instruction and Addressing
שפת סף וארכיטקטורה של מעבד 8086
Stack and Subroutines Module M17.1 Section 11.2.
8086 Registers Module M14.2 Sections 9.2, 10.1.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
More programming with "Processing"
Symbolic Instruction and Addressing
High-level language structures
Chapter 6 –Symbolic Instruction and Addressing
Assembly Language for Intel 8086 Jump Condition
Presentation transcript:

Mouse Question #1 Which INT number is used for the mouse?

Mouse Question#1 Which INT number is used for the mouse? 33h

Question #1A Unlike DOS INT 21h, or BIOS INT10h, with the mouse BIOS functions, the function number is selected through the _________ register.

Question #1A Unlike DOS INT 21h, or BIOS INT10h, with the mouse BIOS functions, the function number is selected through the ____AL_____ register.

Question #2 Write ASM statements that reset the mouse and get the mouse status.

Need to find out… Which INT 33h function handles resetting the mouse and getting the status? –Look at slides –Look in book – page

Resetting Mouse Returns If mouse is found, –AX = FFFFh –BX = number of mouse buttons If no mouse found, –AX = 0

Question #2 Solutions Write ASM statements that reset the mouse and get the mouse status. Mov ax, 0;int 33h, function 0 Int 33h ;status returned in ax Cmp ax, 0;if ax=0, mouse not available

Comments about resetting mouse If mouse is found: –It is centered on the screen –It’s display page is set to video page 0 –It’s pointer is hidden –It’s mickey’s are set to pixels ratio –It’s speed is set to default values –It’s range of movement is set to the entire screen area.

Question #3 Which INT 33h function shows and hides the mouse pointer?

Question #3 Solutions Which INT 33h function shows and hides the mouse pointer? Function 1 – show Function 2- hide

Question #4 Write ASM statements that hide the mouse pointer.

Question #4 Write ASM statements that hide the mouse pointer. Mov ax, 2 Int 33h

Comments about mouse pointer Mouse driver keeps a counter –Incremented (if nonzero) by calls to function 1 –Decremented by calls to function 2 When counter is 0, pointer is displayed Function 0 (reset mouse pointer) sets counter to –1.

Question #5 Which INT 33h function gets the mouse position and status?

Question #5 Which INT 33h function gets the mouse position and status? Function 3

Question #6 Write ASM statements that get the mouse position and store it in the variables mouseX and mouseY.

Before Answering, Need to Know….. What is returned BX = mouse button status If bit 0 is set, left button is down If bit 1 is set, right button is down If bit 2 is set, middle button is down CX = X-Coordinate DX = Y-Coordinate

Question #6 Solutions Write ASM statements that get the mouse position and store it in the variables mouseX and mouseY. mov ax, 3 int 33h mov mouseX, CX movmouseY, DX

Question #7 Which INT 33h function sets the mouse position?

Question #7 Which INT 33h function sets the mouse position? Function 4

Question #8 Write ASM statements that set the mouse pointer to X=100 and Y = 400.

Before Answering Need to know… What to send… CX = X-Coordinate DX = Y-Coordinate

Question #8 Write ASM statements that set the mouse pointer to X=100 and Y = 400. Mov ax, 4 mov cx, 100 mov dx, 400 int 33h

Question #9 Which INT 33h function gets the mouse button press information?

Question #9 Which INT 33h function gets the mouse button press information? Function 5

Question #10 Write ASM statements that jump to label Button1 when the left mouse button has been pressed.

Before Answering, Need to know … What to send… BX = Button ID (0=left, 1=right, 2=center) What is returned…. AX = button status BX = button press counter CX = X-coordinate of last button press DX = Y-coordinate of last button press

Question #10 Solutions Write ASM statements that jump to label Button1 when the left mouse button has been pressed. mov ax, 5 mov bx, 0 int33h tst ax, 0 jzButton1

Comments about Button Press In an event-driven programming environment, a drag event always begins with a button press. Once a call is made to this function for a particular button, the button’s state is reset, and a second call to the function returns nothing.

Question #11 Which INT 33h function gets button release information?

Question #11 Which INT 33h function gets button release information? Function 6

Question #12 Write ASM statements that get the mouse position at the point when the right button was released, and store the position in the variables mouseX and mouseY.

Question #12 Write ASM statements that get the mouse position at the point when the right button was released, and store the position in the variables mouseX and mouseY. mov ax, 6 mov bx, 1 int33h mov mouseX, CX mov mouseY, DX

Question #13 Write ASM statements that set the vertical limits of the mosue to 200 and 400.

Question #13 Write ASM statements that set the vertical limits of the mouse to 200 and 400. mov ax, 8 mov CX, 200 mov DX, 400 int 33h

Question #14 Write ASM statements that set the horizontal limits of the mouse to 300 and 600.

Question #14 Write ASM statements that set the horizontal limits of the mouse to 300 and 600. mov ax, 7 mov cx, 300 mov dx, 400 int33h