Logo 
Search:

Assembly Language Answers

Ask Question   UnAnswered
Home » Forum » Assembly Language       RSS Feeds
  Question Asked By: Rafat Hashem   on May 23 In Assembly Language Category.

  
Question Answered By: Abhishek Singh   on May 23

Program to check whether the value in register is even or odd
.ORIG X3000
AND R2,R1,X0001
BRZ EVEN
LEA R0,DEF ;PRINTS ODD IF VALUE IN REGISTER R2 IS 1
PUTS
HALT

EVEN:
LEA R0,ABC ;PRINTS EVEN IF VALUE IN R2 IS 0
PUTS
HALT
ABC .STRINGZ "EVEN"
DEF .STRINGZ "ODD"
.END

Share: 

 
 
Didn't find what you were looking for? Find more on convert c to assembly Or get search suggestion and latest updates.


Tagged: