Skip to main content
GameDev.net gamedev.net
🔒 Locked

need help with IBM circa code

Started by soconne Sep 17, 2005 at 11:56 AM 4 replies 500+ views
Original Post
soconne
soconne
I need a little help understanding the following code for the IBM circa machine, from the 1950's.

+0 000 000 000 (loc 0)		constant 0
+0 000 000 000 (loc 1)		index, i
+0 000 000 000 (loc 2)		sum of array
+0 000 000 000 (loc 3)		average of array
+0 000 000 000 (loc 4)		number of elements in array
+0 000 000 000 (loc 5)		temporary location
+0 000 000 000 (loc 6-999)	the array
+9 999 999 999				end of initial data
+8 000 000 004 (loc 0)		read number of elements
+8 000 000 005 (loc 1)		read data into temp
+5 005 000 004 (loc 2)		if positive, skip
-1 000 005 005 (loc 3)			else negate
-6 005 006 001 (loc 4)		move temp into array sub i
+7 001 004 001 (loc 5)		incr. i, test with n, loop to loc. 1
+0 000 000 001 (loc 6)		reinitialize i to zero
+6 006 001 005 (loc 7)		add array sub i
+1 005 002 002 (loc 8)			to sum
+7 001 004 007 (loc 9)		incr. i, test with n, loop to loc. 7
-2 002 004 003 (loc 10)		sum / number of elements -> avg.
-8 003 000 000 (loc 11)		print average
+9 000 000 000 (loc 12)		stop
+9 999 999 999				end program
+0 000 000 010 			number of input values
   input  data


The first line is simply declaring a constant of value 0, but what does the next line do? index, i ? Does anybody know what this means ? I have tried searching google for documentation but I cannot find any.
Author Freeworld3Dhttp://www.freeworld3d.org
Rhalin
Rhalin
Looks like your dealing with IBM psuedocode assembler stuff. (No, I'm not -that- good, thank you google)

http://www.mta.ca/~amiller/ibm650/650pseud.html

I hope you have a good handle on Assembly, because after giving this a brief look, I think you'll need it to understand what all this does (even though this looks nothing like most of the assembly I've seen, having the background might help).

I dont know if your going to find a definitive guide to understanding this, but I hope the link helps. I found it and a few other pages by searching google for the string (with quotes) "end of initial data" as it seemed language specific.
Promit
Promit
It looks like the first 7 lines are variable declarations. The second one creates an indexing variable called i.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Rhalin
Rhalin
I've just been reading some of the docs I've found on this style of pseudocode (it piqued my interest)..

It appears that the phrases/sentances in the right most column (sum of array, constant 0, average of array) are comments. So everything before "+9 999 999 999 end of initial data" is variable initializations at specific locations.

Using that page I posted earlier and this one:

http://www.augustana.ca/~mohrj/courses/common/csc370/lecture_notes/interpreters.html

You might be able to translate all those machine codes into something you can understand, at the moment, I'm a little ill, otherwise I might do it just out of curiosity ;)

Speaking of which, what are you doing this for anyways, just wondering?
soconne
soconne
Hey thanks a lot guys. I'll take a look at those links.

I'm in a software projects class and my team is working with the IBM circa and we're trying to understand the machine code.
Author Freeworld3Dhttp://www.freeworld3d.org
JohnBolton
JohnBolton
BTW, there is no IBM computer named "circa".

"circa" in this context means that a date is approximate or that it indicates a period in time around that date. "circa 1950" means "sometime around 1950" or "typical of the year 1950".
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.