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

You are to write an assembly language program the 486 chip. The program will tak

ID: 3694480 • Letter: Y

Question

You are to write an assembly language program the 486 chip. The program will take three sides of a triangle and determine if the triangle is a right triangle or not. The three sides are read in at the keyboard(not hard coded in your program.) A sample run: This program determines if you have a right triangle or not. Enter the longest side first: 5 Enter the second longest side: 4 Enter the shortest side: 3 Your triangle is a right triangle. Run again (Y/N) Y This program determines if you have a right triangle or not. Enter the longest side first: 5 Enter the second longest side: 4 Enter the shortest side: 4 Your triangle is a not right triangle. Run again(Y/N) N What you are to include in your submission: A folder with brads. All pages are to be 3-hole punched and attached to the folder. Submission to Moodle. A cover page with your name, instructors name, class, date, and assignment title. A write up describing what the problem is and how you intend to mathematically solve it. Give either an algorithm or flow diagram of your plan of attack. Give a least 4 cases for test plan (Two which are right triangles and two which are not.) A listing of your assembly code.

Explanation / Answer

.Ltext0: .section .rodata .align 8 .LC0: 0000 656E7465 .string "enter the longest side first : " 72207468 65206C6F 6E676573 74207369 .LC1: 0020 256400 .string "%d" 0023 00000000 .align 8 00 .LC2: 0028 656E7465 .string "enter the second longest side first : " 72207468 65207365 636F6E64 206C6F6E 004f 00 .align 8 .LC3: 0050 656E7465 .string "enter the Shortest side first : " 72207468 65205368 6F727465 73742073 0071 00000000 .align 8 000000 .LC4: 0078 596F7572 .string "Your triagnle is a right angle triangle" 20747269 61676E6C 65206973 20612072 .align 8 .LC5: 00a0 456E7465 .string "Enter 1 to run program again: " 72203120 746F2072 756E2070 726F6772 .LC6: 00bf 2564252A .string "%d%*c" 6300 .text .globl main main: .LFB0: .cfi_startproc 0000 55 pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 0001 4889E5 movq %rsp, %rbp .cfi_def_cfa_register 6 0004 4883EC20 subq $32, %rsp 0008 64488B04 movq %fs:40, %rax 25280000 00 0011 488945F8 movq %rax, -8(%rbp) 0015 31C0 xorl %eax, %eax .L5: 0017 BF000000 movl $.LC0, %edi 00 001c E8000000 call puts 00 0021 488D45E4 leaq -28(%rbp), %rax 0025 4889C6 movq %rax, %rsi 0028 BF000000 movl $.LC1, %edi 00 002d B8000000 movl $0, %eax 00 0032 E8000000 call __isoc99_scanf 00 0037 BF000000 movl $.LC2, %edi 00 003c E8000000 call puts 00 0041 488D45E8 leaq -24(%rbp), %rax 0045 4889C6 movq %rax, %rsi 0048 BF000000 movl $.LC1, %edi 00 004d B8000000 movl $0, %eax 00 0052 E8000000 call __isoc99_scanf 00 0057 BF000000 movl $.LC3, %edi 00 005c E8000000 call puts 00 0061 488D45EC leaq -20(%rbp), %rax 0065 4889C6 movq %rax, %rsi 0068 BF000000 movl $.LC1, %edi 00 006d B8000000 movl $0, %eax 00 0072 E8000000 call __isoc99_scanf 00 0077 8B55E8 movl -24(%rbp), %edx 007a 8B45E8 movl -24(%rbp), %eax 007d 0FAFD0 imull %eax, %edx 0080 8B4DEC movl -20(%rbp), %ecx 0083 8B45EC movl -20(%rbp), %eax 0086 0FAFC1 imull %ecx, %eax 0089 01D0 addl %edx, %eax 008b 660FEFC0 pxor %xmm0, %xmm0 008f F30F2AC0 cvtsi2ss %eax, %xmm0 0093 F30F1145 movss %xmm0, -12(%rbp) F4 0098 8B55E4 movl -28(%rbp), %edx 009b 8B45E4 movl -28(%rbp), %eax 009e 0FAFC2 imull %edx, %eax 00a1 660FEFC0 pxor %xmm0, %xmm0 00a5 F30F2AC0 cvtsi2ss %eax, %xmm0 00a9 0F2E45F4 ucomiss -12(%rbp), %xmm0 00ad 7A17 jp .L2 00af 0F2E45F4 ucomiss -12(%rbp), %xmm0 00b3 7511 jne .L2 00b5 BF000000 movl $.LC4, %edi 00 00ba B8000000 movl $0, %eax 00 00bf E8000000 call printf 00 00c4 EB0F jmp .L4 .L2: 00c6 BF000000 movl $.LC4, %edi 00 00cb B8000000 movl $0, %eax 00 00d0 E8000000 call printf 00 .L4: 00d5 BF000000 movl $.LC5, %edi 00 00da B8000000 movl $0, %eax 00 00df E8000000 call printf 00 00e4 488D45F0 leaq -16(%rbp), %rax 00e8 4889C6 movq %rax, %rsi 00eb BF000000 movl $.LC6, %edi 00 00f0 B8000000 movl $0, %eax 00 00f5 E8000000 call __isoc99_scanf 00 00fa 8B45F0 movl -16(%rbp), %eax 00fd 83F801 cmpl $1, %eax 0100 0F8411FF je .L5 FFFF 0106 B8000000 movl $0, %eax 00 010b 488B4DF8 movq -8(%rbp), %rcx 010f 6448330C xorq %fs:40, %rcx 25280000 00 0118 7405 je .L7 011a E8000000 call __stack_chk_fail 00 .L7: 011f C9 leave .cfi_def_cfa 7, 8 0120 C3 ret .cfi_endproc .LFE0: .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