Integer variables are stored as binary numbers. The numbers in the registers are also binary numbers. They are displayed in hexadecimal for easier user interaction. To store the register to memory just do

Code:

MOVE.size Rn,memory

where:size is one of B, W or L. The default is W if no size is specified.Rn is the register.memory is the label or address of the variable.

Thank you profKelly, but I need to keep a running total of the numbers in their integer form, for example the first time the program loops the hexadecimal value 'C' will be stored in register d7, I want to store this value to a variable called 'Total' as integer 12. Then when the programme loops again the next value will be 6, I then want it to add 12+6 = 18, but when I do it using the hexadecimal numbers stored in the registers I get my answer in hexadecimal.

12 in binary is 1100, so is it that I use the multiplication function to convert this to decimal, since that is the form in which they are stored in memory? and if so, how exactly do I do that?

You are right, I was over thinking it, all I needed to do was use trap task 3, and wa- la, the number is displayed as an integer. But I used move, instead of move.b, so that is why I was getting the wrong value for the addition result. I picked up on the error after viewing a few samples on here. Thanks for all the assistance

Who is online

Users browsing this forum: Bing [Bot] and 6 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum