Introduction to Computer System                                                                                                              Print this page
<< Previous |  First |  Last |  Next >>       

Consider another example, say that the first number is stored in memory location 13 and the second data is stored in memory location 14. Write a program to Add the contents of memory location 13 and 14 and store the result in memory location 15.

HEX
LDAA 13
1000 0101
8  5
(0, 1)
LDBA 14
1010 0111
A  7
(2, 3)
ADD      
0000        
0    
(4)    
STC   15
1100 1111
  C   F
(5, 6)
HALT     
1101         
D   
(7)   

One question still remain unanswerd: How to store the program or data to main memory. Once we put the program and data in main memory, then only CPU can execute the program. For that we need some more instructions.

We need some instructions to perform the input tasks. These instructions are responsible to provide the input data from input devices and store them in main memory. For example instructions are needed to take input from keyboard.

We need some other instructions to perform the output tasks. These instructions are responsible to provide the result to output devices. For example, instructions are needed to send the result to printer.

<< Previous |  First |  Last |  Next >>