Browse Source

Reducing nop in allignement

Yann Weber 5 years ago
parent
commit
5929efa54b
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      wtfstopw.asm

+ 5
- 4
wtfstopw.asm View File

289
 	mov rsi, ts_start.tv_sec
289
 	mov rsi, ts_start.tv_sec
290
 %define RSIPTR(x) rsi + x - ts_start.tv_sec
290
 %define RSIPTR(x) rsi + x - ts_start.tv_sec
291
 
291
 
292
-	mov rax, [ts_cur.tv_nsec] ; allign procpt_loopns
293
-	sub rax, [ts_start.tv_nsec] ; allign procpt_loopns
292
+	mov rax, [RSIPTR(ts_cur.tv_nsec)]
293
+	sub rax, [ts_start.tv_nsec] ; allign nano sec loop
294
 	jge print_time_us_cont
294
 	jge print_time_us_cont
295
 	add rax, 1000000000 ; negativ result
295
 	add rax, 1000000000 ; negativ result
296
 	sub qword [RSIPTR(ts_cur.tv_sec)], 1
296
 	sub qword [RSIPTR(ts_cur.tv_sec)], 1
331
 	div rdi
331
 	div rdi
332
 	mov bl, dl
332
 	mov bl, dl
333
 	or bx, 0x3030
333
 	or bx, 0x3030
334
-	mov word [RSIPTR(timestr + 4)], bx
334
+	mov word [timestr + 4], bx
335
 
335
 
336
 	xor dl, dl
336
 	xor dl, dl
337
 	div rcx
337
 	div rcx
340
 	div rdi
340
 	div rdi
341
 	mov bl, dl
341
 	mov bl, dl
342
 	or bx, 0x3030
342
 	or bx, 0x3030
343
-	mov word [RSIPTR(timestr + 1)], bx
343
+	mov word [timestr + 1], bx
344
 
344
 
345
 	; using rbx to stores the hours string
345
 	; using rbx to stores the hours string
346
 	xor rbx, rbx
346
 	xor rbx, rbx
361
 	cmovl ax, cx ; rax stores hours digit count (at least 2)
361
 	cmovl ax, cx ; rax stores hours digit count (at least 2)
362
 	test cl, cl
362
 	test cl, cl
363
 	jz procpt_looph2_end
363
 	jz procpt_looph2_end
364
+	align 16
364
 	procpt_looph2: ; end rbx left shift before sto
365
 	procpt_looph2: ; end rbx left shift before sto
365
 		shl rbx, 8
366
 		shl rbx, 8
366
 		loopne procpt_looph2
367
 		loopne procpt_looph2

Loading…
Cancel
Save