-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support packing ints into 0.6 packets
- Loading branch information
1 parent
7453b29
commit 6f571b3
Showing
4 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
; abstraction layer for supporting both 0.6 and 0.7 at the same time | ||
; basically a bunch of getters that give the right values | ||
; depending on the current version | ||
|
||
get_recv_buf: | ||
; returns into rax either `udp_recv_buf` or `udp_recv6_buf` | ||
; depending on the current connection version | ||
mov al, byte [connection_version] | ||
cmp al, 7 | ||
je .version7 | ||
.version6: | ||
mov rax, udp_recv6_buf | ||
jmp .end | ||
.version7: | ||
mov rax, udp_recv_buf | ||
.end: | ||
ret | ||
|
||
get_packet_header_len: | ||
; returns into rax the packet header length | ||
; which is 3 for 0.6 and 7 for 0.7 | ||
; | ||
push r8 | ||
mov r8d, PACKET_HEADER_LEN | ||
mov al, byte [connection_version] | ||
cmp al, 7 | ||
je .version7 | ||
mov r8d, PACKET6_HEADER_LEN | ||
.version7: | ||
._: ; clear label for debugger | ||
mov rax, r8 | ||
pop r8 | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters