Search This Blog


What is handshaking? Write a suitable example for handshaking with necessary assembly codes.

Handshaking: Handshaking is a I/O control method to synchronize I/O devices with the microprocessor. As many I/O devices accepts or release information at a much slower rate than the microprocessor, this method is used to control the microprocessor to work with a I/O device at the I/O devices data transfer rate.

            Example: Supposing that we have a printer connected to a system. The printer can print 100 characters/second, but the microprocessor can send much more information to the printer at the same time. That’s why, just when the printer gets it enough data to print it places a logic 1 signal at its Busy pin, indicating that it is busy in printing. The microprocessor now tests the busy bit to decide if the printer is busy or not. When the printer will become free it will change the busy bit and the microprocessor will again send enough amounts of data to be printed. This process of interrogating the printer is called handshaking.

Following is an assembly code that tests the BUSY Flag and sends data to the printer if it is not busy or the busy flag is a logic 0.

                   PRINT        PROC                   NEAR
                                      IN      AL, BUSY             ; get busy flag
                                      TEST AL, BUSY_BIT     ; test busy bit
                                      JNE   PRINT                  ; if printer busy
                                      MOV           AL, BL                  ; get data from BL
                                      OUT  PRINTER, AL       ; send data to printer

                   PRINT        ENDP 


  1. valuable. I appreciate your service for the thousands of students

    1. Thanks for this inspiring comment, I have a lot more notes to publish but due to time complexity, I am failing, but I will.

  2. Thank U very much for this explanation of handshaking
    actually my example is Blood Pressure communicate through Temperature device

    many thanks ^^

  3. do you mind if u PLZ check my hand shaking pseudo-code??
    uploaded here :

    1. Sorry I missed your comment and came back after a long time.

      And also sorry as this is not what I practice now a days, these were my class notes which I made 3-4 years ago while studying CSE. I can't step ahead with checking your pseudo-code.

  4. im goin to get a straight A with such a wonderful explanation .thank


Leave your valuable thoughts before leaving..

More Recent Posts

They are following, won't you ! Follow now.

Al Topics

-- (FCFS) (RR) (SJF) #define directive #include #include directive ++ 8086 Micorprocessor 8086 microprocessor About HTML Absolute URL Ackerman Function advantages of user defined functions AIFF All LIST Tags AMV Android Application of OOP Arithmetic arithmetic and logic unit Arrays Assignment Audio File Types Audio Formats AX B Backslash character Basic Features Basic Features of OOP basic structure of C BIG Bill Gates Bill Gates Speech at Harvard University Bitwise BMP BODY BP BPS BR Breadth First Search BX Categories of operators characteristics POP character set in C character test functions Character types C History C Language Class Notes: Chemistry Class Notes: C Programming Class Notes: Data Strcuture Class Notes: Digital Image Processing Class Notes: Economics Class Notes: HTML Class Notes: Microprocessor and Computer Architecture Class Notes: OOP Class Notes: Physics I Class Notes: Software Engineering Class Notes: Theory of Computation compile time Compile time initialization compiling and running a C program flowchart Conditional conditions for variables Cons of POP counter controlled loop Counter controlled loop VS Sentinel controlled loop Creating Creating a web site CX Data types decision making declaration of one dimensional array declare a function in C declare a function in C Plus Plus decrement decrement operator Define Operating System Definition deleting Depth First Search DI different operators different type of constant different types of arrays discuss function call Documentation document different folder document of the web document same folder Domain name Domain name selection guidelines DPS draw multifunction program DX Dynamic arrays elements of user defined functions Else If Ladder Entry controlled loop Entry controlled loops VS Exit controlled loops evolutionary software process model Executable part Executing a C program Exit controlled loop Explain Explain and Solve explain function call explain function definition FCFS First Come First Served Floating point type flow chart of the process FONT FOR loop VS WHILE loop VS DO....WHILE Friend Function function function call function definition function nesting function parameters fundamental steps of digital image processing fundamental steps of DIP general registers GIF GIF File viewer Harvard University HEAD Heat & Thermodynamics HR HTML HTML Tags Hypertext I identifier IF Else statement IF statement Image Formats image processing with a neat block diagram IMG Increment increment operator information initialization of one dimensional array initialization of two dimensional array input output operations inserting Integer constants Integer types Interference & Diffraction internal architecture 8086 Internet IP address Isolated I/O J. K. Rowling J. K. Rowling at Harvard University J. K. Rowling Speech at Harvard University JPEG JPG keyword Like Password. Link Linked List Linking Links llop in C Local web page Logical Loop in Programming main () function managing I/O Matrix Problem Mecached Memcahce Memory Mapped I/O merging microprocessor MIDI MOV Movies and Videos MP3 MPEG Multidimensional array multi-function program My Choice: Software My Diary My Games | HTML CSS JQuery My Movies: Horror My Poems MySQL Database .NET MySQL Database VB MySQL Database VB.NET mysql with My Tutorials | Blogspot My Tutorials | C++ My Tutorials | Java Script My Tutorials | Programming My Tutorials | Software My Tutorials | Visual Basic My Tutorials | Web My Works | Programs necessity of website Nested If Else Statement nesting of functions Object Oriented Programming One dimensional array OOP Operating System Concepts Operator Organizing OS OS Scheduling P pass by reference Pass by value Pass object to function Password Technique Pattern Pattern Password Technique Performance personal website Photo Viewer Picture Formats Picture Game Picture Puzzle Picture Puzzle Game Planning PNG POP POP programming PRE preprocessor Priority Scheduling Problems of POP Procedural programming Procedure Oriented Programming program Programming Languages Pros and cons of POP Publicizing Publishing Queue RAW Real constants recursion recursive Relational Relative URLs Remote web page Re-test or updating Round Robin RR rules for identifier rules to create a domain name run time Run time initialization S scanf format codes Scheduling search engine procedure Search Engines Search Engines vs Web Directories searching sentinel controlled loop server sever Shortest Job Shortest Job First Short Questions SI Simulation Simulation Viewer Simulation Viewer Software Single character constants SJF Slow Slow Speed Slow Website SMALL small business website software process model Solutions to problems of POP Solve sorting SP Special Speed Up Stack Stanford University statements used in C Static arrays Steps of looping process Steve Jobs Steve Jobs at Stanford University Steve Jobs Speech at Stanford University String STRONG structure of C programming SUB Subprogram section SUP syntax rules or grammar and syntax errors. tags Testing TITLE traversing Trees TT Two dimensional array types of arrays U URL user defined functions Using MySQL Using MySQL Database with Visual Basic variables Video File Types Video Formats Visual Basic .NET Visual Basic .NET 2010 Void types WAV Waves and Oscillation web browser Web Directories Web page web site What is constant What is friend function What is HTML What is link What is operating system what is recursion What is user defined functions Why search engine created why website Why we need search engines. Windows Photo Viewer WMA WMV World Wide Web WWW