Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ADD COMMENTS IN THE CODES, SO THAT I CAN UNDERSTAND AND EXPLAIN MY FACULTY. I WILL UPVOTE AFTER GETTING PROPER SOLVE. :) Question 1

PLEASE ADD COMMENTS IN THE CODES, SO THAT I CAN UNDERSTAND AND EXPLAIN MY FACULTY. I WILL UPVOTE AFTER GETTING PROPER SOLVE. :) Question 1 Solve the following problems using Assembly_Language Code

At_first,_ask_the_user_to_input_5_alphabetic_characters_and_store_them_in_an_array_of_size five._Now_your_task_is_to_generate_a_random_number_from_0_to_9._Here,_if_the_generated random_number_is_odd,_then_print_the_number_first_then_the_5_characters_in_reverse_order. Otherwise,_print_the_number_first_and_then_the_characters_in_their_given_order.

To_generate_a_random_number_you_first_need_to_create_a_seed._You_store_a_4_digit_16-bit_decimal number_in_a_variable._The_summation_of_the_individual_digits_of_the_number_will_be_your_seed. You_have_to_do_this_in_a_procedure_called_generate_Seed. To_generate_the_random_number_simply_do,_"seed_modulus_10"_or_seed_%_10_which_will return_a_value_between_0_to_9._You_have_to_do_this_in_a_procedure_called_generate_Rand. Remember_that_after_printing_the_random_number,_the_characters_will_be_printed_in_the next_line_altogether_without_any_spacing.

Input Example 01: Please enter 5 alphabetic characters: a l i c e Suppose 1584 is the number that you stored in a variable Output Example 01: The random number is: 8 alice

Explanation: The_summation_of_the_individual_digits_of 1584 is 18 (1+5+8+4=18). So,_your_seed_is 18. Therefore,_the_random_number_is_seed % 10 = 18 % 10 = 8. As 8 is_an_even_number,_so_print the_characters_together_in_the_given_order. And_you_have_to_do_this_in_2_procedures,_generate_Seed_and_generate_Rand

______________________________________________________________________

Please try solve the problems using- Lea Mov Loop Add Sub Cmp Jge Jle

Do not use advanced level syntax. I have to Solve the problem in my Academic way.

Try not to use - CALL,PROC,RET,JZ and Macro msg and all other advanced level syntax.

  • You must have "emu8086" software to run the code and use Assembly Language only.
  • After solving the problems check outputs then COPY and PASTE the codes
  • Please give a screenshot so that I can understand.
  • Please solve all the three parts as they are in a single problem.
  • Do not give any java or python codes use Assembly Language only.

image text in transcribed

Skeleton Code:

.MODEL SMALL

.STACK 100H

.DATA

.CODE

;EXIT TO DOS

MOV AX,4c00H

INT 2H

MAIN ENDP

END MAIN

ScreenShot of the "emu8086" Software:

image text in transcribed

Take time but give me proper answer. I will upvote after getting proper solution. Thank you.

Please do not give any codes that was solved by any other solver before. I am uploading again to get new codes. If I get any code that was solved before I will downvote. Please pass the question If you cannot solve, just do not give solution that was solved before. A 1 emu8086 - assembler and microprocessor emulator 4.08 file edit bookmarks assembler emulator math ascii codes help +++ * E new open examples save compile emulate calculator convertor options help about GO model small ; We choose model small because we need less than 64kb of memory size 002 003 ; We are creating messages 004 original source co... 005 printmsg macro msg ntmag 006 ; Pushing general 698 Mov ah, 4ch ng to emulator: noname.exe_ n 007 push ax 999 int 21h 008 push bx 100 file math debug view external virtual devices virtual drive help 099 push cx 101 G10 push dx 102 ; Procedure to read a n 1 ID >> 311 LEA dx,msg ; Load: 103 readnum proc near regis 012 mov ah,09h ; Use Load reload step back single step run step delay ms: 0 104 push ax G13 int 21 h G14 ; Poping all regi: 166 push cx 105 push bx alled registers F490: 92 94 . L 015 pop dx F400:02 94 916 pop cx 107 push dx 108 mov num,00 AX 4C 85 F4200: FF 255 RES BIOS DI 017 popbx 109 r1: F4201: FF 255 RES INT 921h 018 popax 110 mov ah,01 h B8 | 00 | 09 F4202: CD 205 = I RET 019 end 111 int 21h F4203 : 21 033 ! ADD CBX + SI, AL 020 .data 112 cmp al,dh CX 00 00 | F4204: CF 207 1 ADD [BX + SI], AL 021 113 je r2 14205: GIG GIGIO NULL ADD [BX + SI], AL 022 msg1 db Gah,Odh," 114 mov CX, ax DX 00 05 F4206: 00 000 NULL ADD [BX + SI], AL 023 arr dw 3_dup> 115 and cx,00ffh +4207: 00 000 NULL ADD [BX + SI], AL 024 msg2 db Gah, Odh," 10 -.. av L. AL CS F499 F4208: 00 000 NULL ADD [BX + SI], AL 025 msg3 db Gah, odh," F4209: 00 900 NULL ADD [BX + SI), AL 926 ms.O4 dh fahadh" IP TAO: 00 00 00 000 NULL ADD [BX + SI), AL 022 SERI emulator screen (80x25 chars) 00 000 NULL ADD [BX + SIJ, AL 028 00 000 NULL ADD [BX + SI], AL 029 00 000 NULL ADD [BX + SI), AL 030 1st Input:4 00 000 NULL ADD [BX + SI], AL 031 2nd Input:5 90 000 NULL ADD [BX + SI], AL 032 3rd Input:6 00 000 NULL ADD [BX + SI], AL 033 go 900 NULL Sorted Array:4 5 6 034 ADD [BX + SI), AL 00 000 NULL Median: 5 035 ADD [BX + SIL, AL 90 000 NULL ADD [BX + SIT, AL 036 00 000 NULL ADD [BX + SI], AL 032 00 000 NULL 038 039 040 source reset aux Vars debug stack flags 041 042 043 044 045 046 G47 048 049 050 AV 1 line: 166

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions