Create a program that analyzes the vowels in a character string. Define a null-t
ID: 3798577 • Letter: C
Question
Explanation / Answer
Assembly Code is:
.LC0:
.string "Enter the string:"
.LC1:
.string " Number of vowels in string :"
main:
push rbp
mov rbp, rsp
sub rsp, 32
mov DWORD PTR [rbp-8], 0
mov esi, OFFSET FLAT:.LC0
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
lea rax, [rbp-32]
mov rsi, rax
mov edi, OFFSET FLAT:std::cin
call std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char> >(std::basic_istream<char, std::char_traits<char> >&, char*)
mov DWORD PTR [rbp-4], 0
.L8:
mov eax, DWORD PTR [rbp-4]
cdqe
movzx eax, BYTE PTR [rbp-32+rax]
test al, al
je .L2
mov eax, DWORD PTR [rbp-4]
cdqe
movzx eax, BYTE PTR [rbp-32+rax]
cmp al, 97
jne .L3
add DWORD PTR [rbp-8], 1
.L3:
mov eax, DWORD PTR [rbp-4]
cdqe
movzx eax, BYTE PTR [rbp-32+rax]
cmp al, 101
jne .L4
add DWORD PTR [rbp-8], 1
.L4:
mov eax, DWORD PTR [rbp-4]
cdqe
movzx eax, BYTE PTR [rbp-32+rax]
cmp al, 105
jne .L5
add DWORD PTR [rbp-8], 1
.L5:
mov eax, DWORD PTR [rbp-4]
cdqe
movzx eax, BYTE PTR [rbp-32+rax]
cmp al, 111
jne .L6
add DWORD PTR [rbp-8], 1
.L6:
mov eax, DWORD PTR [rbp-4]
cdqe
movzx eax, BYTE PTR [rbp-32+rax]
cmp al, 117
jne .L7
add DWORD PTR [rbp-8], 1
.L7:
add DWORD PTR [rbp-4], 1
jmp .L8
.L2:
mov esi, OFFSET FLAT:.LC1
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
mov rdx, rax
mov eax, DWORD PTR [rbp-8]
mov esi, eax
mov rdi, rdx
call std::basic_ostream<char, std::char_traits<char> >::operator<<(int)
mov eax, 0
leave
ret
__static_initialization_and_destruction_0(int, int):
push rbp
mov rbp, rsp
sub rsp, 16
mov DWORD PTR [rbp-4], edi
mov DWORD PTR [rbp-8], esi
cmp DWORD PTR [rbp-4], 1
jne .L12
cmp DWORD PTR [rbp-8], 65535
jne .L12
mov edi, OFFSET FLAT:std::__ioinit
call std::ios_base::Init::Init()
mov edx, OFFSET FLAT:__dso_handle
mov esi, OFFSET FLAT:std::__ioinit
mov edi, OFFSET FLAT:std::ios_base::Init::~Init()
call __cxa_atexit
.L12:
nop
leave
ret
_GLOBAL__sub_I_main:
push rbp
mov rbp, rsp
mov esi, 65535
mov edi, 1
call __static_initialization_and_destruction_0(int, int)
pop rbp
ret
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.