Skip to content
The Computer Science
TheCScience
  • Engineering Subjects
    • Human Values
    • Computer System Architecture
    • Digital Communication
    • Internet of Things
  • NCERT Solutions
    • Class 12
    • Class 11
  • HackerRank solutions
    • HackerRank Algorithms Problems Solutions
    • HackerRank C solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
The Computer Science
TheCScience

Input Output Programming in Computer Architecture

YASH PAL, March 1, 2026March 1, 2026

Input Output Programming in Computer Architecture – Input Output programs are needed for writing symbols to the computer’s memory and printing symbols from the memory. Input-output programs are employed for writing programs for the computer.

The symbols are strings of characters, and each character is assigned an 8-bit code so that it can be stored in computer memory. A binary-coded character enters the computer when an INP (input) instruction is executed. A binary-coded character is transferred to the output device when an OUT (output) instruction is executed. The output device detects the binary code and types the corresponding character.

Let’s take example programs for the Basic Computer to input and output one character without any interruption.

(a) Input a character program

CIF,SKI
BUN CIF
INP
OUT
STA CHR
HLT
/Check input flag
/Flag = 0, branch to check again
/Flag = 1, input character
/Print character
/Store character
CHR,—/Store character here

(b) Output one character

LDA CHR/Load character into AC
COF,SKO
BUN COF
OUT
HLT
/Check-output flag
/Flag = 0, branch to check again
/Flag = 1, output character
CHR,HEX 0057/Character is “W”

Character Manipulation – The binary-coded characters that represent symbols can be manipulated by computer instructions to achieve various data-processing tasks. One such task may be to pack two characters in one word. This is convenient because each character occupies 8 bits, and a memory word contains 16 bits. The program in the table below lists a subroutine named IN2 that inputs two characters and packs them into one 16-bit word. The packed word remains in the accumulator.

Let’s take a Subroutine program to input and pack two characters.

IN2—/Subroutine entry
FST,SKI
BUN FST
INP
OUT
BSA SH4
BSA SH4


/Input first character

/Shift left four times
/Shift left four more times
SCD,SKI
BUN SCD
INP
OUT
BUN IN2 I


/Input second character

/Return

Program Interrupt – The running time of input and output programs is made up primarily of the time spent by the computer in waiting for the external device to set its flag. The wait loop that checks the flags wastes a large amount of time. This waiting time can be eliminated if the interrupt facility is used to notify the computer when a flag is set. The advantage of using the interrupt is that the information transfer is initiated upon request from the external device.

In the meantime, the computer can be busy performing other useful tasks. Obviously, if no other program resides in memory, there is nothing for the computer to do, so it might as well check for the flag. The interrupt facility is useful in a multiprogram environment when two or more programs reside in memory at the same time.

Only one program can be executed at any given time, even though two or more programs may reside in memory. The program currently being executed is referred to as the running program. The other programs are usually waiting for input or output data. The function of the interrupt facility is to take care of the data transfer of one (or more) programs while another program is currently being executed. The running program must include an ION instruction to turn the interrupt on. If the interrupt facility is not used, the program must include an IOF instruction to turn it off.

Service Routine – Service routine must have instructions to perform the following tasks:

  • Save contents of processor registers.
  • Check which flag is set.
  • Service the device whose flag is set.
  • Restore contents of processor registers.
  • Turn the interrupt facility on.
  • Return to the running program.
Computer System Architecture engineering subjects Computer System Architecture

Post navigation

Previous post
Next post

Computer Architecture fundamentals
Basic structure of a computer
Functional Units of Computer
Development of Computers
Von Neuman and Harvard machine Architecture
Flynn Classification
Computer Structure Architecture
Interfacing Logic Devices
Levels of Design abstraction
Performance Metrics

Register Transfer Language
Memory Transfer
Arithmetic Micro-operations
Arithmetic Complements
Logic Micro-operations
Shift Micro-operations
Bus Architecture
Data Transfer
Central Processing Unit
CPU Bus Architecture

Computer Register and Types
Common Bus System
Instruction Format
Instruction Types
Instruction Cycle
Addressing Modes
Design of a basic computer

Basic function of a Computer
General register organization
Stack organization
Infix to Reverse Polish Notation Conversion
Instruction Types and their classifications
Data transfer and manipulation
Program control
RISC characteristics
CISC characteristics

Pipeline
Types of Pipeline
Arithmetic Pipeline
Instruction Pipeline
Hazards
Vector Processing

Data Representation
Addition and Subtraction
Adder Circuits
Shift and Add Multiplication Method
Booth's Algorithm
Restoring Division Algorithm
Non-Restoring Division Algorithm
Array Multiplier

Memory Classification
Memory Characteristics
Memory Organization
Memory Types
Associative Memory
Cache Memory
Virtual Memory

Input Output Interface
Modes of Data Transfer
Priority Interrupt
Direct Memory Access
Input-Output Processor
Serial Communication

TheCScience

We at TheCScience.com are working towards the goal to give free education to every person by publishing in dept article about Secondary, Senior-Secondary, and Graduation level subjects.

Pages

About US

Contact US

Privacy Policy

DMCA

Engineering Subjects

Internet of Things

Human Values

Digital Communication

Computer System Architecture

Programming Tutorials

Data Structure and Algorithm

C

Java

NCERT

Class 12th

©2026 TheCScience | WordPress Theme by SuperbThemes