
Patrick B. answered 06/23/19
Math and computer tutor/teacher
I do not see any native DOS commands that covert text to ascii...
You will either have to use a 3rd party tool or write it yourself...
In C, the utility is implemented something like this:
/* hexdump.c */
#include <stdio.h>
int main()
{
char ch='?';
do
{
ch = getchar();
printf("%x",ch);
} while (ch!=EOF);
}
====================================
compile it, link it, etc...
at the dos prompt you type
hexdump
and then press enter.
You complete the input with the EOF character control-z (control-F6)
So for example:
> hexdump
abcdef ^z
the output is 414243444536ffffff
Note that the EOF character is technically part of the input, so it gets represented by fffffff
Now, you can hexdump a file by redirecting the input.
For example
> type test.dat
abcdef
> hexdump < test.dat
414243444546fffff