Assembly Language Makeup Miterm Lecturer: Sai-Keung Wong National Chiao Tung University Rename the...

Post on 18-Jan-2018

216 views 0 download

description

empty

Transcript of Assembly Language Makeup Miterm Lecturer: Sai-Keung Wong National Chiao Tung University Rename the...

Assembly LanguageMakeup MitermLecturer: Sai-Keung Wong

National Chiao Tung University• Rename the template folder name to: YourStudentID_YourName.

If your student ID is 123456789 and your name is XYZ, the folder name should be 123456789_XYZ

• Write down your name, ID and email in each main.asm file.• There is only one question.• Each program must be saved in one folder. The name of the folder is qX, where X

is the question number.• You cannot use any electronic devices.• You should not connect to internet.• You should not read the questions before you are told to do so.

Makeup Midterm

• Store your file folder in D:/exam/

• empty

• empty

Question One (70pts): 50 minutesA PainterWrite a program to control a character to move in an area bounded by a green frame. The color of the

character is changed for every step.For each step, save the step information. There are three tasks.Key usages:

‘e’: up ‘d’: down ‘s’: left ‘f’: right

Task A: Press ‘n’. Clear the screen. Show the student name, ID and email address in white. MUST DO or zero point.

Task B (4+4+4+4+4%):Draw a frame. The frame is formed by characters. Draw the characters

one after another with a delay 10 msec for every character. Draw the frame from the upper left corner.

Task C1.[5%] Show the main character in the middle of the

area.2. [2+2+2+2%] Control the character to move. Save

the path of the character (position+color).3. [5%] Change the color of the character every time

even though it is not moved. The color should not be black nor red.

4. [2+5%] Press the spacebar to clear the screen to black at once. And redraw the frame.

5. [15%] Press ‘l’: load the saved path at once.6. [10%] Press ‘b’: load the saved path at once but

show red at the even positions.

Press ‘b’Press ‘l’

Midterm

• Make sure you have done all the questions.• Enjoy midterm.• End.