CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 29 Aug 2025 21:58:44 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20080324012829
location: https://web.archive.org/web/20080324012829/https://www.daniweb.com/code/snippet817.html
server-timing: captures_list;dur=1.554012, exclusion.robots;dur=0.025120, exclusion.robots.policy;dur=0.011832, esindex;dur=0.013191, cdx.remote;dur=15.232166, LoadShardBlock;dur=340.751670, PetaboxLoader3.datanode;dur=255.163075
x-app-server: wwwb-app211
x-ts: 302
x-tr: 389
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app211; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 29 Aug 2025 21:58:45 GMT
content-type: text/html; charset=utf-8
x-archive-orig-date: Mon, 24 Mar 2008 01:28:29 GMT
x-archive-orig-server: Apache/2.2
x-archive-orig-x-powered-by: PHP/5.1.6
x-archive-orig-set-cookie: bblastactivity=0; expires=Tue, 24-Mar-2009 01:28:29 GMT; path=/; domain=.daniweb.com
x-archive-orig-cache-control: private
x-archive-orig-pragma: private
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Mon, 24 Mar 2008 01:28:29 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 24 Mar 2008 01:28:29 GMT", ; rel="memento"; datetime="Mon, 24 Mar 2008 01:28:29 GMT", ; rel="next memento"; datetime="Wed, 09 Jul 2008 07:34:16 GMT", ; rel="last memento"; datetime="Wed, 11 Feb 2009 07:52:10 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_2_20080323181344_crawl107-c/51_2_20080324012534_crawl104.arc.gz
server-timing: captures_list;dur=0.775568, exclusion.robots;dur=0.029307, exclusion.robots.policy;dur=0.014110, esindex;dur=0.014445, cdx.remote;dur=34.109630, LoadShardBlock;dur=98.704759, PetaboxLoader3.datanode;dur=127.817839, load_resource;dur=400.730688, PetaboxLoader3.resolve;dur=313.384937
x-app-server: wwwb-app211
x-ts: 200
x-tr: 656
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
Bin2Time: Unsigned milliseconds to time format hhh:mm:ss.sss - asm
Advertisements
Bin2Time: Unsigned milliseconds to time format hhh:mm:ss.sss
•
•
•
•

What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 299,389 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,239 IT professionals currently interacting right now! If you are in the IT industry or are just a technology enthusiast, you might find just what you're looking for in DaniWeb. Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser: Modernize Legacy Data with Sybase
I use GetTickCount in a lot of my applications, so I built this snippet to convert to hours minutes and seconds. Leading extraneous data is excluded from output.
•
•
Entry ECX = Unsigned value of duration in milliseconds EDX = Pointer to ASCII output. Divisors dd 3600000, 60000, 1 HrsFmt db '%d:', 0 MinFmt db '%02d:', 0 SecFmt db '%06d', 0 Formats dd HrsFmt, MinFmt, SecFmt 0 57 push edi 1 56 push esi 2 53 push ebx ; Epilog set up for applications loop 3 52 push edx ; Preserve initial value 4 BE <-> mov esi, Divisors 9 8BFA mov edi, edx B BB <-> mov ebx, Formats 10 8BD1 mov edx, ecx 12 33C9 xor ecx, ecx 14 880F mov [edi], cl ; Nullify previous contents 16 B1 03 mov cl, 3 18 51 push ecx 19 AD lodsd ; Get next divisor 1A 8BC8 mov ecx, eax 1C 8BC2 mov eax, edx 1E 33D2 xor edx, edx 20 F7F9 idiv ecx 22 8BC8 mov ecx, eax 24 87F3 xchg ebx, esi 26 AD lodsd ; Get pointer to next format string 27 87F3 xchg ebx, esi 29 23C9 and ecx, ecx 2B 75 05 jnz 32 ; Was quotient null 2D 803F 00 cmp byte ptr [edi], 0 ; Has anything been written to output 30 74 0F je 59 Write next segment of string with applicable format 32 52 push edx 33 51 push ecx 34 50 push eax 35 57 push edi 36 E8 <-> call wsprintf ; Make this segment of string 3B 83C4 0C add esp, 0C 3E 5A pop edx 3F 03F8 add edi, eax 41 59 pop ecx 42 E2 D4 loopd 19 The last part of output always has 6 characters and positions 1 & 2 must be moved to 0 & 1 and 2 replaced with the decimal point 44 8BCF mov ecx, edi 46 2BF8 sub edi, eax 48 66:8B47 01 mov ax, [edi+1] 4C 66:AB stosw 4E C607 2E mov byte ptr [edi], 2E 51 5F pop edi 52 2BCF sub ecx, edi 54 803F 30 cmp byte ptr [edi], 30 57 75 0A jnz 63 The possibility that either hours or seconds can have a leading zero and they must be removed from output by shifting everything upward by 1 59 8BF7 mov esi, edi 5B 51 push ecx 5C 57 push edi 5D 46 inc esi 5E F3:A4 rep movsb 60 5F pop edi 61 59 pop ecx 62 49 dec ecx Epilog ECX = Number of characters in output EDX = Unchanged, pointer to ASCII string 63 8BD7 mov edx, edi 65 33C0 xor eax, eax 67 5B pop ebx 68 5E pop esi 69 5F pop edi 6A C3 ret 6B = 107 bytes
Post Comment