\nSir, can you please make quadratic equation solver in assembly or just
\nsquare root function I’m having a problem in square root part please
\nhelp?
\nRaj\n<\/p><\/blockquote>\n2016-03-25 08:14<\/p>\n
See below:
\n#——————————————————————————————
\n# Subroutine:\tsqrt
\n# Usage:\tv0 = sqrt(a0)
\n# Description:
\n# \tTakes a positive signed integer in $a0 and returns its integer square root
\n#\t(i.e., the floor of its real square root) in $v0.
\n# Arguments:\t$a0 – A positive signed integer to take the square root of.
\n# Result:\t$v0 – The floor of the square root of the argument, as an integer.
\n# Side effects:\tThe previous contents of register $t0 are trashed.
\n# Local variables:
\n#\t$v0 – Number r currently being tested to see if it is the square root.
\n#\t$t0 – Square of r.
\n# Stack usage: none
\n#——————————————————————————————
\nsqrt:\taddi\t$v0, $zero, 0\t # r := 0
\nloop:\tmul\t$t0, $v0, $v0\t # t0 := r*r
\n\tbgt\t$t0, $a0, end\t # if (r*r > n) goto end
\n\taddi\t$v0, $v0, 1\t # r := r + 1
\n\tj\tloop\t\t # goto loop
\nend:\taddi\t$v0, $v0, -1\t # r := r – 1
\n\tjr\t$ra\t\t # return with r-1 in $v0<\/p>\n-Amell<\/p>\n","protected":false},"excerpt":{"rendered":"
Sir, can you please make quadratic equation solver in assembly or just square root function I’m having a problem in square root part please help? Raj 2016-03-25 08:14 See below: #—————————————————————————————— # Subroutine: sqrt # Usage: v0 = sqrt(a0) # Description: # Takes a positive signed integer in $a0 and returns its integer square root […]<\/p>\n","protected":false},"author":1,"featured_media":1098,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[26,7],"tags":[],"jetpack_featured_media_url":"https:\/\/smartvania.com\/wp-content\/uploads\/2016\/03\/LTSK-copy.png","_links":{"self":[{"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/posts\/1184"}],"collection":[{"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/comments?post=1184"}],"version-history":[{"count":4,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/posts\/1184\/revisions"}],"predecessor-version":[{"id":1188,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/posts\/1184\/revisions\/1188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/media\/1098"}],"wp:attachment":[{"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/media?parent=1184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/categories?post=1184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/tags?post=1184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}