* * UPSTRING * Program to capitalize all letters in a string. * Address of string is in the long variable STRLOC at $9000. * STRLOC EQU $9000 ORG $8000 MOVE.L STRLOC,A1 ;get starting address of string NEXTC MOVE.B (A1),D0 ;get next char into D0 BEQ DONE ;end of string? (D0 == '\0') BSR UPCHR ;capitalize D0 MOVE.B D0,(A1)+ ;store back the capitalized D0 BRA NEXTC DONE TRAP #14 * subroutine UPCHR: convert D0 to uppercase (if alphabetic) * UPCHR CMP.B #'a',D0 BLT EXIT CMP.B #'z',D0 BGT EXIT AND.B #%11011111,D0 ;clear bit 6 of D0 (convert to upcase) EXIT RTS END