ps5pr9.txt - ps5pr9(Problem Set 5 Problem 9 Calling a...

This preview shows page 1 out of 1 page.

## ps5pr9.txt (Problem Set 5, Problem 9)## Calling a distance function twice#00 read r1# get # from user and store it in r101 read r2 # get # from user and store it in r202 read r3# get # from user and store it in r303 calln r15 06# set next line number as r15 and jump to line number 0604 write r3# write out r3 (print) 05 halt# stop here06 sub r4 r1 r2# subtract r1 and r2 and store it in r407 jgtzn r4 09# if r4 is greater than 0 jump to line number 0908 neg r4 r4# negative r4 and store it in r409 copy r14 r4

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture