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

  • Thread starter Thread starter sweetvirgogirl
  • Start date Start date
  • Tags Tags
    Program
Click For Summary

Discussion Overview

The discussion revolves around writing a SIC program that takes two blocks of integers, BLK1 and BLK2, and produces a third block, BLK3, by adding the integers from BLK1 in reverse order to those in BLK2. The scope includes programming logic and potential issues in implementation.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant presents a SIC program and expresses confusion about using 150 as the starting point for BLK1, questioning if 147 might be more appropriate.
  • Another participant asks for clarification on what a SIC program is, indicating a lack of familiarity with the term.
  • A third participant suggests that "SIC" likely refers to "simple instruction computing," noting that it is a simplified machine code used for educational purposes.
  • A later reply mentions the lack of standardization in teaching languages, implying that this could hinder assistance without further information about the instructions used in SIC.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the specifics of the SIC programming language or the correctness of the proposed code. There is uncertainty regarding the interpretation of the starting point for the integer blocks.

Contextual Notes

There are limitations in the discussion regarding the definitions and instructions of the SIC programming language, which are not provided in detail. Additionally, the participant's code may depend on assumptions about the initialization and declaration of the blocks.

sweetvirgogirl
Messages
116
Reaction score
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
Sorry, what's a SIC program? Is SIC a language or something? Can you give a web pointer to info about it?
 
copy-paste from programmingforums.org? not much more auxiliary info either...
 
"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