0

i can't understand how can i read the down arrow input in assembly. I need this input to pass to the next string.

i checked the register ebx and ecx and inside of them there are different values. i tried to initialize a string that contains ^[[B the char that appear when you press down arrow key but when i pres it and then enter , the process go in the lable "sbaglio" it send write "check_olio" and the content of var a that is the new line code.

.section .bss .lcomm a 256 .section .data Freccia_giu: .string "^[[B" Freccia_giu_len: .long . - Freccia_giu _start: # write the first string movl $4, %eax movl $1 ,%ebx movl $Menu, %ecx mov Menu_len, %edx int $0x80 # interupt call to save the down arrow in a rileva_freccia: # get down arrow movl $3, %eax movl $0 ,%ebx movl $a, %ecx movl $255, %edx int $0x80 movb $0, (%ecx, %eax, 1) # verifiy down arrow movl $a, %ecx movl $Freccia_giu ,%ebx cmp %ebx ,%ecx jne sbaglio je fine #non equity lable sbaglio: movl $4, %eax movl $1 ,%ebx movl $Check_Olio, %ecx mov Check_Olio_len, %edx int $0x80 movl $4, %eax movl $1 ,%ebx movl $a, %ecx mov $256, %edx int $0x80 fine: movl $4, %eax movl $1 ,%ebx movl $Setting_Automobile, %ecx mov Setting_Automobile_len, %edx int $0x80 
3
  • 2
    ^[ means escape, in assembly you should try writing that as \033[B. Note that unless you change terminal buffering, you will need to press enter. Commented Jun 6, 2023 at 11:25
  • What operating system are you programming for? Commented Jun 6, 2023 at 13:21
  • 1
    Are you sure you are also comparing the strings? (I think with the cmp register instruction, you are comparing the address instead...) Commented Jun 6, 2023 at 17:17

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.