0% found this document useful (0 votes)
0 views2 pages

Lab 14

The document is a laboratory manual for a course on Computer Organization and Assembly Language Programming at the National University of Computer and Emerging Sciences. It outlines objectives related to creating infinite loop-based animations, implementing keyboard-controlled thread creation, and mastering multithreaded column management. Two tasks are specified: writing a function for a falling star animation in a specified column and developing a program to start new threads for falling stars based on user input.

Uploaded by

sana ejaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views2 pages

Lab 14

The document is a laboratory manual for a course on Computer Organization and Assembly Language Programming at the National University of Computer and Emerging Sciences. It outlines objectives related to creating infinite loop-based animations, implementing keyboard-controlled thread creation, and mastering multithreaded column management. Two tasks are specified: writing a function for a falling star animation in a specified column and developing a program to start new threads for falling stars based on user input.

Uploaded by

sana ejaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

National University of Computer and Emerging Sciences

Laboratory Manual

for
Computer Organization and Assembly Language Programming

Lab Instructor Sana Ejaz


Semester Fall 2024

Department of Computer Science

FAST-NU, Lahore, Pakistan

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’.

Each thread will start with a difference of 5 columns i.e.

1st thread: star falling on column 80 (row 0 to 24 in infinite loop)


2nd thread: star falling on column 75 (row 0 to 24 in infinite loop)
3rd thread: start falling on column 70 and so on.

Page 2

You might also like