Quotemov esi, OFFSET input_buffer ; get address of line
; and [esi], 05fh ; this instruction is invalid--doesn't work
; jmp next1
mov al, [esi] ; get a char--these three get the job done
and al, 05fh ; force to uppercase if it isn't
mov [esi], al ; return adjusted character
next1:
I guess one can't homogenize a memory byte the first way above.
Quote from: deeR44 on September 03, 2022, 02:32:38 PM
I guess one can't homogenize a memory byte the first way above.
This will definitely work:
mov esi, OFFSET input_buffer ; get address of line
and BYTE PTR [esi], 05fh ; this instruction is valid--will work
assuming it's a byte you want to bite. You can also do a word or dword if you like.
Your statement was ambiguous, so the poor assembler couldn't figure out what you wanted to do.
You're uppercasing characters here, right?
BTW, before you indiscriminately AND everything with 5Fh, you might want to check to see if the character is in the range "a ... z".
Thank you NoCforMe!
I don't think that this is the first assembler that I've come across that's smarter than I am.
Ackshooly, the problem is that it's dumber than you are. Can't read our minds, yet.
(I'm still waiting for the mythical DWIM program: Do What I Mean.)
David,
You would have to be a MAC user to wish for that. :tongue:
Heh; yeah, they're the ones who can't wait for the cerebral-cortex implant interface. Apple fanbois (and -gurls).