Can somebody explain briefly explain to me how this code works and which part of the code asks for hitting cap once and 'A' 11 times? Thank you!!
.model small
.stack 10H
.data
flag2 db 0
flag3 db 0
rahul db 0
try db 'we can print out strings of any length up to 2^16-1=65535\'
numtry dw 0
keyorigs dw ?
keyorigo dw ?
flag1 db 0
.code
main proc
mov ax, @data
mov ds,ax
mov ax,0
mov es,ax
mov ax,36
mov di,ax
mov ax,es: [di]
mov keyorigo,ax
mov ax,es: [di+2]
mov keyorigs,ax
mov ax,offset keyisr
mov es: [di],ax
mov ax,seg keyisr
mov es: [di+2],ax
mov ah,0
mov al,2
int 10h
push di
push ax
push cx
mov cx,0
lea di,try
mov ah,'\'
unover:
cmp ah,[di]
je over
add cx,1
add di,1
jmp unover
over:
mov numtry,cx
pop cx
pop ax
pop di
mov ax,0B800H
mov es,ax
mov cx,numtry
label1:
mov di,numtry
sub di,cx
push di
mov ax,di
push di
lea di,try
add ax,di
pop di
mov di,ax
mov ah,[di]
pop di
add di,di
mov es:[di],ah
loop label1
label2:
cmp flag1, 10
jle label2
mov ax,keyorigo
mov es: [di],ax
mov ax,keyorigs
mov es: [di+2],ax
mov ah,4cH
int 21h
main endp
keyisr proc
push AX
push BX
push CX
push DX
in al,60h
cmp al,58
jne label3
xor flag2,1
label3:
cmp al,30
jne label5
cmp flag2,1
jne label5
inc flag1
label5:
in al, 61h
mov bl,al
or al, 80h
out 61h,al
mov al,bl
out 61h,al
mov al,20h
out 20h,al
pop DX
pop CX
pop BX
pop AX
iret
keyisr endp
end main
.model small
.stack 10H
.data
flag2 db 0
flag3 db 0
rahul db 0
try db 'we can print out strings of any length up to 2^16-1=65535\'
numtry dw 0
keyorigs dw ?
keyorigo dw ?
flag1 db 0
.code
main proc
mov ax, @data
mov ds,ax
mov ax,0
mov es,ax
mov ax,36
mov di,ax
mov ax,es: [di]
mov keyorigo,ax
mov ax,es: [di+2]
mov keyorigs,ax
mov ax,offset keyisr
mov es: [di],ax
mov ax,seg keyisr
mov es: [di+2],ax
mov ah,0
mov al,2
int 10h
push di
push ax
push cx
mov cx,0
lea di,try
mov ah,'\'
unover:
cmp ah,[di]
je over
add cx,1
add di,1
jmp unover
over:
mov numtry,cx
pop cx
pop ax
pop di
mov ax,0B800H
mov es,ax
mov cx,numtry
label1:
mov di,numtry
sub di,cx
push di
mov ax,di
push di
lea di,try
add ax,di
pop di
mov di,ax
mov ah,[di]
pop di
add di,di
mov es:[di],ah
loop label1
label2:
cmp flag1, 10
jle label2
mov ax,keyorigo
mov es: [di],ax
mov ax,keyorigs
mov es: [di+2],ax
mov ah,4cH
int 21h
main endp
keyisr proc
push AX
push BX
push CX
push DX
in al,60h
cmp al,58
jne label3
xor flag2,1
label3:
cmp al,30
jne label5
cmp flag2,1
jne label5
inc flag1
label5:
in al, 61h
mov bl,al
or al, 80h
out 61h,al
mov al,bl
out 61h,al
mov al,20h
out 20h,al
pop DX
pop CX
pop BX
pop AX
iret
keyisr endp
end main