Thursday, September 24, 2009 10:38 PM,



A student writes:



	Professor Patt,
	After your lecture I realized that I had a question regarding 
	the branch op code. I understand that the first four bits are 
	for the op code itself, the next three are determining if a 
	branch is necessary and the final nine are the address that 
	you're supposed to jump to plus the address in the program
	counter. 



What I would prefer you said was the final nine are bits that when sign- 
extended and then added to the address in the PC will provide the address to 
jump to (if the branch is taken).  since the 9 bits gives us values from -256 
to +255, you can branch forward 255 locations (actually 256, since the PC has 
already been incremented during the fetch phase) or branch backward 256 
(actually 255, for the same reason).




	I guess what I was thinking about though is what if you need to
	jump to a location that's further away than 9 bits? 
	Would you branch to a branch?



You could, but that would be ugly.  You are correct, if you needed to
branch further way than 9 bits, the branch instruction we talked about
in class would not work.  You would have to do it some other way, and
we will talk about that next week.  For your first few programs, 9 bits
are more than enough.



	Regards,

	<<name withheld to protect the student who wants to take a long branch>>



This was a very good question.  I did not have time to mention it on
Wednesday, since we were already running very late.  Thank you for
bringing it up.  I had planned on talking about it next Wednesday.

Yale Patt