summaryrefslogtreecommitdiff
path: root/5/seat_id.asm
blob: 562dec4c7420d5778429f2ea1b9fb3ad86fd6791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
global seat_id

section .data

section .text

seat_id:
    xor     eax, eax            ; set up return value
    cmp     BYTE [rdi], 66      ; B
    sete    al
    shl     eax, 1
    xor     ecx, ecx
    cmp     BYTE [rdi + 1], 66
    sete    cl
    or      eax, ecx
    shl     eax, 1
    cmp     BYTE [rdi + 2], 66
    sete    cl
    or      eax, ecx
    shl     eax, 1
    cmp     BYTE [rdi + 3], 66
    sete    cl
    or      eax, ecx
    shl     eax, 1
    cmp     BYTE [rdi + 4], 66
    sete    cl
    or      eax, ecx
    shl     eax, 1
    cmp     BYTE [rdi + 5], 66
    sete    cl
    or      eax, ecx
    shl     eax, 1
    cmp     BYTE [rdi + 6], 66
    sete    cl
    or      eax, ecx
    shl     eax, 1
    cmp     BYTE [rdi + 7], 82  ; R
    sete    cl
    or      eax, ecx
    shl     eax, 1
    cmp     BYTE [rdi + 8], 82
    sete    cl
    or      eax, ecx
    shl     eax, 1
    cmp     BYTE [rdi + 9], 82
    sete    cl
    or      eax, ecx
    ret