I'm working on a program in assembly (in Easy68K) that prompts a user to enter a memory address. The program then converts each of those ASCII chars into their hex equivalents. I can convert the hex just fine, but I'm running into a problem.
If the user enters A234567F, this is stored (in A1) as 8 bytes, but the valid memory address hex equivalent is only 4 bytes (2 words, 1 longword). I can iterate through each character and convert it to its hex-digit equivalent, no problem. But I can't figure out how to "concatenate" them together, so to speak.
I don't want there to be a separate byte of storage for "A" and a separate byte of storage for "2". I want "A2" to be stored in the same byte of storage.
And so, in this example, what I'd like is for the storage to look like this for this example:
Memory address $00000000
should hold the value $A2
.
$00000001
holds $34
$00000002
holds $56
$00000003
holds $7F
Then, if I do a MOVE.L
starting from address $00000000
into D1, then D1 would contain the value $A234567F
.
How can I do this?