Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an assembly language program to input a string from the user, count and di

ID: 3844616 • Letter: W

Question

Write an assembly language program to input a string from the user, count and display the number of times each word occur in the user input string.
For example if the user types in: "Hello there how are you, there you are Hello Hello you"
Your output should be:
Hello 3
there 2
how 1
are 2
you 3
Write an assembly language program to input a string from the user, count and display the number of times each word occur in the user input string.
For example if the user types in: "Hello there how are you, there you are Hello Hello you"
Your output should be:
Hello 3
there 2
how 1
are 2
you 3
Write an assembly language program to input a string from the user, count and display the number of times each word occur in the user input string.
For example if the user types in: "Hello there how are you, there you are Hello Hello you"
Your output should be:
Hello 3
there 2
how 1
are 2
you 3

Explanation / Answer

.Ltext0: .cfi_sections .debug_frame .align 2 .global _Z8FindCharPcc _Z8FindCharPcc: .fnstart .LFB0: .cfi_startproc @ args = 0, pretend = 0, frame = 16 @ frame_needed = 1, uses_anonymous_args = 0 @ link register save eliminated. 0000 04B02DE5 str fp, [sp, #-4]! .cfi_def_cfa_offset 4 .cfi_offset 11, -4 0004 00B08DE2 add fp, sp, #0 .cfi_def_cfa_register 11 0008 14D04DE2 sub sp, sp, #20 000c 10000BE5 str r0, [fp, #-16] 0010 0130A0E1 mov r3, r1 0014 11304BE5 strb r3, [fp, #-17] 0018 0030A0E3 mov r3, #0 001c 08300BE5 str r3, [fp, #-8] .L4: 0020 10301BE5 ldr r3, [fp, #-16] 0024 0030D3E5 ldrb r3, [r3] @ zero_extendqisi2 0028 000053E3 cmp r3, #0 002c 0B00000A beq .L2 0030 10301BE5 ldr r3, [fp, #-16] 0034 0030D3E5 ldrb r3, [r3] @ zero_extendqisi2 0038 11205BE5 ldrb r2, [fp, #-17] @ zero_extendqisi2 003c 030052E1 cmp r2, r3 0040 0200001A bne .L3 0044 08301BE5 ldr r3, [fp, #-8] 0048 013083E2 add r3, r3, #1 004c 08300BE5 str r3, [fp, #-8] .L3: 0050 10301BE5 ldr r3, [fp, #-16] 0054 013083E2 add r3, r3, #1 0058 10300BE5 str r3, [fp, #-16] 005c EFFFFFEA b .L4 .L2: 0060 08301BE5 ldr r3, [fp, #-8] 0064 0300A0E1 mov r0, r3 0068 00D04BE2 sub sp, fp, #0 .cfi_def_cfa_register 13 @ sp needed 006c 04B09DE4 ldr fp, [sp], #4 .cfi_restore 11 .cfi_def_cfa_offset 0 0070 1EFF2FE1 bx lr .cfi_endproc .LFE0: .cantunwind .fnend .section .rodata .align 2 .LC1: 0000 49742061 .ascii "It appears %d times
" 70706561 72732025 64207469 6D657320 0016 0000 .align 2 .LC0: 0018 73746163 .ascii "stackoverflow rocks" 6B6F7665 72666C6F 7720726F 636B7300 .text .align 2 .global main main: .fnstart .LFB1: .cfi_startproc @ args = 0, pretend = 0, frame = 32 @ frame_needed = 1, uses_anonymous_args = 0 0074 00482DE9 stmfd sp!, {fp, lr} .save {fp, lr} .cfi_def_cfa_offset 8 .cfi_offset 11, -8 .cfi_offset 14, -4 .setfp fp, sp, #4 0078 04B08DE2 add fp, sp, #4 .cfi_def_cfa 11, 4 .pad #32 007c 20D04DE2 sub sp, sp, #32 0080 74309FE5 ldr r3, .L9 0084 003093E5 ldr r3, [r3] 0088 08300BE5 str r3, [fp, #-8] 008c 6C309FE5 ldr r3, .L9+4 0090 1CC04BE2 sub ip, fp, #28 0094 03E0A0E1 mov lr, r3 0098 0F00BEE8 ldmia lr!, {r0, r1, r2, r3} 009c 0F00ACE8 stmia ip!, {r0, r1, r2, r3} 00a0 00309EE5 ldr r3, [lr] 00a4 00308CE5 str r3, [ip] 00a8 6F30A0E3 mov r3, #111 00ac 1D304BE5 strb r3, [fp, #-29] 00b0 1D205BE5 ldrb r2, [fp, #-29] @ zero_extendqisi2 00b4 1C304BE2 sub r3, fp, #28 00b8 0210A0E1 mov r1, r2 00bc 0300A0E1 mov r0, r3 00c0 FEFFFFEB bl _Z8FindCharPcc 00c4 0030A0E1 mov r3, r0 00c8 0310A0E1 mov r1, r3 00cc 30009FE5 ldr r0, .L9+8 00d0 FEFFFFEB bl printf 00d4 0030A0E3 mov r3, #0 00d8 0300A0E1 mov r0, r3 00dc 18309FE5 ldr r3, .L9 00e0 08201BE5 ldr r2, [fp, #-8] 00e4 003093E5 ldr r3, [r3] 00e8 030052E1 cmp r2, r3 00ec 0000000A beq .L8 00f0 FEFFFFEB bl __stack_chk_fail .L8: 00f4 04D04BE2 sub sp, fp, #4 .cfi_def_cfa 13, 8 @ sp needed 00f8 0088BDE8 ldmfd sp!, {fp, pc} .L10: .align 2 .L9: 00fc 00000000 .word __stack_chk_guard 0100 18000000 .word .LC0 0104 00000000 .word .LC1 .cfi_endproc .LFE1: .fnend .Letext0:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote