
114 Assembly Language Programming for the 68000 Family
Answers
1. Yes, but they are not exactly the same as the subroutines and proce
dures of high-level languages.
2. By a JSR instruction.
3. By a RTS instruction.
4. Anywhere, as long as they are not in the middle of code that is
designed for sequential execution.
5. A BSR is similar to the conditional branches in that it only allows a
label as an operand; a JSR can use a number of addressing modes,
including register indirect.
CLEAR: CLR.L DO
CLR.L
Dl
CLR.L
D2
CLR.L
D3
CLR.L D4
CLR.L
D5
CLR.L D6
CLR.L
D7
RTS
7. There are a limited number of them, and data may have to be copied
to and from the registers.
8. SUM: ADD.L D1,D0
RTS
9.
LEA A,AO
JSR SUM
SUM: MOVE.W (AO),DO
ADDQ.L #2,AO
ADD.L (AO),DO
RTS
A: DS.W 1
B: DS.W 1
10.
LEA ARGLST,A0
JSR SUM
SUM: MOVEM.L A0-A1,-(SP)
MOVEA.L (AO),A1
MOVE.W (A1),D0
SAVE REGS
-> 1ST. ARG.
Kommentare zu diesen Handbüchern