user1698102
user1698102

Reputation: 127

Getting "a" in place of a white space in Assembly language

I am writing a code, which capitalizes small letters. The program works like a charm but where it comes a white space in String, the program instead of a White space, inserts "a". I am trying to insert a white space using its ascii code which is 32. Here is the chunk of code messing up the program.

WhiteSpace2:
sb $t1,New($t0)
addi $t0,$t0,1
j Small

This program is written in assembly language.Somebody tell me why I am getting "a" instead of a Whitespace.

Regards

Upvotes: 0

Views: 1418

Answers (1)

Bartlomiej Lewandowski
Bartlomiej Lewandowski

Reputation: 11180

I do not really see what you are trying to accomplish in the code.

To make a program that capitalizes, you have to see if the char is between asci 'a' and 'z', if it is, subtract a constant value (32 if i remember). For any other char, just copy it.

Upvotes: 1

Related Questions