Machine Problem 2 Supplement

22C:18, Spring 1996

Due Tuesday Feb. 27, 1995, in discussion

Douglas W. Jones

Notice: Extra credit will be given for support of full 32 bit signed operands. Full credit will be given for those who limit the stack to 16 bits.

Notice: The MAS system conforms to the sidenotes in the textbook on the Macintosh programming environment; see particularly the note on page 235. This means:

As a consequence of this, the following two statements that would be equivalent under the "normative" view of how assemblers should function are not equivalent under MAS!
		LEA	X,A0
		MOVE.L	#X,A0
If X is a label in the data segment, the following code is equivalent to the above LEA statement:
		MOVE.L	#X,A0
		ADDA	A5,A0
If X is a label in the code segment, and if A4 is a pointer to the base of the code segment, the following code is equivalent to the above LEA statement:
		MOVE.L	#X,A0
		ADDA	A4,A0
To make A4 point to the start of the code segment, make your code segment begin as follows:
	START:	LEA	START,A4
Note that, in all of the above, if XP is defined as XP: DC.L X, then MOVE.L #X,A0 is equivalent to MOVE.L XP,A0.