I am trying to load only the first byte in a register after data is passed into it for example if I have the following ASM code
global _start
section .data
string db "Hello", 0x00 ; string = Hello
section .text
_start:
mov eax, string ; move "Hello" into eax (just to store it for now)
this is where I am stuck, I want to ONLY store "H" into eax, so for instance if I moved "H" into EAX, then moved eax into edx so EDX = "H", I could do:
mov ebx, 1
mov ecx, edx ; This is so I can store "H" in ecx
mov edx, 12 ; 12 is longer than the string, however, I am just using this to test, as it should only output "H", rather than anything else, the reason for this is later I want to use "H" in a cmp statement
int 0x80 ; execute the system call
Now I have also tried using al, ex: mov [edx], al after moving string into eax, but this still outputs the full string, if a working example can be provided for this, that would be greatly appreciated