I am looking for the answer to question 4-2 in the bookSPARc
architecture, Assembly Language and programming in C (secodn edtion)
The author is Richard P. paul
The questions of 4-2 is as follows this code is in sparc:
Write an addtion algorithm wich also sets the condtion codes for two's
complemnbnts numbers using the machine logical instructions such as
And reg_rs1, reg_or_imm, reg_rd
Andn reg_rs1, reg_or_imm, reg_rd
Xor reg_rs1, reg_or_imm, reg_rd
Or reg_rs1, reg_or_imm, reg_rd
Xnor reg_rs1, reg_or_imm, reg_rd
Orn reg_rs1, reg_or_imm, reg_rd
you can not use add or sub or their cc versions the code should aslo
set the condtion codes for N, V, Z and C
the condtion are to eb stored in low order rgeisters
define(z,8) !'z=010
define(n,4) !' N=004
define(v,2) !'V=002
define(c,1) !'c=001 |