Bladeren bron

Updated comments, Makefile and REAMDE.txt

Yann Weber 6 jaren geleden
bovenliggende
commit
9e8417b7fb
3 gewijzigde bestanden met toevoegingen van 42 en 16 verwijderingen
  1. 10
    2
      Makefile
  2. 16
    9
      README.txt
  3. 16
    5
      wtfstopw.asm

+ 10
- 2
Makefile Bestand weergeven

@@ -1,9 +1,17 @@
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 9
 all: wtfstopw
2 10
 
3 11
 wtfstopw: wtfstopw.o
4
-	ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
12
+	ld $(LDFLAGS) wtfstopw.o -o wtfstopw
5 13
 wtfstopw.o: wtfstopw.asm
6
-	nasm -felf64 wtfstopw.asm
14
+	$(NASM) $(ASFLAGS) wtfstopw.asm
7 15
 	
8 16
 .PHONY: clean
9 17
 

+ 16
- 9
README.txt Bestand weergeven

@@ -3,20 +3,27 @@ WTFStopW : a simple stopwatch
3 3
 
4 4
 Build :
5 5
 -------
6
-
7
-make
8
-
6
+	make
9 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 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 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 Bestand weergeven

@@ -17,12 +17,17 @@
17 17
 ;
18 18
 ; A simple precise stopwatch
19 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 32
 [bits 64]
28 33
 
@@ -81,6 +86,12 @@ section .data
81 86
 		db 0x9, "-h print this help and exit", 0xA
82 87
 		db 0x9, "-r Number of digits bellow seconds, between [1..8]"
83 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 95
 	usage_postlen: equ $ - usage_post
85 96
 
86 97
 	badarg_msg: db "Unexpected argument : "

Loading…
Annuleren
Opslaan