News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Small tool in ML64 complete with source.

Started by hutch--, August 23, 2016, 08:03:25 PM

Previous topic - Next topic

hutch--

The tools in the MASM32 SDK have an item called "tview.exe". The attached file is a 64 bit version with the same task, a bare edit window that will load a file on the command line. It is a results viewer that has 2 keys, F1 to copy the results and the ESC key to close it. It is a little bigger than the 32 bit version but it has a manifest, version control block and the first monochrome icon I have ever made and it comes in at 8.5k (8704 bytes).
\
So far I am reasonably pleased with the prologue/epilogue code and the function call automation with "invoke". It can be used close enough to how its was used in Win32 code with only minor differences in notation, the need for "\" for split lines and the more obvious difference, no prototypes or error checking.

If you have got the later build environment that I posted recently, this tiny app should build OK.

sinsi

QuoteIt is a little bigger than the 32 bit version
Don't get too dazzled by always using a 64-bit register, plenty of parameters can be passed via ECX et al if it's a dword.


29 D2                                               sub     edx, edx
48 29 D2                                            sub     rdx, rdx

BA 00 00 00 00                                      mov     edx, 0
48 C7 C2 00 00 00 00                                mov     rdx, 0


All those extra bytes add up...
Tá fuinneoga a haon déag níos fearr :biggrin:

hutch--

You mean like this ?

.text:000000014000140c 488B4D10                   mov rcx, qword ptr [rbp+0x10]
.text:0000000140001410 488D55B0                   lea rdx, [rbp-0x50]
.text:0000000140001414 FF150A140000               call qword ptr [GetClientRect]
.text:000000014000141a 488B0D5F160000             mov rcx, qword ptr [0x140002a80]
.text:0000000140001421 48C7C200000000             mov rdx, 0x0
.text:0000000140001428 49C7C000000000             mov r8, 0x0
.text:000000014000142f 448B4DB8                   mov r9d, dword ptr [rbp-0x48]
.text:0000000140001433 8B45BC                     mov eax, dword ptr [rbp-0x44]
.text:0000000140001436 89442420                   mov dword ptr [rsp+0x20], eax
.text:000000014000143a 48C744242801000000         mov qword ptr [rsp+0x28], 0x1
.text:0000000140001443 FF15E3130000               call qword ptr [MoveWindow]

The invoke style macro does it automatically, IE puts the right size data in the right place. I know what you are after but I see size optimisation through register size as pointless as the savings are small. The target I am after with Win64 is /LARGEADDRESSAWARE type applications where Win64 has a large advantage. For size optimisation Win32 does it better.

sinsi

#3
My Windows 10 doesn't like your icon. Started off normal, now has changed to two different icons (funny, the current icon is for "Windows 10 Upgrade Assistant").
Probably an icon cache problem - you would think that they corrected this, since it occurred in WINDOWS 98.

Anyway, leave ML64 to us purist fossils, use your newfangled (h)jwasm  :P
Invoke? Pah!
Tá fuinneoga a haon déag níos fearr :biggrin:

hutch--

 :biggrin:

But we ARE purists using a MACRO assembler. There are still a few minor optimisations to do with the "invoke" style code, test if the value is zero and use XOR or SUB and in the first 4 args, if a reg is copied onto itself it can be left out. At least there is no native invoke, the macro is called "procedure_call" and invoke is only a wrapper for it. The icon works OK on my Win 10 Professional but there are other PHUKUPS with the icons on my start menu, my TightVNC is getting the Axialis Icon Workshop icon instead.