Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- .data
- string db 'We are DUET', 10,13,'$'
- .code
- main proc
- mov ax,@data
- mov ds,ax;
- ;mov ah,09
- ;mov dx,offset string
- ;int 21h
- mov si,offset string
- again:
- cmp [si],'$'
- je last
- cmp [si],90
- jle upper_to_lower
- cmp [si],97
- jge lower_to_upper
- upper_to_lower:
- cmp [si],64
- jle ignore
- add [si],32
- mov ah,02
- mov dl,[si]
- int 21h
- inc si
- jmp again
- ignore:
- inc si
- jmp again
- lower_to_upper:
- sub [si],32
- mov ah,02
- mov dl,[si]
- int 21h
- inc si
- jmp again
- last:
- ret
- main endp
- end main
- ret
- program 2
- ; You may customize this and other start-up templates;
- ; The location of this template is c:\emu8086\inc\0_com_template.txt
- org 100h
- string db 'We are DUET Students',10, 13,'$'
- .code
- main proc
- mov ax,@data
- mov ds,ax
- ;mov ah,09
- ;mov dx,offset string
- ;int 21h
- mov di,offset string
- check_first_lower_case:
- cmp [di],'$'
- je last
- cmp [di],97
- jge first_lower_latter
- inc di
- jmp check_first_lower_case
- first_lower_latter:
- mov ah,02
- mov dl,[di]
- int 21h
- inc di
- jmp again
- again:
- cmp [di],'$'
- je last
- cmp [di],97
- jge last_lower_letter
- inc di
- jmp again
- last_lower_letter:
- cmp [di],64
- jle ignore
- mov bl,[di]
- inc di
- jmp again
- ignore:
- inc di
- jmp again
- last:
- mov ah,02
- mov dl,10
- int 21h
- mov dl,13
- int 21h
- mov dl,bl
- int 21h
- ret
- main endp
- end main
- ret
Add Comment
Please, Sign In to add comment