Thur, 19th Nov 2015, 01:08 Re: Program #4



A student writes:


> Dr. Patt
> I am working on Lab 4 and have opted to do the connect 4 game. I am almost
> done (I hope) but I am having a problem with the size of my program. It is
> over 600 lines long and when I try to assemble it I get about 50 instances
> of branches, loads, and stores whose PC offsets cannot reach the locations
> I need them to. Is there a good way to work this out? I can think of
> several solutions, but they all would take hours, and I'm hoping your
> opinion would help shorten that time. I realize 600 lines is a bit
> excessive but shortening it by 2/3rds its current size seems impossible
> right now. Please Help!
> Thanks,
> <<A student who makes messy programs then suffers the consequences>>


Another student denies me the privilege of creating an alias for him!  Oh, well.

In any case, I don't know if there is a "good" way to do this.  My simple way,
which would not take hours would be:
	
	LD R1, A
	JMP R1
A	.FILL FAR
	...
	...
FAR <<some instruction>>

Or, if I wanted to do a subroutine:

	LD R1, A
	BR B
A	.FILL FAR
B	JSRR R1
	...
	...
FAR <<some instruction>>

Hope this is useful.


YNP