Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- jmp start
- string db 20, 22 dup('?')
- new_line db 0Dh,0Ah, '$' ; print new line
- start:
- lea dx, string
- mov ah, 0ah
- int 21h
- mov bx, dx
- mov ah, 0
- mov al, ds:[bx+1]
- add bx, ax ; point to end of string.
- mov byte ptr [bx+2], '$'
- lea dx, new_line
- mov ah, 09h
- int 21h
- lea bx, string
- mov ch, 0
- mov cl, [bx+1] ; get string size.
- jcxz null ; is string is empty?
- add bx, 2
- upper_case:
- ; check if it's a lower case letter:
- cmp byte ptr [bx], 'a'
- jb ok
- cmp byte ptr [bx], 'z'
- ja ok
- ; convert to uppercase:
- and byte ptr [bx], 11011111b
- ok:
- inc bx ; next char.
- loop upper_case
- lea dx, string+2
- mov ah, 09h
- int 21h
- mov ah, 0
- int 16h
- null:
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement