-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08.LowercaseToUppercase.asm
More file actions
54 lines (41 loc) · 2.46 KB
/
08.LowercaseToUppercase.asm
File metadata and controls
54 lines (41 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
TITLE Case-Converter
;Program Desctiption: This program takes a Lowecase letter and converts it to Uppercase
;Author: Liul Alemayehu
.MODEL SMALL ; com program, Memory Descriptor (Tiny | Small | Medium | Large)
.STACK 100 ; stack
.DATA ; Beginning of data segment where data is stored
msg1 db 'Enter the letter: ','$' ; Declare variable msg1 and assigned it a value ($ used to indicate end of string)
msg2 db 'Uppercase Value: ','$' ; Declare variable msg2
newline db 13,10,'$' ; Creates newline
.CODE ; Beginning of code segment
main PROC
; Start
MOV Ax,@DATA ; Moving address of data (data segment) to Ax register
MOV Ds,Ax ; Initializing of Data segment register (Ds) from Accumilator register (Ax)
; Prompt1
LEA Dx,msg1 ; Loading the effective address of our msg1 to the Data register (Dx)
MOV Ah,09 ; Print from data
INT 21h ; Does it!
; Read letter
MOV AH,01h ; Reads an input letter to the Accumilator register (high)
INT 21h ; Does it! (reads charachter into Al)
MOV Bl,AL ; Save character in Bl while we display a Return and Linefeed
AND Bl,11011111b ; Converts to Uppercase
; Newline
LEA Dx,newline
MOV Ah,09
INT 21h
; Prompt2
LEA Dx,msg2 ; Loading the effective address of our msg1 to the Data register (Dx)
MOV Ah,09 ; Print from data
INT 21h ; Does it!
; Print Result
MOV AH,02h ; Prints Character
MOV Dl,Bl ; Access input value from [MOV AH,01] through B1 and move to Dl
INT 21h ; Does it
Exit:
MOV Ah,4Ch ; Exit
INT 21h ; Does it!
main ENDP
END main
;