Programming SAP-1 Computer*
Objective: At the end of the conversation, you should be in a position to program SAP-1 as essential.
Exercise: Program SAP-1 to perform the arithmetic issue: 8 & 4 Гўв‚¬" 3 & 5 Гўв‚¬" 2 . Your data are in decimal contact form. Store the info in memory locations BH to FH. Write the assemblage language system, the machine vocabulary program, and the hexadecimal shorthand.
SAP-1 INSTRUCTION SET
Training set contains the operations some type of computer can perform.
LDALoad MEMORY data into accumulator
ADDAdd RAM data into accumulator
SUBSubtract RAM MEMORY data coming from accumulator
OUTLoad accumulator info into output register
Case in point 1 . SAP-1 program in mnemonic form:
1 ) The 1st instruction LOADS the Accumulator (A) with all the contents of memory position 9H. Therefore , A sama dengan 01H. 2 . The second training ADDS the contents of memory area AH, (which is 02H), to the Accumulator contents. Consequently , A = 03H. several. The third instructions ADDS the contents of memory area BH towards the Accumulator material. Therefore , A = 06H. 4. Your fourth instruction SUBTRACTS the items of memory space location CH from the Accumulator contents. Therefore , A = 02H. your five. The OUT instruction lots the Accumulator contents in the output slot. Therefore , the binary screen shows 0000 0010. 6th. -------------------------------------------------
The HLT instruction stops the information processing.
SAP-1 OP CODE
A surgical procedure code tells the computer which will operation to execute.
Model 2 . Translate the program of Example you into SAP-1 machine language.
Object system Гўв‚¬" a program written in machine dialect. Source system Гўв‚¬" the original program with mnemonics. Instructions field Гўв‚¬" MSBs (Most Significant Bits) which specify the operation. (with related op code) Address field Гўв‚¬" LSBs (Least Significant Bits) which will specify the address. (with corresponding operand)
Example a few. Program SAP-1 to solve this kind of arithmetic issue: 16 + 20 + 24 Гўв‚¬" 32. The numbers are in decimal form. Work with memory spots 9H to CH pertaining to the data.
Answer: (Assembly Vocabulary Version)
Model 2 . Convert the program of Example 1 into SAP-1 machine language.
00000000 one thousand one
Object system Гўв‚¬" an application written in machine vocabulary. Source plan Гўв‚¬" the first program with mnemonics. Instruction field Гўв‚¬" MSBs (Most Significant Bits) which stipulate the operation. (op code) Address field Гўв‚¬" LSBs (Least Significant Bits) which usually specify the address. (with corresponding operand)
Example 3. Program SAP-1 to solve this kind of arithmetic issue: 16 & 20 + 24 Гўв‚¬" 32. The numbers happen to be in quebrado form. Make use of memory locations 9H to CH for the data.
Response: (Assembly Language Version)
Equipment Language Version| Hexadecimal Short
Address| Contents| Address| Items
0000| 0000 1001| 0H| 09H
0001| 0001 1010| 1H| 1AH
0010| 0001 1011| 2H| 1BH
0011| 0010 1100| 3H| 2CH
0100| 1110 XXXX| 4H| EXH
0101| 1111 XXXX| 5H| FXH
0110| XXXX XXXX| 6H| XXH
0111| XXXX XXXX| 7H| XXH