SIC Program: Add BLK1 and BLK2 to BLK3 of 50 Integers

  • Thread starter sweetvirgogirl
  • Start date
  • Tags
    Program
In summary, the conversation discusses a SIC program that takes two blocks of integers as input and outputs a third block of integers. The program works by adding the integers in the first block in reverse order to the integers in the second block and storing the resulting integers in the third block. The program assumes that the blocks have been declared and initialized elsewhere and uses labels to refer to the base addresses of the blocks. It also mentions the use of a simplified machine code called SIC, but without further information, it is difficult to provide more details about the program.
  • #1
sweetvirgogirl
116
0
--------------------------------------------------------------------------------

Write a SIC program whose inputs are
two blocks of integers, BLK1 and BLK2 and whose output is a third
block of integer, BLK3. Each of these blocks contains 50
integers. Your program will take the integers in BLK1 in reverse
order and add them to the integers in BLK2 and store the
resulting integers in BLK3. A simple way to do this is to add the
last integer in BLK1 to the first integer in BLK2 and store the
result in the first position in BLK3. Then add the second last
integer in BLK1 to the second integer in BLK2 and store the
result in BLK3; etc. Don't forget that 50 integers = 50 words =
150 bytes. Your program should assume that the blocks have been
declared and initialized elsewhere. Also assume that BLK1, BLK2
and BLK3 are labels of the base addresses of the 3 blocks.


This is what I wrote:

LDA One Hundred Fifty
STA INDEX1
LDL ZERO
STL INDEX2
ADDLP LDX INDEX2
LDL INDEX2
LDA BLK1, X
ADD BLK2, L
STA BLK3, X
LDA INDEX1
SUB THREE
STA INDEX1
LDA INDEX2
ADD THREE
STA INDEX2
COMP K150
JLT ADDLP


I think I'm really confused about using 150 as the starting point for BLK1, coz maybe I should use 147 .. but then it messes up everything? Am I missing something? Does my code look right?
 
Last edited:
Physics news on Phys.org
  • #2
Sorry, what's a SIC program? Is SIC a language or something? Can you give a web pointer to info about it?
 
  • #3
copy-paste from programmingforums.org? not much more auxiliary info either...
 
  • #4
"SIC" probably refers to "simple instruction computing" or something -- some kind of a simplified machine code used for teaching purposes.

Unfortunately, such teaching languages are not at all standardized, and it would be very difficult for any of us to help you without some information about what the instructions mean.

- Warren
 

FAQ: SIC Program: Add BLK1 and BLK2 to BLK3 of 50 Integers

What is the SIC Program?

The SIC Program is a computer program used for processing data and performing mathematical operations.

What does "Add BLK1 and BLK2 to BLK3" mean?

This phrase refers to the process of adding the values in the first two blocks of integers (BLK1 and BLK2) and storing the result in the third block (BLK3).

How many integers are being processed in this program?

This program is processing 50 integers, as stated in the title.

What is the purpose of this program?

The purpose of this program is to perform addition on a set of 50 integers and store the result in a designated block.

Can this program be used for other mathematical operations or with a different number of integers?

Yes, this program can be modified to perform other mathematical operations and can be used with a different number of integers as long as the code is adjusted accordingly.

Back
Top