Updated comments, Makefile and REAMDE.txt

This commit is contained in:
Yann Weber 2018-09-08 13:59:47 +02:00
commit 9e8417b7fb
3 changed files with 42 additions and 16 deletions

View file

@ -1,9 +1,17 @@
NASM=nasm
ASFLAGS=-felf64
LDFLAGS=-s -melf_x86_64
# To build with debugging symbols
#ASFLAGS=-felf64 -F dwarf -g
#LDFLAGS=-melf_x86_64
all: wtfstopw
wtfstopw: wtfstopw.o
ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
ld $(LDFLAGS) wtfstopw.o -o wtfstopw
wtfstopw.o: wtfstopw.asm
nasm -felf64 wtfstopw.asm
$(NASM) $(ASFLAGS) wtfstopw.asm
.PHONY: clean

View file

@ -3,20 +3,27 @@ WTFStopW : a simple stopwatch
Build :
-------
make
make
or
nasm -felf64 wtfstopw.asm && ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
nasm -felf64 wtfstopw.asm
ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
Usage :
-------
./wtfstopw
./wtfstopw [-h] [-r NDIGITS]
Options :
---------
-h print an help message and exit
-r number of digits bellow seconds to display, default is 2
Interactions :
--------------
- press enter to exit or close stdin
- send SIGINT (with kill -2 or ctrl + c) for new lap on stdout
- elapsed time is sent on stderr and laps infos on stdout
press enter to exit or close stdin
send SIGINT (with kill -2 or ctrl + c) for new lap on stdout
elapsed time is sent on stderr and laps infos on stdout
Build with debugging symbols :
------------------------------
nasm -g -F dwarf -felf64 -l wtfstopw.lst wtfstopw.asm
ld -melf_x86_64 wtfstopw.o -o wtfstopw

View file

@ -17,12 +17,17 @@
;
; A simple precise stopwatch
; Build : nasm -felf64 wtfstopw.asm && ld -s -melf_x86_64 wtfstopw.o -o wtfstopw
; Build Debug : nasm -felf64 -l wtfstopw.lst wtfstopw.asm && ld -melf_x86_64 wtfstopw.o -o wtfstopw
;
; Usage : ./wtfstopw
; press enter to exit
; send SIGINT (with kill -2 or ctrl + c) for new lap on stdout
; Build Debug : nasm -g -F dwarf -felf64 -l wtfstopw.lst wtfstopw.asm && ld -melf_x86_64 wtfstopw.o -o wtfstopw
;
; ./wtfstopw [-h] [-r NDIGITS]
; Options :
; -h print this help and exit
; -r number of digits bellow seconds to display, default is 2
; Interact :
; press enter to exit
; send SIGINT (with kill -2 ir ctrl + c) for a new lap
[bits 64]
@ -81,6 +86,12 @@ section .data
db 0x9, "-h print this help and exit", 0xA
db 0x9, "-r Number of digits bellow seconds, between [1..8]"
db 0xA
db "Interactions :", 0xA
db 0x9, "Press enter or close stdin to exit", 0xA
db 0x9, "Send SIGINT (with kill -2 or ctrl + c) for a new lap"
db 0xA
db 0x9, "Elapsed time is sent on stderr and laps infos on stdout"
db 0xA
usage_postlen: equ $ - usage_post
badarg_msg: db "Unexpected argument : "