Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

Sign in to follow this  

Ajuda em assembly do P3

Recommended Posts


Boa noite

Tenho de implementar a raiz quadrada deste programa em assembly do p3 alguém me pode ajudar?

aqui fica o algoritmo base:

short sqrt(short num) {

;        short op = num;

;        short res = 0;

;        short one = 1 << 14; // The second-to-top bit is set: 1L<<30 for long


;        // "one" starts at the highest power of four <= the argument.

;        while (one > op)

;            one >>= 2;


;        while (one != 0) {

;            if (op >= res + one) {

;                op -= res + one;

;                res += one << 1;

;            }

;            res >>= 1;

;            one >>= 2;

;        }

;        return res;

;    }

Agradeço a ajuda disponibilizada

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.