Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Can anyone explain me this asm code?

This is the code. Please, someone help me!

[code]
.data
CaseTable BYTE "A"
DWORD Process_A
EntrySize = ($ - CaseTable)
BYTE "B"
DWORD Process_B
BYTE "C"
DWORD Process_C
BYTE "D"
DWORD Process_D
NOE = ($ - CaseTable)
p BYTE "Inserisci A, B, C o D: ", 0
msgA BYTE "A pressed", 0
msgB BYTE "B pressed", 0
msgC BYTE "C pressed", 0
msgD BYTE "D pressed", 0
.code
MAIN PROC
mov edx, offset p
call WriteString
call ReadChar
mov ebx, offset CaseTable
mov ecx, NOE
l1:
cmp al, [ebx]
jne l2
call NEAR PTR[ebx + 1]
call WriteString
call Crlf
l2:
add ebx, EntrySize
loop l1
l3:
exit
MAIN ENDP

Process_A PROC
mov edx, offset msgA
ret
PA ENDP

Process_B PROC
mov edx, offset msgB
ret
PB ENDP

Process_C PROC
mov edx, offset msgC
ret
PC ENDP

Process_D PROC
mov edx, offset msgD
ret
PD ENDP
END MAIN[/code]

Comments

Sign In or Register to comment.