flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly 04 Mar 2010, 22:22
See SCAN CODES here: http://stanislavs.org/helppc/int_16.html
|
|||
![]() |
|
zhak 04 Mar 2010, 22:22
Fn 0 Int 0x16 returns the following values on Arrow key press:
UP: AX = 0x4800 DOWN: AX = 0x5000 RIGHT: AX = 0x4B00 LEFT: AX = 0x4D00 you can use smth like Code: .wait_key: xor ax, ax int 0x16 cmp ax, 0x5000 ;down arrow key? jz short .down cmp ax, 0x4800 ;up arrow key? jz short .up . . . cmp al, 13 ;enter key pressed? jnz short .wait_key .process: . . . enter key pressed jmp |
|||
![]() |
|
edfed 04 Mar 2010, 22:31
mov ax,3
int 33h mov [mouse.x],ecx mov [mouse.y],edx mov [status],bl ;bit 0=left bit 1=right |
|||
![]() |
|
adroit 04 Mar 2010, 22:41
Thanks guys!!
I have 2 questions (again) Zhak, why did u use a short jump? (i never understood the short jump) Edfed, why did you use 32-bit registers, instead of 16-bit? |
|||
![]() |
|
zhak 04 Mar 2010, 23:07
i use short prefix to control code size. i want my Jcc instructions to be 2-bytes long. also, sometimes i need my code to be compatible with 8086 until i perform cpu check, and that cpus don't support near jumps (4-byte opcodes)
|
|||
![]() |
|
adroit 04 Mar 2010, 23:13
Ahhh, i see. thanks.
|
|||
![]() |
|
edfed 05 Mar 2010, 06:16
because it is my personnal way to code. 16 bits is dead.
of course,x & y are not 32bits but 16bits in cx and dx |
|||
![]() |
|
adroit 05 Mar 2010, 14:01
That is sort of true, but I still prefer 16-bit coding, as I am just a beginner of assembly programming
|
|||
![]() |
|
edfed 05 Mar 2010, 14:29
32 bit is easier than 16 bit.
![]() |
|||
![]() |
|
adroit 05 Mar 2010, 22:25
ohhh...
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.