I recently want to make SYS_READ()
just take 1 keystroke, some people suggest using SYS_IOCTL()
to manipulate termios
flag. I already tried it but the value i expected is not what i like... this is some the code i have :
;Get current settings
Mov EAX, 54 ; SYS_ioctl
Mov EBX, 0 ; STDIN_FILENO
Mov ECX, 0x5401 ; TCGETS
Mov EDX, termios
Int 80h
;And byte [c_lflag], 0xFD ; Clear ICANON to disable canonical mode
;This have 2 varian choose uncomment if one of this doesn't work;
And dword [c_lflag], 0xFFFFFFFD ; Clear ICANON to disable canonical mode
; Write termios structure back
Mov EAX, 54 ; SYS_ioctl
Mov EBX, 0 ; STDIN_FILENO
Mov ECX, 0x5402 ; TCSETS
Mov EDX, termios
Int 80h
Mov EAX,3 ;sys_read kernel call
Mov EBX,0 ;stdin trap (standart input)
Mov ECX,Nada ;Masukkan jumlah buffer yang akan ditampung, Enter = ECX
Mov EDX,1 ;Jumlah byte yang dibaca
Int 80h ;Call Kernel
Cmp EAX,0
Je _start
Cmp ECX,0x49
Je Do_C
Cmp ECX,0x50
Je Re_D
Cmp ECX,0x51
Je Mi_E
Cmp ECX,0x52
Je Fa_F
Cmp ECX,0x53
Je Sol_G
Cmp ECX,0x54
Je La_A
Cmp ECX,0x55
Je Si_B
Cmp ECX,0x56
Je Do_C.
Jmp Error
PS: I some the code i already asked in Termios can't run, Read key input using sys_call, and for the latest code in My GitHub.
Thanks for the help...
User contributions licensed under CC BY-SA 3.0