I am trying to convert letters from user input into numbers in a MIPS assembly program. For example, A -> 1, B -> 2, C -> 3, and so on. What would be the best way to do this?
Asked
Active
Viewed 73 times
0
-
1Subtract `'A'-1`? – Jester Nov 30 '22 at 18:46
-
Use a math. Finding and programming a mathematical formula is language independent. – Erik Eidt Nov 30 '22 at 19:04
-
In ASCII, the uppercase alphabet is contiguous. https://www.asciitable.com/ – Peter Cordes Nov 30 '22 at 21:53