��������������������������������
��������������������������������������������������
��
Welcome
����������������������������������������������������������������������������������
����������������������
�zzf Copyright/2000
��������������������� �������������������� Moon Over
��������������������������������� Program laborotory
��������������������������������� Web Site Module
��������������������������������� Game ����������
����������� ������������������
������������������������������������������������������������������������������������
TAV - UQAM
Computer Organization and
Assembly Language
Department of Computer Science
Assignment #1
Instructor: F. SAID
Date Due: Next Week.
�
Question 1.
Add the following Hexadecimal values while considering that they are in 2?s complement 16-bit representation:
�
Question 2.
Show the respective 2s complement 8-bit representation of the following decimal numbers:
�
Question 3.
Write an X68000 Assembly program that will prompt the user to input A, B, C, and D, calculate and then print the value of:
X = (A+B)*(B-C) / (B-D)*(A+D/C).
Question 4.
Considering having a hypothetical machine, show the fetch and execute cycles of the following machine instructions, as shown in memory. Assume that the initial value of your PC is at memory location 400, and that it increments by 2.
Mem-Addr---> Mem-content
400 ---> 1902
402 ---> 5904
404 ---> 5906
406 ---> 6908
408 ---> 290A
40A ---> 1904
40C ---> 7904
40E ---> 2904
?.
?.
902 ---> 00A0
904 ---> 0100
906 ---> 0101
908 ---> 0002
90A ---> 0234
Recall that:
1h: load from memory location to AC
2h: store from AC to memory location
5h: add from memory location to AC
6h: subtract memory location from AC
7h: multiply memory location by AC
Considering that X, Y, Z, U, and V are stored at memory locations: 902, 904, 906, 908, and 90A respectively, derive the formula(s) that this machine code is calculating.
Question1 :
A:4ABC+4ABC=9578
B A123+A321=4444
C 1010+0101=0202
D 0101-0101=0000
E CEBC-FBDD=C2DF
Question2
23=17
68=BC
150: out of range
-128:out of range
1126:out of range
Question4
Considering having a hypothetical machine, show the fetch and execute cycles of the following machine instructions, as shown in memory. Assume that the initial value of your PC is at memory location 400, and that it increments by 2.
Mem-Addr---> Mem-content AC
400 ---> 1902 0000
402 1902 00A0
402 ---> 5904 00A0
404 ---> 5906 01A0
406 ---> 6908 02A1
408 ---> 290A 029F
40A ---> 1904 029F
40C ---> 7904 0100
40E ---> 2904 010000
V=X+Y+Z-u
Y=Y*Y