I am trying to write an assembly code to do a file hexdump, just like in Linux when you do "hexdump -C sample.txt" from the command line. I got as far as opening the file and reading the contents into a buffer, but I can't get beyond, trying to convert those bytes to hexadecimal. 
Any help would be greatly appreciated.
   _WRITE   = 4                !System call number for WRITE        
   _READ    = 3                !System call number for READ    
   _OPEN    = 5                !System call number for OPEN
   _EXIT    = 1                !System call number for EXIT
   _GETCHAR = 117                !System call number for GETCHAR
   _PUTCHAR = 122                !System call number for PUTCHAR
   _PRINTF  = 127                !System call number for PRINTF
   _SPRINTF = 121                !System call number for SPRINTF
   _SSCANF  = 125                !System call number for SSCANF
   _OPEN    = 5                !System call number for OPEN
   bufsiz  = 512                !bufsiz = 512
   .SECT .TEXT                !Start label
    start:     
    MOV BP, SP            !System trap instruction
    MOV CX, de-greet
    PUSH CX
    PUSH greet
    PUSH _PRINTF
    SYS
    ADD SP, 8
    CALL GetFileInput
    Byte2Hexadecimal:
    !Conversion needs to take place here
    Word2Hexadecimal:
      !From Word to Hexadecimal needs to take place here 
    GetFileInput:
    PUSH BP
    MOV BP,SP
    MOV DI, buf
    PUSH _GETCHAR
    next_char:SYS
    CMPB AL, '\n'
    STOSB
    JNE next_char
    JL 9f
    JE 1f
        MOVB (DI),0
        POP AX
        POP BP 
        RET
    PUSH 0
    PUSH buf
    PUSH _OPEN
    SYS
    CMP AX,0
    JL 9f
    MOV (fildes),AX
    MOV SI,linh+2
    MOV BX,0
     1: CALL fillbuf
    CMP CX, 0
    JLE 3f
     2: MOV        
      9: MOV SP,BP
     PUSH buf
     PUSH errmess
     PUSH _PRINTF
     SYS
     PUSH _EXIT
     PUSH _EXIT
     SYS     
    OpenFile:
    fillbuf:
    PUSH bufsiz
    PUSH buf
    PUSH (fildes)
    PUSH _READ
    SYS
    ADD SP,8
    MOV CX,AX
    ADD BX,CX
    MOV DI,buf
    RET
   .EXIT: 
    PUSH 0                !Return code
    PUSH _EXIT            !Return to OS
    SYS                !System trap instruction
    .SECT .DATA
    errmess:     .ASCIZ "Open %s failed\n"
    numfmt:         .ASCIZ "%d"
    greet:         .ASCIZ "Welcome to our program, please enter the file name: \n"
    de:         .BYTE 0
   .SECT .BSS
    linh: .SPACE 8192        !
    fildes: .SPACE 2        !Memory location for the fildes 
     byte1:    .SPACE 8        !Memory location for the Byte 
    addr:    .SPACE 8        !Memory location for the address
    word:   .BYTE  2          !Memory location for the byte 
    buf:     .SPACE 80        !Memory location for the BUFF
    buffer: .SPACE bufsiz+2        
 
     
     
     
     
    