-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha1.asm
58 lines (48 loc) · 730 Bytes
/
a1.asm
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
section .data
string1: db "Enter a character",0Ah
length1: equ $-string1
string2: db "Caps Lock is on",0Ah
length2: equ $-string2
string3: db "Caps Lock is not on",0Ah
length3: equ $-string3
section .bss
char: resb 1
section .text
global _start:
_start:
mov eax, 4
mov ebx, 1
mov ecx, string1
mov edx, length1
int 80h
mov eax, 3
mov ebx, 0
mov ecx, char
mov edx, 2
int 80h
movzx ax, byte[char]
cmp byte[char], 41h
jnb l1
jmp l3
l1:
cmp byte[char], 5Ah
jna l2
jmp l3
l2:
mov eax, 4
mov ebx, 1
mov ecx, string2
mov edx, length2
int 80h
jmp exit
l3:
mov eax, 4
mov ebx, 1
mov ecx, string3
mov edx, length3
int 80h
jmp exit
exit:
mov eax, 1
mov ebx, 0
int 80h