Hey, I'm new here and I need a bit of help with the LC-3 Assembly language. Basically I need to write a program which takes a string and only displays the uppercase characters in it. So for example, I give it the string "This is a Sample String", it prints out "TSS". I've been trying to get it working for 2 days now and I can't seem to figure it out. I came up with this:
.ORIG x3000
;Lowercase: 97-122
;Uppercase: 65-90
LD R3, UPPER ; load uppercase bitmask
LEA R1, STRING ; pointer into string
LD R2, HIGH
LOAD LDR R0, R1, #0 ; get char
BRz END ; x00 means end of string
AND R2, R0, R3 ; test for uppercase w/ mask
BRz NEXT ; not uppercase, get next
OUT ; output character
NEXT ADD R1, R1, #1 ; pointer++
BRnzp LOAD ; go get next char
END HALT
UPPER .FILL b0000000000100000 ; bit 6 determines upper/lower case
STRING .STRINGZ "This is a Sample String"
.END
But it instead prints out lowercase characters.... The only hint my professor gave was that the upper/lower bit mask (b0000000000100000) would help us. I really want to get this working, I just can't seem to figure out what I did wrong. Thanks for any help! :)