|
@@ -82,9 +82,11 @@ section .data
|
82
|
82
|
startmsglen: equ $ - startmsg
|
83
|
83
|
|
84
|
84
|
hours: db "000000000"
|
85
|
|
- timestr: db ":00:00.0000 ", 0x0a
|
|
85
|
+ timestr: db ":00:00.0 ", 0x0a
|
86
|
86
|
timestrlen: equ $ - timestr
|
87
|
87
|
|
|
88
|
+ time_res: dq 3 ; 3 digits bellow seconds
|
|
89
|
+
|
88
|
90
|
nl: db 0x0A
|
89
|
91
|
buf: db 0
|
90
|
92
|
|
|
@@ -254,13 +256,28 @@ proc_print_time:
|
254
|
256
|
sub rbx, 1
|
255
|
257
|
mov [ts_cur.tv_sec], rbx
|
256
|
258
|
print_time_us_cont:
|
|
259
|
+
|
|
260
|
+ ; Divide result given time_res
|
|
261
|
+ mov r10, rax
|
|
262
|
+ mov rax, 1000000000
|
|
263
|
+ mov r9, [time_res]
|
|
264
|
+ mov r8, 10
|
|
265
|
+ xor rdx, rdx
|
|
266
|
+ print_time_respow:
|
|
267
|
+ div r8
|
|
268
|
+ sub r9, 1
|
|
269
|
+ cmp r9, 0
|
|
270
|
+ jg print_time_respow
|
|
271
|
+ mov rcx, rax
|
|
272
|
+ mov rax, r10
|
257
|
273
|
xor rdx, rdx
|
258
|
|
- mov rcx, 100000
|
259
|
274
|
div rcx
|
|
275
|
+
|
260
|
276
|
; set the us char in timestr
|
261
|
277
|
mov r8, timestr
|
262
|
|
- add r8, 10 ; r8 points on last char before \r
|
263
|
|
- mov r9, 4 ; r9 count the number of digits
|
|
278
|
+ mov r9, [time_res] ; r9 count the number of digits
|
|
279
|
+ add r8, 6 ; first digits after seconds
|
|
280
|
+ add r8, r9 ; r8 points on last char before \r
|
264
|
281
|
print_time_us_loop:
|
265
|
282
|
xor rdx, rdx
|
266
|
283
|
mov rcx, 10
|