Hi, Experts. For learning purposes, I'm writein a small program in Delphi that convert numbers and strings from/To Binary and Hexadecimal format. Actually, I wrote two section: the first one convert decimal numbers and strings to binary, the other one converts numbers and strings to hexadecimal format. To call the right function I set a flag: when the user click 'Convert' button, the program check if user typed only numbers or even letters: in the first case, program will treat the input as a decimal number in the second one program will treat input as a string. Setting the flag accordingly, the program knows how reconvert data to its original format.
Hoping to have been clear, I tell the problem: I'm now trying to write the third section, to convert data between binary and hexadecimal format and the problem is: how to understand if data in hexadecimal format are a number or a literal string? I could leave this problem to my hipothetical user, giving it the responsability to check a radio button to tell the program what the input is, but... this is trivial. I think that computers know how to distinguish an hexadecimal string from an hexadecimal number but how they do? What does the trick so the software itself can understand if it has to display a string or a number reading a hexadecimal value?
I know this could seem stupid, but I'm trying to learn Assembly and I understood that one must deeply understand this type of logic to learn - or so I feel...
Thanks to everyone will try to help me.