This morning, I re-assembled and the problem went away. I then loaded a disk image I that I took from the assemble after which I noticed the problem. I booted and the problem wasn't there.

Code: Select all
mov bx, hex
mov di, result
mov ah, al
and al, 1111b
xlatb
stosb
shr ax, 12
xlatb
stosb
Code: Select all
hex: db '0123456789ABCDEF'
result: resw 1
Since the OP doesn't realise the significance of the direction flag when using the string instructions I'm going to be generous and suppose that a random value here was the problem (and that they put the value 0x2B or 0x2b in the buffer in the first place).The OP was either trolling or thought (s)he observed something (s)he actually didn't.
Code: Select all
mov al, 0x2b
What you said was:I DO understand the importance of the direction flag when performing string instructions! What I said was that it wouldn't make a capital letter be lowercase or the other way around!
Hmm. I think you still don't appreciate the significance of the flag. If it was set to decrement then the second character wouldn't be put in the buffer so you could well get the result you describe. It depends upon what was in the buffer to start with.The direction flag shouldn't have any effect, should it?
I tested it with multiple values including 0x2B, so I should have gotten '2_' in the buffer if the direction flag was set?iansjack wrote:I think you still don't appreciate the significance of the flag. If it was set to decrement then the second character wouldn't be put in the buffer so you could well get the result you describe. It depends upon what was in the buffer to start with.
EXACTLY. THAT IS WHY I POSTED THIS THREAD. I was confused because I understand that there is no difference between 0x2B and 0x2b!iansjack wrote:As to storing the value in %al in the first place, single-stepping through that single line of code would be enough to show you that there is no difference between 0x2B and 0x2b
To me it is clear that you still do not understand my problem properly, perhaps it is my error.iansjack wrote:Anyway, that's enough from me. It's fairly clear that you are not willing to listen to advice.
Code: Select all
mov al, 0x2b
call HexToString
; Buffer was '2b'
Code: Select all
mov al, 0x2B
call HexToString
; Buffer was '2B'
Code: Select all
mov al, 0xfF
call HexToString
; Buffer was 'fF'
Code: Select all
mov al, 0xFF
call HexToString
; Buffer was 'FF'
Code: Select all
mov al, 0x19
call HexToString
; Buffer was '19'
I really don't want to flame, but I hope you learned more than that. Isolating faulty code in a functional example is one of the most important debugging techniques, and a prerequisite for asking a smart question on the 'web.phillid wrote:I've learnt some techniques from the two sample code snippets posted by other members on this thread.
Of course I learned about isolating code, I'm not going to list every single thing that I learnedSolar wrote:I really don't want to flame, but I hope you learned more than that. Isolating faulty code in a functional example is one of the most important debugging techniques, and a prerequisite for asking a smart question on the 'web.phillid wrote:I've learnt some techniques from the two sample code snippets posted by other members on this thread.
It could be that you have now isolated your fault. As the result you describe is impossible it's a possibility that you are not in fact printing the buffer at all (and, no, I don't want to see the code that you used for that).phillid wrote:iansjack wrote: To find out what the buffer was, I printed it to the screen. Is someone going to suggest that I post my function for printing to the screen on the forum?