rendered paste body.model small
.stack 100h
.data
msgIntro DB "4-a uzd: Programa pakeicia ivestos eilutes raidziu skyriu ir eilutes ilgi.$"
msgIvesk DB 0Dh, 0Ah, "Iveskite:$"
msgIsvesk DB 0Dh, 0Ah, "Pakeista eilute:$"
msgError DB 0Dh, 0Ah, "Klaida!$"
BUFMAX DB 255
BUFSIZE DB ?
BUF DB 120 DUP(?)
;;BUFOUT DB 120 DUP(?)
.code
START:
mov ax, @data
mov ds, ax
mov es, ax
mov dx, offset msgIntro
mov ah, 9
int 21h
mov dx, offset msgIvesk
mov ah, 9
int 21h
mov dx, offset BUFMAX
mov ah, 0Ah
int 21h
mov dx, offset msgIsvesk
call Write
;nuskaitom eilutes ilgi
cld
mov si, offset BUFSIZE
lodsb
mov cl, al
xor ch, ch
;xz
push si
pop di
;ciklas
CHECK:
lodsb
cmp al, 'A'
jb DoNothing
cmp al, 'Z'
jbe Keisk_i_Mazaja
cmp al, 'a'
jb DoNothing
cmp al, 'z'
jbe Keisk_i_Didziaja
cmp al, 'z'
ja DoNothing
Keisk_i_Mazaja:
sub al, 20h
jmp DoNothing
Keisk_i_Didziaja:
add al, 20h
jmp DoNothing
DoNothing:
stosb
Klaida:
xor ax, ax
dec ax
loop CHECK
;
mov al, '$'
stosb
mov dx, offset BUF
mov ax, 4C00h
int 21h
write PROC
push ax
mov ah, 9h
int 21h
pop ax
ret
write ENDP
END START