1a. It computes [X]2 - [Y]2 and puts the result in W, unless one of the squaring operations yields a result greater than or equal to 216 in which case it puts the value 0 in W.

1b.
1000016702MOV X, R2
1002000044
1004070267MUL X, R2
1006000040
1010005703TST R3
1012001012BNE OVERFLOW
1014016704MOV Y, R4
1016000032
1020070467MUL Y, R4
1022000026
1024005705TST R5
1026001004BNE OVERFLOW
1030160402SUB R4, R2
1032010267MOV R2, W
1034000016
1036000000HALT
1040012767MOV #0, W
1042000000
1044000006
1046000000HALT
1050000022.WORD 22
1052000033.WORD 33
1054000000.WORD 0


[on to problem #2]