View Single Post
Old Sep 11th, 2005, 8:23 PM   #1
browning_man9
Newbie
 
Join Date: Sep 2005
Posts: 5
Rep Power: 0 browning_man9 is on a distinguished road
A little help please

Hey I am new to this forum and very new to this forum. I am currently taking a computer science introductory course and I am having a little bit of trouble. We are using all the basic commands of assembly (I think) like mov, inp, cpy, div a, mul a, add a, brz (branch if zero) a, brp a (branch if positive), jmp (jump), etc. I am trying to write a program that prints the ulam sequence....if that inputted number is even divide it by two...if its odd, multiply by three and add one....I am finding it very difficult to figure out how to test if the number is odd or even using these few commands, and using only 32 bytes. This is the only part I am stuck on....Could you please show me how to test if its even or odd using only the simple commands? Thank you very much for your time!
browning_man9 is offline   Reply With Quote