Nt1310 Unit 1 Test Paper

Decent Essays
#Write a program that implements the Bubblesort algorithm
#Registers used:
# $a0 : For loading Syscall parameters like loading integer, string
# address
# $V0 : For intiating particular syscall and return values
# $a1 : used as a argument to quicksort subroutine
# $a2 : used as a argument to quicksort subroutine
# $s1 : End address of iput array also as pointer
# $s4,$t2 : Base Address of input array acts as pointer
# $s3 : used to restore the address back to $s2

.text la $a0,String1 # enter address into a0 register to print String1 string li $v0,4 # printing msg syscall li $v0,5 #loading constant 5 into $v0 to read integer syscall move $a0,$v0 #scanned integer moving to $a0 sll $a0,$a0,2 #shifting bits left
…show more content…
move $t0,$a0 #moving number of bytes into $t0 register li $v0,9 #loading 9 into $v0 to intialize array syscall add $t1,$t0,$v0 move $t2,$v0 #moving array address to $t2 move $s4,$t2 #moving array address to $s4 srl $t0,$t0,2 #reducing $t0 by shifting 2 locations

la $a0,String2 # enter address into a0 register to print String1 string li $v0,4 # printing msg syscall

addi $sp,$sp,-32 #allocate the stack with 32bytes sw $t0,28($sp) #store $to contents on stack sw $t1,24($sp) #store $t1 contents on stack sw $t2,20($sp) #store $t2 contents on
…show more content…
$s3 (i ? n) #beq $t0, $zero, load1 # go to exit1 if $s0 ? $s3 (i ? n) subi $s1, $s0, 1 # j = i – 1 for2tst: slti $t0, $s1, 0 # $t0 = 1 if $s1 < 0 (j < 0) bne $t0, $zero, load2 # go to exit2 if $s1 < 0 (j < 0) sll $t1, $s1, 2 # $t1 = j * 4 add $t2, $s2, $t1 # $t2 = v + (j * 4) lw $t3, 0($t2) # $t3 = v[j] lw $t4, 4($t2) # $t4 = v[j + 1] slt $t0, $t4, $t3 # $t0 = 0 if $t4 ? $t3 beq $t0, $zero, load2 # go to exit2 if $t4 ? $t3 move $a0, $s2 # 1st param of swap is v (old $a0) move $a1, $s1 # 2nd param of swap is j j swap # call swap procedure

swap: sll $t1, $a1, 2 # $t1 = k * 4 add $t1, $a0, $t1 # $t1 = v+(k*4) # (address of v[k]) lw $t0, 0($t1) # $t0 (temp) = v[k] lw $t2, 4($t1) # $t2 = v[k+1] sw $t2, 0($t1) # v[k] = $t2 (v[k+1]) sw $t0, 4($t1) # v[k+1] = $t0 (temp) subi $s1, $s1,1 # j –= 1 j for2tst # jump to test of inner

Related Documents

  • Improved Essays

    Nt1310 Unit 2 Study Guide

    • 460 Words
    • 2 Pages

    THYROID GLAND: The thyroid gland, located inside the neck, takes iodine from foods and converts it into thyroid hormones. CIRCULATORY SYSTEM: ANTERIOR VENA CAVA: The anterior vena cava drains the body of blood cranially to the heart. POSTERIOR VENA CAVA:…

    • 460 Words
    • 2 Pages
    Improved Essays
  • Improved Essays

    Nt1310 Unit 5 Lab Report

    • 1339 Words
    • 6 Pages

    The time base was set to 40 ms and the rising edge trigger was connected to CH1. The trigger level was set to 1V and CH1 was connected to the input. CH0 was connected to the output of the BASEBAND LPF. Finally, the Y-scale was set to Linear mapping. 3.…

    • 1339 Words
    • 6 Pages
    Improved Essays
  • Improved Essays

    Description of the remaining publicly available datasets is given in Table 5.1. The Conficker P2P botnet dataset contains data from the UCSD Network Telescope for three days between November 2008 and January 2009. The first day, 21st November 2008 data, covers the onset of the Conficker A infection. On the second day, 21st December 2008, only Conficker A was active and during the third day both Conficker A and B were active.…

    • 404 Words
    • 2 Pages
    Improved Essays
  • Decent Essays

    Nt1330 Unit 6 Paper

    • 403 Words
    • 2 Pages

    • Review the P9 JE tracker to ensure that all ZA accruals booked in P9 are auto reversed properly. ZA entries that are not automatically reversed will need to be manually reversed using T-code ZRFB05REV. • Run the KSB1 for the maintenance accounts daily during TRACS & SAP close weeks to see if we have SW contracts that are $120k or more. If there are items that meet this $120k threshold, we will need to book a journal to move the expenses to the prepaid account 1439100 and amortize them over the life of the contracts. Send TS team an email communication to confirm start and end dates.…

    • 403 Words
    • 2 Pages
    Decent Essays
  • Improved Essays

    Nt1310 Unit 4 Test Paper

    • 419 Words
    • 2 Pages

    1. Maintains an exact replica of one disk on another offering 100% fault tolerance. 2. Data redundancy - If one disk fails, data can be recovered from the other. 3.…

    • 419 Words
    • 2 Pages
    Improved Essays
  • Improved Essays

    Offic365 upgrade pitfalls. • Outdated versions of MAC OS are not supported, example: The Office365 installer will not run successfully on any MAC OS older than El Capitan. –– The solution here would be to coordinate with Phil and John to back up the user’s files and upgrade the device. • In most instances, MAC OS needs updates applied before Office365 installer can run successfully. - Solution: If the installation fails, we will need to perform the OS updates then reattempt the installation/upgrade • MAC OS version: El Capitan required disk permission repairs for Office365 software activation to be successful.…

    • 415 Words
    • 2 Pages
    Improved Essays
  • Decent Essays

    Nt1330 Unit 5 Test Paper

    • 597 Words
    • 3 Pages

    Student Name: Caroline machinjili THIRD YEAR DEGREE IN COMPUTING AT CCT DUBLIN SUBJECT: ADVANCED SWITHCING AND ROUTING PORTFAST AND ETHERCHANNEL October 2015 PORTFAST in my network I have setup portfast on all the 18 access switches connected to the workstations and also on the core switches connected to the servers. on both switches I have used ports fa0/1 to fa0/2. portfast on these ports will reduce the time the devices spend to connect to other devices on the network since these ports will not go through the spanning tree process of blocking, listening , learning and then forwarding which cause a delay of about 45 -50 seconds instead the ports will go straight to forwarding stage there by speeding up communication between devices in a network. for example in a company that have servers which provide services to clients. I have observed this process in my network and I will strongly recommend for the use of portfast.…

    • 597 Words
    • 3 Pages
    Decent Essays
  • Decent Essays

    Nt1330 Unit 9 Paper

    • 74 Words
    • 1 Pages

    I am sharing the overall status of all offices as it relates to Business Continuity refresh with all the Business Continuity Planners and approvers. Allowing you to see the big picture as well as how each office is tracking. Below are two data points representing current-state. We need adhere to the BCP dates as all remote offices are following a set schedule and in order to remain compliant be it audit, security or contractual.…

    • 74 Words
    • 1 Pages
    Decent Essays
  • Improved Essays

    Nt1330 Unit 2 Study Guide

    • 257 Words
    • 2 Pages

    1. A graft reject is a process in which the body immune system reacts or defends against the transplanted tissue. Because of this possibly, tissue typing or histocompatibility is used to minimize the chance of rejection of the recipient transplanted organ. The immune system attempts to defend the body against harmful substances such as germs, poisons, and sometimes, cancer cells.…

    • 257 Words
    • 2 Pages
    Improved Essays
  • Improved Essays

    Nt1310 Unit 5 Lab Report

    • 510 Words
    • 3 Pages

    ( f ( 5 ) ) the output of this function is: ans = 26 b) Write the MATLAB code to loop from 1 to 5, and evaluate the function from part a at each iteration (the first iteration will be f(1), second f(2), etc.). You can use the looping variable as an argument to be passed to f. The MATLAB code to loop from 1 to 5 and evaluate the function from part a at each iteration is: f=@ ( x ) ( x ^ 2 + 1 ) ; for i =…

    • 510 Words
    • 3 Pages
    Improved Essays
  • Improved Essays

    Nt1330 Unit 9 Final Paper

    • 354 Words
    • 2 Pages

    HIE provides the capability to electronically move clinical information among disparate healthcare information systems, and maintain the meaning of the information being exchanged. (HIMSS Dictionary of Healthcare Information Technology Terms, Acronyms and Organizations, Third Edition) 11)) 1) 1. What sorts of HIEs are there? 2. How are protection and security of patient wellbeing data guaranteed?…

    • 354 Words
    • 2 Pages
    Improved Essays
  • Improved Essays

    Nt1330 Unit 1 Paper

    • 521 Words
    • 3 Pages

    The rational for having Rouge One communications data centralize on a file server using a Distributed File System (DFS) is simple. When the data is centralized, instead of being spread out and existing on multiple computers will make it be easier to manage. The way this is going to be solve is a backup of the user data will be taken. This is to ensure that nothing will be lost. Then a Distributed File System (DFS) will be setup on the Rouge One communications file server.…

    • 521 Words
    • 3 Pages
    Improved Essays
  • Improved Essays

    Nt1330 Unit 4 Paper

    • 551 Words
    • 3 Pages

    In T8.1, services and their corresponding user communicate with each other by passing data in a well-defined, shared format, or by coordinating an activity between two or more services. The services are located in a central service pool and can use a so-called Service Bus (often Enterprise Service Bus or ESB), should be shared in parallel by different application systems and beyond, combined by a service composition to arbitrarily complex complete systems. This, also called orchestration combination of various distributed services from many different administrative domains is an essential feature of a service-oriented architecture. A Service bus is used to provide communication between all services and any user, User sends request to the service…

    • 551 Words
    • 3 Pages
    Improved Essays
  • Improved Essays

    Pt1420 Unit 8

    • 925 Words
    • 4 Pages

    The program would move up a level each time until there are no more levels, leaving (hopefully) the answer. Current Specifications: The program works as expected. It will return answers to…

    • 925 Words
    • 4 Pages
    Improved Essays
  • Decent Essays

    Nt1310 Unit 4 Test

    • 315 Words
    • 2 Pages

    Have you ever noticed that your PC keeps slowing down during the day? If ‘yes’, it might happen as because many programs simply remain in an execution mode and keeps sucking up a considerable amount of processing power. Such a type of fault remains specific to a fault specific to Windows 8.1 Task Manager Startup and the best way of tackling the same is with the help of taskmgr.exe fixing software. In this context, it could be said that the free online tools hardly prove to be of any benefit in fixing all analogous types & genres of issues. Adyne Roberts posted a series of queries one after the other.…

    • 315 Words
    • 2 Pages
    Decent Essays