Assembly help needed for small class assignemtn!

Assembly help needed for small class assignemtn!!

Page 1 of 1

4 Replies - 1180 Views - Last Post: 18 April 2008 - 05:59 AM Rate Topic: -----

#1 bronco2680  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-April 08

Assembly help needed for small class assignemtn!

Post icon  Posted 17 April 2008 - 09:34 AM

have this program i need to write for class....having alot of trouble....this is a entry level class..... here is the program guidelines....

Write an Assembly program that reads a non-negative integer (0 - 32,767) in decimal and prints its equivalent in binary after making sure it's non-negative. The output must show all 16 bits. AND YOU MUST USE A LOOP and local variables for producing and outputing the bits. For example, if input is 120, output should be:
0000000001111000.
If input is -120, output should be:
Enter a non-negative number only.

Hint: To get the remainder of a number divided by 2, AND the number with 1. So, 13 % 2 is accomplished by doing 13 AND 1.


Thank you for any input or advice

Is This A Good Question/Topic? 0
  • +

Replies To: Assembly help needed for small class assignemtn!

#2 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: Assembly help needed for small class assignemtn!

Posted 17 April 2008 - 10:38 AM

have you done anything towards this project?'

Do you have any code to show?


Because we are not going to do your homework for you, we will be glad to help but you are going to have to show us that you at least tried it on your own 1st.
Was This Post Helpful? 0
  • +
  • -

#3 bronco2680  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-April 08

Re: Assembly help needed for small class assignemtn!

Posted 17 April 2008 - 01:41 PM

num1: .equate 2
main: subsp 2,i
while: deci num1,s
lda num1,s
brlt endwhile

endwhile: stro msg,d


stop
msg: .ASCII "please enter a positive number"

This is what iv got so far.....i just cant figure out how i am going to display the output in all 16 bits.....im having trouble with the output part of it......thank you again for any help

This post has been edited by bronco2680: 17 April 2008 - 02:00 PM

Was This Post Helpful? 0
  • +
  • -

#4 bronco2680  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-April 08

Re: Assembly help needed for small class assignemtn!

Posted 17 April 2008 - 03:04 PM

i am using a software called pep/8
Was This Post Helpful? 0
  • +
  • -

#5 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: Assembly help needed for small class assignemtn!

Posted 18 April 2008 - 05:59 AM

Im sorry but i don't know anything about Pep/8. I googled it and it has to do with Python?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1