The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => RadAsm Support Forum => Topic started by: shlomok on April 30, 2012, 03:36:35 PM

Title: Code formatting or a beautifier?
Post by: shlomok on April 30, 2012, 03:36:35 PM
Is there a code formatting utility or a code beautifier for RadASM?


I want to enforce the same rules for multiple projects and programmers.
e.g force 2 tabs, automatically indent .IF statements etc.

Thanks,

S. 
Title: Re: Code formatting or a beautifier?
Post by: dedndave on April 30, 2012, 07:08:28 PM
you mean - you haven't written one ???   :eek
Title: Re: Code formatting or a beautifier?
Post by: JD on April 30, 2012, 11:47:24 PM
Not that I know of, but there's some handy items in the block menu for indenting and so on.
Title: Re: Code formatting or a beautifier?
Post by: shlomok on May 01, 2012, 04:36:00 AM
Quote from: JD on April 30, 2012, 11:47:24 PM
Not that I know of, but there's some handy items in the block menu for indenting and so on.
:U

I shall start writing a beautifier, once I finish debugging this:
(I get negative values for all 3 printouts)

getCurrentDateAndTime PROC

LOCAL systemTime :LARGE_INTEGER
LOCAL localTime :LARGE_INTEGER
LOCAL nowTF :TIME_FIELDS
LOCAL finelTime :ULONG

invoke DbgPrint,$CTA0("getCurrentDateAndTime ...\n")

;The KeQuerySystemTime routine obtains the current system time.
;(System time is a count of 100-nanosecond intervals since January 1, 1601)
invoke KeQuerySystemTime, addr systemTime
invoke DbgPrint,$CTA0("KeQuerySystemTime: %d\n"), addr systemTime

;The ExSystemTimeToLocalTime routine converts a GMT system time value
;to the LOCAL system time for the current time zone.

;SystemTime [in]
    ;A pointer to a variable set to the unbiased, GMT system time.
;LocalTime [out]
    ;A pointer to the returned value for the current locale.
invoke ExSystemTimeToLocalTime, addr systemTime, addr localTime
invoke RtlTimeToTimeFields ,addr localTime,addr nowTF
invoke DbgPrint,$CTA0("ExSystemTimeToLocalTime: %d\n"), addr localTime
ret

getCurrentDateAndTime endp



:bdg
S.
Title: Re: Code formatting or a beautifier?
Post by: dedndave on May 01, 2012, 04:59:21 AM
not sure if bit 63 should be set or not   :P
i didn't feel like calculating - lol

but - it comes out negative because you are displaying it as a signed value
display it as an unsigned value - or in hex - it may make more sense to you
and - of course, it is a 64-bit unsigned value
Title: Re: Code formatting or a beautifier?
Post by: shlomok on May 01, 2012, 09:17:27 PM
Quote from: dedndave on May 01, 2012, 04:59:21 AM
not sure if bit 63 should be set or not   :P
i didn't feel like calculating - lol

but - it comes out negative because you are displaying it as a signed value
display it as an unsigned value - or in hex - it may make more sense to you
and - of course, it is a 64-bit unsigned value

Hi thanks :)


invoke ExSystemTimeToLocalTime, addr systemTime, addr localTime
invoke RtlTimeToTimeFields ,addr localTime,addr nowTF

    movzx eax, nowTF.Day
    movzx ecx, nowTF.Month
    movzx edx, nowTF.Year
    invoke DbgPrint, $CTA0("Date is %d.%02d.%04d\n"), eax, ecx, edx
   
    movzx eax, nowTF.Hour
    movzx ebx, nowTF.Minute
    movzx ecx, nowTF.Second
    movzx edx, nowTF.Milliseconds
    invoke DbgPrint, $CTA0("Time is %d.%02d.%02d.%04d\n"), eax, ebx, ecx, edx


The date works fine, the time crashes, still debugging.