ORG $6000 ; Subroutine version of STRLEN LEA.L DATA,A1 ; get address of string BSR STRLEN ; call strlen subroutine TRAP #9 ; done, go back to monitor STRLEN MOVEM.L A1,-(A7) ; save original contents CLR.L D0 ; init count to 0 LOOP CMPI.B #0,(A1)+ ; is it the NULL char? BEQ DONE ; if yes, we are done ADDQ.W #1,D0 ; else add 1 to count BRA LOOP ; repeat for next char DONE MOVEM.L (A7)+,A1 ; restore oringal contents RTS ; ReTurn from Subroutine DATA DC.B 'alabama and tennessee' DC.B 0 ; here DATA is after code END