Lab 14
Lab 14
Laboratory Manual
for
Computer Organization and Assembly Language Programming
Page 1
OBJECTIVES:
Understand Infinite Loop-Based Animation. Learn to implement an animated effect where a symbol
(star) moves continuously within a specific column of the console, simulating a falling motion
Implement Keyboard-Controlled Thread Creation: Develop the ability to dynamically start new threads
for falling stars using keyboard input, with each thread targeting a different column.
Master Multithreaded Column Management: Understand how to schedule and manage multiple
threads, each working independently to display animations in different columns, using timer-based
multitasking.
Task 1: Write a function fallingStar that takes column number as parameter and prints a
star moving in that column.
For example, if colNo is 80, your function will print a star in column 80, falling from row 0 to
row 24 (with some delay). After reaching row 24, it will again appear on 1st row and start falling
again, in an infinite loop.
Task 2: Write a program that starts a new thread of falling star if the user presses key ‘8’.
Page 2