Browse Source

Updated comments, Makefile and REAMDE.txt

Yann Weber 5 years ago
parent
commit
9e8417b7fb
3 changed files with 42 additions and 16 deletions
  1. 10
    2
      Makefile
  2. 16
    9
      README.txt
  3. 16
    5
      wtfstopw.asm

+ 10
- 2
Makefile View File

1
+NASM=nasm
2
+ASFLAGS=-felf64
3
+LDFLAGS=-s -melf_x86_64
4
+
5
+# To build with debugging symbols
6
+#ASFLAGS=-felf64 -F dwarf -g
7
+#LDFLAGS=-melf_x86_64
8
+
1
 all: wtfstopw
9
 all: wtfstopw
2
 
10
 
3
 wtfstopw: wtfstopw.o
11
 wtfstopw: wtfstopw.o
4
-	ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
12
+	ld $(LDFLAGS) wtfstopw.o -o wtfstopw
5
 wtfstopw.o: wtfstopw.asm
13
 wtfstopw.o: wtfstopw.asm
6
-	nasm -felf64 wtfstopw.asm
14
+	$(NASM) $(ASFLAGS) wtfstopw.asm
7
 	
15
 	
8
 .PHONY: clean
16
 .PHONY: clean
9
 
17
 

+ 16
- 9
README.txt View File

3
 
3
 
4
 Build :
4
 Build :
5
 -------
5
 -------
6
-
7
-make
8
-
6
+	make
9
 or
7
 or
10
-
11
-nasm -felf64 wtfstopw.asm && ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
8
+	nasm -felf64 wtfstopw.asm
9
+	ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
12
 
10
 
13
 Usage :
11
 Usage :
14
 -------
12
 -------
15
-./wtfstopw
13
+	./wtfstopw [-h] [-r NDIGITS]
14
+Options :
15
+---------
16
+	-h print an help message and exit
17
+	-r number of digits bellow seconds to display, default is 2
16
 
18
 
17
 Interactions :
19
 Interactions :
18
 --------------
20
 --------------
19
-- press enter to exit or close stdin
20
-- send SIGINT (with kill -2 or ctrl + c) for new lap on stdout
21
-- elapsed time is sent on stderr and laps infos on stdout
21
+	press enter to exit or close stdin
22
+	send SIGINT (with kill -2 or ctrl + c) for new lap on stdout
23
+	elapsed time is sent on stderr and laps infos on stdout
24
+
22
 
25
 
26
+Build with debugging symbols :
27
+------------------------------
28
+	nasm -g -F dwarf -felf64 -l wtfstopw.lst wtfstopw.asm
29
+	ld -melf_x86_64 wtfstopw.o -o wtfstopw

+ 16
- 5
wtfstopw.asm View File

17
 ;
17
 ;
18
 ; A simple precise stopwatch
18
 ; A simple precise stopwatch
19
 ; Build : nasm -felf64 wtfstopw.asm && ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
19
 ; Build : nasm -felf64 wtfstopw.asm && ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
20
-; Build Debug : nasm -felf64 -l wtfstopw.lst wtfstopw.asm && ld -melf_x86_64 wtfstopw.o -o wtfstopw
21
-;
22
-; Usage : ./wtfstopw
23
-;	press enter to exit
24
-;	send SIGINT (with kill -2 or ctrl + c) for new lap on stdout
20
+; Build Debug : nasm -g -F dwarf -felf64 -l wtfstopw.lst wtfstopw.asm && ld -melf_x86_64 wtfstopw.o -o wtfstopw
25
 ;
21
 ;
22
+; ./wtfstopw [-h] [-r NDIGITS]
23
+; Options :
24
+; 	-h print this help and exit
25
+; 	-r number of digits bellow seconds to display, default is 2
26
+; Interact :
27
+; 	press enter to exit
28
+; 	send SIGINT (with kill -2 ir ctrl + c) for a new lap
29
+
30
+
26
 
31
 
27
 [bits 64]
32
 [bits 64]
28
 
33
 
81
 		db 0x9, "-h print this help and exit", 0xA
86
 		db 0x9, "-h print this help and exit", 0xA
82
 		db 0x9, "-r Number of digits bellow seconds, between [1..8]"
87
 		db 0x9, "-r Number of digits bellow seconds, between [1..8]"
83
 		db 0xA
88
 		db 0xA
89
+		db "Interactions :", 0xA
90
+		db 0x9, "Press enter or close stdin to exit", 0xA
91
+		db 0x9, "Send SIGINT (with kill -2 or ctrl + c) for a new lap"
92
+		db 0xA
93
+		db 0x9, "Elapsed time is sent on stderr and laps infos on stdout"
94
+		db 0xA
84
 	usage_postlen: equ $ - usage_post
95
 	usage_postlen: equ $ - usage_post
85
 
96
 
86
 	badarg_msg: db "Unexpected argument : "
97
 	badarg_msg: db "Unexpected argument : "

Loading…
Cancel
Save