Java Reference
In-Depth Information
Table 5.7 Test program 3
Loc.
Content
Type
Description
0
code
Output the request for the first number
OUTPUT 11
1
code
Read the first number from keyboard
INPUT 14
2
code
Output the request for the second number
OUTPUT 12
3
code
Read the second number from keyboard
INPUT 15
4
code
Load into register A the first number read
LOADA 14
5
code
Load into register B the second number read
LOADB 15
6
code
Add the two numbers
ADD
7
code
Store the result in a memory location
STOREA 16
8
code
Output the announcement of a result
OUTPUT 13
9
code
Output the result
OUTPUT 16
10
code
Terminate execution
HALT
11
data
First message
Insert 1st number:
12
data
Second message
Insert 2nd number:
13
data
Result announcement message
Sum is
14
data
Will contain the first number
0
15
data
Will contain the second number
0
16
data
Will contain the result
0
of loading the operating system from the file system. This program reads the
name of a program file from a configuration file on the hard disk, then loads
that program file and executes it. The test is made up of three parts:
the bootstrap program described in Table 5.8;
the configuration file; and
the program file, described in Table 5.9.
The bootstrap program above makes two assumptions:
the configuration file is called “boot.ini”;
the first line of the executable file contains the number of instructions to
be read.
The executable file's instructions are loaded into RAM starting from location
100.
The rest of this test is equal to the previous test with the big difference
that it will be loaded from a file through the storage device. The “boot.ini”
file contains a single line with the name of the executable file:
test_sum.prg
The executable file (“test_sum.prg”) will contain the lines shown in Table
5.9.
5.7
Extension
The simulator can be extended in a number of different ways. For example,
new I
O devices can be simulated and integrated within the proposed
 
Search WWH ::




Custom Search