Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 30th, 2006, 9:34 PM   #1
sweetvirgogirl
Newbie
 
Join Date: Jan 2006
Posts: 23
Rep Power: 0 sweetvirgogirl is on a distinguished road
Sic/xe

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?
sweetvirgogirl is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:06 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC