; ------------------- ; String Manipulation Example ; Assembly language which converts a string from upper ; case ascii to lower case ascii by setting bit 5. ;$BASE 10T ; convert the default base to decimal (was hex) ; by commenting out the $base directive here, the default base ; (hex) is assumed. ldx #string ; x points to the start of the message; loop: ldaa 0,x ; load what is at address "X+0" into "A" oraa #20 ; set bit 5 by "or"ing the byte with 0010 0000 staa 0,x ; save the character back where it was inx ; go to the next character cmpa #2E ; is the character a "."? bne loop ; go back to "loop" if the character is not a '.' tpa ; we only want to clear the stop anda #$7f ; bit, so we're careful not to tap ; disturb the others stop ; and then,stop ;;;=================================== string: DB 'HELLO WORLD.' org $fffe reset: DW 0000 ;----------------The End------------------