obviously hex has 16 values, 0 - 15, a - f = 10 through 15, i'm sure you konw that much. now, the way it goes to a number is like so

you have your number, lets take 'ab'

a, being the first digit gets multiplied by 16, and b is added on.

There you have your number

You will need your operating system's system call numbers to look at to get input and output. You could instead use the C library on your computer to use functions like printf and scanf (although i'm not sure if your lecturers will allow that)

I would add that if you needed a more general version of this - one that could handle values that weren't a fixed size - it would probably be easier and more efficient to convert the hex string to a binary integer, and then back to a decimal string, than to write a function specifically for converting hex string to a decimal string - especially since you would need an ASCII to binary integer and binary to ASCII routines anyway, and it's fairly easy to write ones that will handle all bases from 2 to 36.

The general algorithm for converting from binary to a printable ASCII or UNICODE string in a given base is (in Python):

While this is a recursive algorithm, it is fairly easy to convert it to interation by pushing the resulting digits on the stack and looping, then popping them off when it is done; in assembly language, it amounts to about the same thing either way, really.

The string-to-binary algorithm is more or less the same as the one which LP gave (again, in Python):