Assignment No. 05
Semester: Fall 2011
Semester: Fall 2011
CS401: Computer Architecture and Assembly Language Programming
Question No. 1: 10 Marks
In Example 12.4 Line# 6, an instruction is given to define a greeting message as below:
6. message: db 10, 13, 'hello $' ; greetings message
- What is the purpose of including the values 10 and 13 as these values are not printed on output screen?
10 is used for new line. It is used to start a new line. 10 is the new line character in ASCII code.
13 is the carriage return.
So they are not shown in output.
- What is the purpose of writing $ at the end of the string message?
$ is a terminator character. We use the service no 09 of the DOS. This service takes the $ sign as the terminator of the string.
Question No. 2: 10 Marks
This question is based upon Elementary multitasking of two threads Example 11.1 given in Lectures handouts. Given code in example 11.1 creates two simple threads each rotating bars by changing characters at the two corners of the screen and have infinite loops. Its output looks like as below:
Line # | Instruction to be added/modified | New/Modified Instruction |
11 | chars: db '\|/-' | chars: db '01234567' |
17 | and bx, 3 | and bx, 7 |
24 | and bx, 3 | and bx, 7 |