8 Feb 2013
School
Department
Course
Professor
1
RYERSON UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE
CPS310 – COMPUTER ORGANIZATION II
Winter 2013
Lab #2A
Input/Output and arithmetic manipulations
[2Marks]
WritethefollowingM68000programs:
1‐ Aprogramthatprintstoscreenthesumoftwopredefinednumbers.
2‐ Aprogramthatreadstwonumbersfromthekeyboardandprintstheirdifferencetothe
screen.
3‐ Aprogramthatreads4numbersfromkeyboardandprintstheirresulttothescreen
accordingto:
Number1–Number2+Number3–Number4
4‐ AprogramthatexecutesthefollowingCprogram:
Unsignedintvar1=0x00000000;
Unsignedintvar2=0x11223344;
Unsignedintvar3=0x55667788;
main()
{
if(a>b)
printf(“HelloCPS310”);
else
printf(“GoodByeCPS213”);
}
Demonstration:
Duringthelab:runtheprogramsandprovideanswerstoTAs’questionsaboutyouralgorithm
andcode.
2
3
RYERSON UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE
CPS310 – COMPUTER ORGANIZATION II
Winter 2013
Lab #2A
Arithmetic manipulations, Loops, and Subroutines
First Name: __________________________ Last Name: _______________________
Student #: __________________________
Section #: ___________________________ Lab Room #: ______________________
Signature: __________________________ Date: ____________________________