The reason jibberish is output to the consol is because
DX is to contain the offset of a dollar-sign '$' terminated string.
mov dx, offset msg
mov ah, 0x9
int 0x21
int 0x20
msg db 'hello world$'
To print out the value contained in the registers you will
have to convert their value into the ASCII representation
of a hexadecimal/decimal/etc.. value.
To print out the value of the AX register in hex for example:
mov ax, 0x1234
call printw
int 0x20
printw:
push ax
shr ax, 8
call printb
pop ax
push ax
and ax, 0xff
call printb
pop ax
ret
printb:
push ax
shr al, 4
call printasc
pop ax
and al, 0xf
call printasc
ret
printasc:
add al, 0x30
cmp al, 0x39
jle printasc_e
add al, 0x7
printasc_e:
mov dl, al
mov ah, 0x2
int 0x21
ret