Assembler Language Subroutine

I'm trying to think of a way to make an OutDecimal subroutine in assembler language, where given a 16 bit integer, the routine prints a string which represents the number. Any idea's on how to start?

I'm thinking modulus arithmetic and possibly division in order to separate the 16 bit binary number into 4 4bit numbers. Just a thought though...

Any help would be great, thanks!

p.s. I'm using a basic simulator with limited instructions, so pseudo code or explanations would help more than code, thanks.