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
Assembly help needed for small class assignemtn!Assembly help needed for small class assignemtn!!
Page 1 of 1
4 Replies - 1033 Views - Last Post: 18 April 2008 - 05:59 AM
Replies To: Assembly help needed for small class assignemtn!
#2
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.
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.
#3
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
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
#4
Re: Assembly help needed for small class assignemtn!
Posted 17 April 2008 - 03:04 PM
i am using a software called pep/8
#5
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?
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|