"Organization and Architecture of
Computer Systems" (1304) -
Laboratory.
Academic Year: 2020-2021
Semester: Spring
Section: T9
Date: 2/6/2021
Issue 1 (Assembly 8086)
Write a program that consists of a main sub-program (MAIN) and two subroutines FUNC1 and
FUNC2. MAIN, after a relevant message to the user, will enter from the keyboard (DOS service:
08) three (3) characters that are only decimal places (0-5). No other character is allowed. If the
user enters an incorrect character then an error sound (7) is generated and the character is
not printed. The characters are stored in a table (Buffer) with a maximum length of three (3)
Bytes. The entry is terminated when all the characters N1, N2, N3 are given. A typical entry is
shown below:
Dose eisodo: 235 (where N1 = 2, N2 = 3 and N3 = 5).
After the input, the sub-program FUNC1 is called by MAIN which calculates the expression (N1
+ N2) * N3 and returns the result to the register AX. MAIN then calls FUNC2 which prints the
result on the screen, after a relevant message to the user. This is followed by the termination
of MAIN in the operating system.
Dose eisodo: 535
Apotelesma: 40