AML – Homework 1 (Solution)

$ 24.99
Category:

Description

Shekoufeh Sadeghi

Your task is to read two integers from the standard input, apply certain operations on them and print the result. The operation is unique to each student. You can find your dedicated formula at the end of this document.

Your code must comply with the following rules:
● You can only use the EAX, EBX, ECX, EDX, ESI and EDI registers.
● You are not allowed to use the memory/Data segment.
● You must use the read_int and print_int functions (from the textbook) for I/O.
● You can only use the commands you have learned so far in the class.
You cannot use MUL, IMUL, jump instructions, etc.
● You MUST NOT PRINT ANY REDUNDANT DATA .
Results are checked by Script.

Remember that your code will be tested for similarity. In the case of cheating the student will receive a negative mark. It is your responsibility to protect your code.
Please upload only the “.asm” file on courses.kntu.ac. ir .

Example:
If input numbers are 2 and 5 and your formula is
((input1 + 28) * 7) – (input2 – 79 ) * 2,
then the output number will be:
((2+ 28) * 7) – (5 – 79 ) * 2 = 358

Hint: Try to break each multiplier into powers of 2. For example x*11 = x*8 + x*2 + x*1

Formulas :

ID formula input 1 input 2 output
9697943 (((input1 * 12) + 5) + (input2 – 41 ))* 3 3 5 15
9819123 ((input1 + 74 ) – ((input2 * 7 ) + 72))* 5 3 5 -150
9826533 ((input2 – 84 ) + ((input1 + 88 ) * 4))* 7 3 5 1995
9819493 ((input2 – 68 ) + ((input1 + 50 ) * 3))* 11 3 5 1056
9819503 ((input1 + 41 ) – ((input2 * 3 ) + 17))* 5 3 5 60
9826653 (((input2 * 8) – 81) – (input1 + 71 ))* 3 3 5 –345
9637963 ((input1 – 56 ) + ((input2 + 42 ) * 4))* 5 3 5 675
9732683 (((input1 * 9) – 81) – (input2 + 40 ))* 5 3 5 -495
9819933 (((input1 + 64) * 4) + (input2 – 46 ))* 9 3 5 2043
9625523 (((input1 + 49) * 10) – (input2 – 102 ))* 2 3 5 1234
9820433 (((input1 + 31) * 4) + (input2 – 88 ))* 6 3 5 318
9820453 ((input1 + 90 ) – ((input2 * 5 ) + 108))* 6 3 5 –240
9820683 (((input2 + 81) * 10) + (input2 – 82 ))* 5 3 5 3915
9820713 ((input2 + 38 ) – ((input1 * 6 ) + 96))* 7 3 5 -497
9820723 (((input2 + 20) * 8) – (input1 – 31 ))* 3 3 5 684
9631813 (((input1 + 71) * 6) – (input2 – 83 ))* 4 3 5 2088
9821023 (((input1 * 6) + 17) + (input2 – 55 ))* 2 3 5 -30
9821373 ((input1 + 74 ) – ((input2 * 7 ) + 72))* 5 3 5 -150
9821383 ((input2 – 84 ) + ((input1 + 92 ) * 4))* 6 3 5 1806
9821603 ((input2 – 65 ) + ((input1 + 74 ) * 6))* 6 3 5 2412
9821613 ((input1 + 55 ) – ((input2 * 4 ) + 13))* 5 3 5 125
9826463 (((input1 * 8) – 81) – (input2 + 63 ))* 4 3 5 -500
9822083 ((input 2 – 56 ) + ((input1 + 42 ) * 4))* 6 3 5 774
9822123 (((input1 * 9) – 96) – (input2 + 26 ))* 4 3 5 -400
9822143 (((input2 + 74) * 7) + (input1 – 46 ))* 3 3 5 1530
9822183 (((input1 + 78) * 8) – (input2 – 102 ))* 2 3 5 1490
9726923 (((input2 + 85) * 4) + (input1 – 88 ))* 3 3 5 825
9822233 ((ipnut1 + 19 ) – ((input2 * 5 ) + 108))* 5 3 5 -555
9822263 (((input2 + 81) * 5) + (input1 – 82 ))* 3 3 5 1053
9822483 ((input1 + 88 ) – ((input2 * 7 ) + 96))* 5 3 5 -200
9822573 (((input1 + 20) * 8) – (input2 – 31 ))* 2 3 5 420
9822823 (((input1 + 71) * 4) – (input2 – 83 ))* 2 3 5 748
9822873 (((input2 + 38) * 8) + (input1 – 78 ))* 3 3 5 807
9823013 ((input1 + 71 ) – ((input2 * 8 ) + 47))* 5 3 5 -65
9826713 (((input1 + 26) * 4) – (input2 – 49 ))* 2 3 5 320
9826603 (((input2 + 46) * 6) + (input1 – 75 ))* 3 3 5 702
9823453 (((input1 * 9) + 28) + (ipnut2 – 106 ))* 2 3 5 -92
9826793 (( input2 – 51 ) + ((input1 + 66 ) * 5))* 6 3 5 1794
9826433 ((input1 + 22 ) – ((input2 * 5 ) + 49))* 5 3 5 -245
9823903 (((input1 * 5) + 82) + (input2 – 94 ))* 2 3 5 16
9823943 (((input1 * 6) + 63) + (input2 – 35 ))* 2 3 5 102
9824103 (((input1 * 7) + 53) + (input2 – 94 ))* 2 3 5 -30
9824153 (((input1 + 54) * 5) – (input2 – 67 ))* 2 3 5 694
9824253 (((input2 + 60) * 6) + ( input1 – 63 ))* 3 3 5 990
9629273 (((input1 * 7) – 108) – (input2 + 104 ))*4 3 5 -784
9824433 (((input1 * 5) + 74) + (input2 – 40 ))* 2 3 5 108
9825013 (((input1 + 45) * 5) – (input2 – 56 ))* 2 3 5 582
9825133 ((input2- 19 ) + ((input1 + 84 ) * 8))* 6 3 5 4092
9825523 ((input1 + 71 ) – ((input2 * 8 ) + 92))* 5 3 5 -290
9825663 ((input1 + 108 ) – ((input2 * 5 ) + 41))* 5 3 5 225
9730683 (((input1 * 8) – 10) – (input2 + 106 ))* 4 3 5 -388
9825853 (((input1 * 5) + 72) + (input2 – 78 ))* 2 3 5 28
9825943 (((input1 * 8) – 68) – (input2 + 109 ))* 4 3 5 -632
9825983 (((input1 * 4) – 94) – (input2 + 32 ))* 4 3 5 -476
9826233 (((input1+ 14) * 8) – (input2 – 29 ))* 3 3 5 480
9732703 (((input1* 5) + 19) + (input2 – 91 ))* 2 3 5 -104

Reviews

There are no reviews yet.

Be the first to review “AML – Homework 1 (Solution)”

Your email address will not be published. Required fields are marked *