1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

hexadecimal to decimal ->beginner needs help

Discussion in 'Assembly Language Programming (ALP) Forum' started by wampsi, Dec 11, 2006.

  1. wampsi

    wampsi New Member

    Joined:
    Dec 11, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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 :)
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    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.
     
  3. wampsi

    wampsi New Member

    Joined:
    Dec 11, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Thank you :)
     
  4. capot

    capot New Member

    Joined:
    Apr 9, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  5. capot

    capot New Member

    Joined:
    Apr 9, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    pls help with the code to convert hex to dec in MIPS. my email address is bolods@gmail.com
     

Share This Page