Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Examen

COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1 AND 2

Puntuación
3.0
(3)
Vendido
8
Páginas
20
Grado
A+
Subido en
24-07-2021
Escrito en
2021/2022

COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1 AND 2

Institución
Grado

Vista previa del contenido

COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1

Question 1 [20]

(a) The following table reflects the memory contents of a part of memory in a one address
machine with an accumulator:

Address Contents

300 320

305 310

310 310

315 325

320 305

325 300



LOAD DIRECT 300

LOAD DIRECT 300: Direct addressing. The instruction contains the address where the value is

to found. Address 300 contains the value 320, thus the value 320 will be loaded into the
accumulator.

LOAD DIRECT 320

LOAD DIRECT 320: Direct addressing. The instruction contains the address where the value is

To found. Address 320 contains the value 305, thus the value 305 will be loaded into the
accumulator.

LOAD INDIRECT 325

LOAD INDIRECT 325: Indirect addressing. The instruction contains the address where the

address of the value to be used, is to be found. Address 325 contains the address of the value to

be used, ie address 300. Address 300 contains 320, thus the value 320 will be loaded into the

accumulator.

(b) Give examples of x86 instructions in which the following addressing modes are used:

, Immediate addressing

mov al,3

Direct addressing

mov al,[temp]

Stack addressing Indexed addressing Base-addressing

push ax (pop ax)

Register indirect addressing

mov al,[bp] (mov al,[si], mov [di],al)



Question 2 [50]

Assembly language programming:

Write a program in assembly language to read a number entered by the user. The program
should display an enlarged version of a given number on the screen. The program should
do the following:

Clear the screen and change the screen colour to yellow on blue.

Change the cursor position to row 10, column 0.

Prompt the user to key in an upper case letter (A - E). Read the letter from the keyboard.

Test whether the number is in range (A,…, E). Display an error message if the letter is out
of range and terminate the program.

Display an enlarged version of the letter on the screen.

Example: If the user enters B, the following pattern is displayed:

Enlarged letter Bit pattern Hex number Line number

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
24 de julio de 2021
Número de páginas
20
Escrito en
2021/2022
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$19.34
Accede al documento completo:
Comprado por 8 estudiantes

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Reseñas de compradores verificados

Se muestran los 3 comentarios
4 año hace

4 año hace

The enlarged letter does not display properly.

4 año hace

The Question 2 does get the result but only outputs the Enlarged letter and doesn't do the Bit Pattern, Hex number and Line number as requested by the question

3.0

3 reseñas

5
0
4
2
3
0
2
0
1
1
Reseñas confiables sobre Stuvia

Todas las reseñas las realizan usuarios reales de Stuvia después de compras verificadas.

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
hiltontutorials University of South Africa (Unisa)
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
1905
Miembro desde
7 año
Número de seguidores
1219
Documentos
858
Última venta
9 meses hace

3.7

359 reseñas

5
145
4
83
3
56
2
28
1
47

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes