Skip to content

Image transcription text1. Describe below in writing two bas

Do you have a similar question? Our professional writers have done a similar paper in past. Give Us your instructions and wait for a professional assignment!        

Image transcription text1. Describe below in writing two basicstructures used in assembly programs(as interface) to organise … Show more… Show more#This code below was writing by MIPS language#?tart of the main program to perform the calculation#? = (g + h) – (p + q)#?ssumes: variables f through h are in memory,#?ut variables p and q are read in from the keyboard#?nd stored in memory locations?dataf:?word????# simple/single variableg:?word?h:?word?15p:?word????# does it matter that it is 0?q:?word????# does it matter that it is 0??text?globl mainmain: ????? main has to be a global label?ddu?s7, $0, $ra?# save the return address in a global register?w?s1, g???# g = 5?w?s2, h???# h = -15#————————————getting p?data?globl?essage1 ?essage1:?asciiz “nInput value for p: “?string to print?text?i?v0, 4???# print_string (system call 4)?a?a0, message1 ?# takes the address of string as an argument?syscall?i?v0, 5???# read_int (system call 5)?syscall?dd?s3, $0, $v0 ?# move to $s3?w?s3, p???# p is stored#————————————getting q?data?globl?essage2message2:?asciiz “nInput value for q: “?#string to print?text?i?v0, 4???# print_str (system call 4)?a?a0, message2 ?# takes the address of string as an argument?syscall?i?v0, 5???# read_int (system call 5)?yscall?dd?s4, $0, $v0 ?# move to $s0?w?s4, q???# q is stored#———————————–calculating f?dd?t0, $s1, $s2?# register $t0 contains g + h?dd?t1, $s3, $s4?# register $t1 contains p + q?ub?s0, $t0, $t1?# f = (g + h) – (p + q)?w?s0, f???# store f#———————————–printing f on the console?data?globl?essage3message3:?asciiz “nThe value of f is: “?string to print?text?i?v0, 4???# print_str (system call 4)?a?a0, message3 ?# takes the address of string as an argument?syscall?i?v0, 1???# print_int (system call 1)?dd?a0, $0, $s0 ?# put value to print in $a0?yscall#————————————usual stuff at the end of the main?ddu?ra, $0, $s7?# restore the return address?r?$ra ???# return to the main programImage transcription text3. Task I: [1 mark] write your ownprogram which calculates and displaysin the console window the… Show more… Show moreEngineering & TechnologyComputer ScienceCOMPUTER S 300096

Get a plagiarism-free order today   we guarantee confidentiality and a professional paper and we will meet the deadline.    

Leave a Reply

Order a plagiarism free paper today. Get 20% off your first order!

X