Assignment 4 COAL
Assignment 4 COAL
04
(Computer Organization & Assembly Language)
Total Points: 40
Submission Date: 11 Jan, 2025
Assignment Type: Hard Copy (Code with output performed at VS code)
d.) Write a program to draw the box of 20x40 dimension. (Note: Your only task is to set the
dimension. Forget about the other parameters. )
Question # 1: (12 Marks)
Write an assembly language program to concatenate the two strings. You need to write two
procedures, first one is STRIN and the other one is STRCONC. Main program should print the
output as given in the box.
STRIN: Procedure must have initial address of string as the input. Then Ask the user to input
the string of characters terminated by “Enter” key. Save the string at the specified address in
memory.
STRCONC: Procedure must have initial addresses of three strings in AX, BX, and DX. Where
AX and BX represent the addresses of two source strings and DX represent the address of
concatenated string.
Question # 2: (8 marks)
For the given code and its relevant data, find the asked values in the table.
.MODEL SMALL @NEXT:
.STACK 100H LOOP @LOOP
@LOOP:
ROL BX, 1
JNC @NEXT
INC AX
Question # 3: (8
marks)
For given program, write the output and fill the asked values of registers in the given boxes.
.MODEL SMALL
.STACK 100H
.DATA
VAR1 DW 45H, 56H, 67H,
Write values after the execution.
78H, 89H, 90H
.CODE
AX BX CX DX SP
MOV AX,@DATA
MOV DS,AX 0000 0000 0000
MOV DX,7890H
AX BX CX DX SP
CALL UNKNOWN Will not be executed as CALL returns to 1234 address.
Address is not the same as was expected. POP one more
MOV AH,4CH element from the stack.