-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdesktop.S
64 lines (47 loc) · 928 Bytes
/
desktop.S
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
desktop_label: .ascii "Desktop "
print_desktop:
mov rsi, offset desktop_symbol
mov rcx, 5
call print
mov rsi, offset accent1
mov rcx, 5
call print
mov rsi, offset desktop_label
mov rcx, 10
call print
mov rsi, offset separator_symbol
mov rcx, 8
call print
mov rcx, desktop_length
test rcx, rcx
je print_unknown_desktop
mov rsi, offset desktop
jmp print_known_desktop
print_unknown_desktop:
mov rsi, offset unknown_label
mov rcx, 7
print_known_desktop:
call print
mov rax, session_length
test rax, rax
jne check_session
mov byte ptr [print_buf + r10], '\n'
inc r10
ret
check_session:
mov rsi, offset open_paren_label
mov rcx, 2
call print
mov bl, [session]
cmp bl, 't'
je print_session
sub bl, 32
print_session:
mov [session], bl
mov rsi, offset session
mov rcx, session_length
call print
mov rsi, offset close_paren_label
mov rcx, 2
call print
ret