Advertisement
Il_Voza

1.1 Convert lowercase to uppercase characters

May 3rd, 2013
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Given three variables of type byte corresponding to three lowercase alphabetic characters (ASCII)
  2. ;–Var1 = ‘a’
  3. ;–Var2 = ‘s’
  4. ;–Var3 = ‘m’
  5. ;Write a program that prints on the screen the three characters converted to uppercase
  6.  
  7. DIM EQU 32  ;32 because if I have a lowercase character and I subtract 32, into ASCII code, I get corresponding uppercase character
  8. .MODEL small
  9. .STACK
  10. .DATA
  11. Var1 DB 'a'
  12. Var2 DB 's'
  13. Var3 DB 'm'
  14. .CODE
  15. .STARTUP
  16. MOV DL,Var1
  17. SUB DL,DIM  
  18. MOV AH,2
  19. INT 21H  ;In AH there is value 2, so here I say "PRINT the value in DL"
  20. MOV DL,Var2
  21. SUB DL,DIM
  22. INT 21H
  23. MOV DL,Var3
  24. SUB DL,DIM
  25. INT 21H  
  26. .EXIT
  27. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement