Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,113 of 4,675    |
|    Richmond to All    |
|    sys_read from stdin    |
|    28 Nov 17 15:21:35    |
      From: p1299721@nospicedham.protonmail.com              I am trying to read a key from the keyboard. I have switched off       canonical mode so it doesn't wait for the return key. But it does not       seem to pick up the key in AX.              GCHAR: push rax        push rbx        push rcx        push rdx        mov rsi, charbuffer ; buffer = address to store the bytes read        mov rcx,rsi        mov rdx, 0x4 ; number of bytes to read        (setting this to 1 makes no difference)        mov rax, 0x3 ; number for sys_read        mov rbx, 0x2 ; From stdin        int 0x80        MSPRINT "Byte read is "        MOV AX,[charbuffer]        CALL PWORD        pop rdx        pop rcx        pop rbx        pop rax        RET              The output is always:              Byte read is 0020              ...regardless of which key I press.              I have tested that PWORD works.              What is wrong?              --       ~              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca