.model small
.stack 100h
.data
max db 255
len db ?
string db 255 dup (' ')
GreetingMessage db 'Good Afternoon Olena Anatoliyvna!',13,10,'$'
VariantMessage db 'You have entered the home-task program of variant 1',13,10,'$'
InputMessage db 'You are welcome to enter the string with any characters',13,10,'$'
EnterAgainMessage db 13,10,'Would you like to enter one more string',13,10,'$'
ResultMessage db 13,10,'Resulting string after changing every capital letter into small one',13,10,'$'
GoodbYeMessage db 13,10,'Thank you for your attention. Have a nice day!',13,10,'$'
RightMessage db 'Copyright AnyaB',13,10,'$'
.code
begin:
mov ax, 003h
int 10h ;ocistka ekrana
mov ax, @data
mov ds, ax ;ustanavlivaem registr ds takim obrazom 4to bi on ukazival na segment dannih
push ax
lea dx, GreetingMessage
call Write_Proc
lea dx, VariantMessage
call Write_Proc
lea dx, InputMessage
call Write_Proc
mov ah,0ah ;vvod stroki
lea dx,max
int 21h
xor bx,bx
mov bl,len
mov di,bx
mov byte ptr string[di],'$' ;zakancivaem stroku simvovlom $
mov ah,9
lea dx, string ;vivod vvedennoi stroki
int 21h
lea si,string
xor cx,cx
mov cl,len
push ds
pop es
lea di,string
cwd
go:
xor ax,ax
lodsb
cmp al, 41h
jl scip
cmp al, 5Ah
jg scip
add al, 20h
scip:
stosb
loop go
lea dx, ResultMessage ;vivod soobs4eniya-result
call Write_Proc
xor bx,bx
mov bl,len
mov di,bx
mov byte ptr string[di],'$' ;end the string with symbol $
mov ah,9
lea dx, string ;vivod soobs4eniya-result
int 21h
lea dx,EnterAgainMessage
call Write_Proc
;mov ah,0ah ;vvod stroki
;lea dx,max
;int 21h
lea dx, GoodbyeMessage ;vivod soobs4eniya-result
call Write_Proc
lea dx, RightMessage ;vivod soobs4eniya-result
call Write_Proc
Write_Proc proc ;procedure for dispalying the messages
push ax
xor ax,ax
mov ah,09h
int 21h
pop ax
ret
Write_Proc endp
pop ax
mov ax,4c00h ;obicnoe zavershenie programi
int 21h
end begin
[TASM]Цветные результаты
Уважаемые программисты, как в даной программе сделать введеное значение переменной STRING сначала, например, синим, а потом после преобразования этой переменной STRING, ее значение вывести красным цветом?