Tuesday, September 29, 2009 3:05 AM,



A student writes:



	Dear Dr. Patt,
	This is **********, one of your students in 306.
	I was working on my program, and I have a question 
	that deals with constants.  Hint 1 states that bit 
	masks are to be used after the HALT instruction of 
	the program.  Can we use constants within the program? 
	Or do they have to be after the HALT instruction?
	Thanks for your time,
	<<name withheld to protect the student who prefers to have
	his constants in the program, rather than in memory>> 



I assume you are asking whether you can add 1 to R0 by executing

0001 000 000 1 00001

rather than

0010 101 000000000    ; load the value 1 into R5
0001 000 000 0 00 101 ; add the contents of R5 to R0, putting result in R0
1111 0000 0010 0101   ; halt the machine
0000000000000001      ; the value 1, which is stored in the next memory 
location

Sure, makes a lot sense to have the value 1 in the instruction, rather than 
have to get it from memory.

HOWEVER, what do you know about the magnitude of that constant that could 
prevent you from doing that?

Good luck finishing the program on time.

Yale Patt