Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,399 Programmers. There are 1,482 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Assembly help needed for small class assignemtn!

 
Reply to this topicStart new topic

Assembly help needed for small class assignemtn!, Assembly help needed for small class assignemtn!!

bronco2680
post 17 Apr, 2008 - 09:34 AM
Post #1


New D.I.C Head

*
Joined: 17 Apr, 2008
Posts: 3



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
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


jjsaw5
post 17 Apr, 2008 - 10:38 AM
Post #2


D.I.C Addict

Group Icon
Joined: 4 Jan, 2008
Posts: 541

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.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

bronco2680
post 17 Apr, 2008 - 01:41 PM
Post #3


New D.I.C Head

*
Joined: 17 Apr, 2008
Posts: 3

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 Apr, 2008 - 02:00 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

bronco2680
post 17 Apr, 2008 - 03:04 PM
Post #4


New D.I.C Head

*
Joined: 17 Apr, 2008
Posts: 3

i am using a software called pep/8
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

jjsaw5
post 18 Apr, 2008 - 05:59 AM
Post #5


D.I.C Addict

Group Icon
Joined: 4 Jan, 2008
Posts: 541

Im sorry but i don't know anything about Pep/8. I googled it and it has to do with Python?

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 06:21AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month