Machine Programming and Organization, Fall 1998 Exercises related to branch instructions ========================== All the following operands are 1 byte. Fill in the table, then give examples of instructions for which these operations would be performed. In the case of the subtraction operations, give examples of branch instructions that would or wouldn't be performed, referring to the condition codes. Note, you can use the simulator to study. Suppose you calculate -1_2c and 255_us as translations of FF. To check yourself, execute the following instructions, and see if FF is what is loaded into register A both times. LDAA #-1 LDAA #255 (remember, by default, numbers are decimal in this assembly language) Good practice: get a fresh copy of homework 3, and do it again. It is great practice for the topics related to branch instructions. Binary HEX Decimal, Decimal, N V C Z Op if unsigned if 2s comp ------ --- ---------- ---------- 11110001 F1 255-14=241 -15 1 0 1 0 + 11111111 + FF + 255 + (-1) ------------ -------- ------------- --------- Binary HEX Decimal, Decimal, N V C Z Op if unsigned if 2s comp ------ --- ---------- ---------- 10010000 90 +11000000 C0 --------- ----- Binary HEX Decimal, Decimal, N V C Z Op if unsigned if 2s comp ------ --- ---------- ---------- 01110111 - 11111100 ---------- Binary HEX Decimal, Decimal, N V C Z Op if unsigned if 2s comp ------ --- ---------- ---------- 00111100 -01111100 ----------- Binary HEX Decimal, Decimal, N V C Z Op if unsigned if 2s comp ------ --- ---------- ---------- 01111000 -10101010 ---------- Binary HEX Decimal, Decimal, N V C Z Op if unsigned if 2s comp ------ --- ---------- ---------- 00110011 -00000011 ------------