X86 NASM Assembly converting lower to upper and upper to lowercase characters

后端 未结 5 1464
失恋的感觉
失恋的感觉 2020-12-20 06:02

As i am pretty new to assembly, i have a few questions in regards to how i should convert from a lowercase to an uppercase if the user enters an uppercase letter or vice ver

5条回答
  •  一生所求
    2020-12-20 06:03

    Okay, but your string is not in edx, it's in [ecx] (or [In_Buffer]) (and it's only one useful character). To get a single character...

    mov al, [ecx]
    

    In a HLL you do "if some condition, execute this code". You might wonder how the CPU knows whether to execute the code or not. What we really do (HLLs do this for you) is "if NOT condition, skip over this code" (to a label). Experiment with it, you'll figure it out.

    Exit cleanly, whatever path your code takes. You don't show this, but I assume you do it.

    I just posted some info on sys_read here.

    It's for a completely different program (adding two numbers - "hex" numbers) but the part about sys_read might interest you...

提交回复
热议问题