Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   hexadecimal to decimal ->beginner needs help (http://www.go4expert.com/forums/hexadecimal-decimal-beginner-help-t2203/)

wampsi 11Dec2006 17:38

hexadecimal to decimal ->beginner needs help
 
Hello, i'm new to this forum. I have an assignment to do:
to convert an hexadecimal numbers to decimal numbers. I have the program, but i'm trying to understand it.
There's some parts of code i don;t understand and i can't find in the net what does it mean.

Code:

.data                        ;data segment

    row1 db 'Insert hexademical number: $'
    row2 db 13,10,'demical number: $'
   
    number db 5, 0, 5 dup (0) ; 4 numbers (like FFFF) + ENTER symbol 13

.code


Could you tell me how to understand
db 5, 0, 5 dup (0) and
db 13,10


I'm totally new in ALP, so i would be very grateful if anyone could help me :)

DaWei 12Dec2006 03:53

Re: hexadecimal to decimal ->beginner needs help
 
db means 'define bytes'. It's a method of labeling a memory area and ititializing its contents. dup means to repeat the following definition the indicated number of times. db 13, 10 defines the ASCII values for a carriage return (CR) and a line feed (LF). This is a common line ending from the days of teletype machines. Some modern systems use line feed only (called a newline), some use a carriage return only, and some still use both. You can't possibly hope to mess around with assembly language without some documentation. Invest some time reading it.

wampsi 12Dec2006 17:20

Re: hexadecimal to decimal ->beginner needs help
 
Thank you :)

capot 9Apr2010 21:49

Re: hexadecimal to decimal ->beginner needs help
 
hi, i just joined this forum. i have an assignment to convert hex to dec in mips. i have to take a programming class before i graduate. could i have a copy of your program. you'll be doing me a huge favor.

capot 12Apr2010 22:19

Re: hexadecimal to decimal ->beginner needs help
 
pls help with the code to convert hex to dec in MIPS. my email address is bolods@gmail.com


All times are GMT +5.5. The time now is 04:37.