News:

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

Main Menu

A DWORD is a DWORD is a ... oh f***!

Started by jj2007, July 28, 2016, 06:35:57 PM

Previous topic - Next topic

jj2007

Quote from: hutch-- on July 29, 2016, 08:31:27 AMkeep it simple, keep it consistent and spare yourself the complexity of endlessly chasing minor byte savings.

I agree. But there is a conflict between simplicity and the 100+ types used by the C/C++ brigade that needs to be addressed. In my tests, I could almost use Windows.inc "as is" for 64-bit builds - only 3 items need to be changed. That would make life simple, if we could double-use the main Masm32 includes...

I've just uploaded a new version, fixing minor glitches. Below the source of a windows GUI application; this is what you get in RichMasm with File/New Masm source. It builds with ML, ML64, AsmC, JWasm and HJWasm, as 32- and 64-bit code.

include \Masm32\MasmBasic\Res\JBasic.inc ; OPT_64  1 ; 0=32-bit, 1=64-bit assembly; hit F6 to build this program
.data ; initialised data section
MyWinStyle = CS_HREDRAW or CS_VREDRAW or CS_OWNDC ; see pros and cons of CS_OWNDC
wcx WNDCLASSEXA <WNDCLASSEXA, MyWinStyle, WndProc, 0, 0, 1, 2, 3, COLOR_BTNFACE+1, 0, txClass, DefSize>
txClass db "JBasicGUI", 0 ; class name, will be registered below
.data? ; uninitialised data - doesn't bloat your executable (use for handles etc)
lastMenu DefSize ?
hEdit DefSize ? ; handle to the edit control
j@start ; see j@end below
sub rsp, 8 ; v v v fall through to winmain requires this correction
WinMain proc arg
LOCAL msg:MSG, hMenu:DefSize
  ; jinvoke SetLastError, 0 ; not needed but useful for debugging
  wc equ [rbx.WNDCLASSEX] ; we use an equate for better readability
  mov rbx, offset wcx
  mov wc.hInstance, rv(GetModuleHandle, 0)
  mov wc.hIcon, rv(LoadIcon, rax, IDI_APPLICATION)
  mov wc.hIconSm, rax ; the rv macro returns results in rax
  mov wc.hCursor, rv(LoadCursor, NULL, IDC_ARROW) ; get a cursor
  jinvoke RegisterClassEx, rbx ; the window class needs to be registered
  if usedeb
Print Str$("RegClassEx: rax=%i", rax)
Print Err$()
  endif
  wsStyle=WS_OVERLAPPEDWINDOW or WS_VISIBLE or WS_CLIPCHILDREN
  mov hMenu, rv(LoadMenu, wc.hInstance, 100)
  if usedeb
Print Str$("hMenu=%i\nCreateWindowEx with name %s\n", rax, wc.lpszClassName)
  endif
  jinvoke CreateWindowEx, 0, wc.lpszClassName, Chr$("Hello World"), wsStyle, 450, 150, 300, 200, NULL, hMenu, wc.hInstance, NULL
  test rax, rax
  jne msgLoop
  jinvoke MessageBox, 0, Err$(), Chr$("CreateWindowEx failed:"), MB_OK
  jmp msgLoopEnd
msgLoop:
jinvoke GetMessage, addr msg, 0, 0, 0
inc rax
shr rax, 1
je msgLoopEnd ; if GetMessage returned 0 (exit OK) or -1 (error)
jinvoke TranslateMessage, addr msg
jinvoke DispatchMessage, addr msg
jmp msgLoop
msgLoopEnd:
  jinvoke ExitProcess, msg.wParam
WinMain endp
WndProc proc <cb> uses rsi rdi rbx hWnd:DefSize, uMsg:DefSize, wParam:WPARAM, lParam:LPARAM
LOCAL ps:PAINTSTRUCT
  usedeb=0 ; set to 1 if you want to see info on stack alignment etc; you must remove the x >>> in OxPT_Susy Console
  if usedeb
cmp uMsg, WM_MOUSEMOVE ; don't show frequent messages
je @F
cmp uMsg, WM_NCMOUSEMOVE
je @F
cmp uMsg, WM_SETCURSOR
je @F
cmp uMsg, WM_NCHITTEST
je @F
Print "Message="
PrintLine Hex$(uMsg)
@@:
  endif
  cmp uMsg, WM_CREATE
  jne not_create
reStyle=WS_VISIBLE or WS_CHILD or ES_MULTILINE or WS_VSCROLL or WS_HSCROLL or ES_AUTOHSCROLL or ES_AUTOVSCROLL or ES_NOHIDESEL
jinvoke LoadLibrary, Chr$("RichEd20") ; we add a RichEdit control
ID_EDIT=111
jinvoke CreateWindowEx, WS_EX_CLIENTEDGE, Chr$("RichEdit20A"), NULL, reStyle, 0, 0, 1, 1, hWnd, ID_EDIT, wcx.hInstance, NULL
mov hEdit, rax ; you may need this global variable for further processing
xchg rax, rbx ; use a persistent register for the handle
jinvoke SendMessage, rbx, EM_SETTARGETDEVICE, 0, 0
jinvoke SendMessage, rbx, EM_EXLIMITTEXT, 0, -1 ; no limit
if usedeb
Print Str$("Edit control handle=%i", rbx)
Print Err$()
endif
jinvoke SendMessage, rbx, WM_SETFONT, rv(GetStockObject, ANSI_FIXED_FONT), 0
jinvoke SetWindowText, rbx, Str$(Chr$("This template was built with", 13, 10, @AsmUsed$(1), " in %i-bit mode", 13, 10), jBits)

jinvoke SetFocus, hWnd ; for testing, keep focus on main window, so you can hit Escape
jmp defwp
  not_create:
cmp uMsg, WM_KEYDOWN
jne not_keydown
cmp wParam, VK_ESCAPE
jne @F
  forceClose:
jinvoke SendMessage, hWnd, WM_CLOSE, 0, 0
@@:
jmp defwp
  not_keydown:
cmp uMsg, WM_COMMAND
jne not_command
movsx rax, word ptr wParam
mov lastMenu, rax
jinvoke InvalidateRect, hWnd, 0, 1
if usedeb
PrintLine Str$("Command %i", word ptr wParam) ; the Ids are in the LoWord of wParam
endif
cmp word ptr wParam, 106
je forceClose
jmp defwp
  not_command:
cmp uMsg, WM_PAINT
jne not_paint
jinvoke BeginPaint, hWnd, addr ps
xchg rax, rsi
PtDC equ rsi
jinvoke SetTextColor, PtDC, RgbCol(160, 0, 0)
cmp lastMenu, 107
jne @F
jinvoke SetBkColor, PtDC, RgbCol(255, 255, 240)
jinvoke TextOut, PtDC, 7, 2, Str$(Chr$("Assembled with ", @AsmUsed$(1), " in %i-bit mode", 13, 10), jBits), s$Len
jmp EndPt
  @@: jinvoke SetBkColor, PtDC, RgbCol(204, 255, 240)
jinvoke TextOut, PtDC, 7, 2, Str$("Command or menu clicked: %i", lastMenu), s$Len ; Str$() and Hex$() return a special length variable s$Len
  EndPt: jinvoke EndPaint, hWnd, addr ps
jmp defwp
  not_paint:
cmp uMsg, WM_SIZE
jne not_size ; adjust shape of edit control to main window
movzx eax, word ptr lParam ; width of client area
movzx edx, word ptr lParam+2 ; height
sub eax, 17 ; these 32-bit instructions sign-extend the upper 32 bits
sub edx, 37 ; of the 64-bit registers and are one byte shorter
jinvoke MoveWindow, hEdit, 7, 30, rax, rdx, 1
jmp defwp
  not_size:
cmp uMsg, WM_CLOSE
jne not_close
MsgBox 0, "Sure to close?", "Hi", MB_YESNO ; decide whether to close or not
sub rax, IDNO ; typically, this box should only be used if there is unsaved content
je @RetEax ; return rax, if NO: zero (i.e. refuse to close)
jmp defwp
  not_close:
cmp uMsg, WM_DESTROY
jne defwp ; not_destroy
jinvoke PostQuitMessage, NULL ; quit after WM_CLOSE
  defwp:
  jinvoke DefWindowProc, hWnd, uMsg, wParam, lParam ; default processing
@RetEax: ; this label serves to bypass DefWindowProc
  ret ; ret is a macro that pops the "uses" regs, then leave+ret
WndProc endp
j@end ; ---- end of code ----

Rsrc ; **** during assembly, RichMasm exports this section as filename.rc ****
32512 ICON "\\masm32\\MasmBasic\\icons\\smiley.ico"
100 MENUEX
BEGIN
    POPUP "&File", , , 0
    BEGIN
        MENUITEM "&New",  102
        MENUITEM "&Open", 103
        MENUITEM "&Save", 104
        MENUITEM "Save &As", 105
        MENUITEM "&Exit", 106
    END
    POPUP "&Help", , , 0
    BEGIN
        MENUITEM "&About", 107
    END
END
Rsrc

MichaelW

https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

I wonder if this page is up to date:

https://msdn.microsoft.com/en-us/library/cc230350.aspx
Well Microsoft, here's another nice mess you've gotten us into.

jj2007

Quote from: MichaelW on July 29, 2016, 01:17:19 PMhttps://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

Now this is a great document, thanks. Here they are - who volunteers to rewrite Windows.inc? It's only a handful...

1 ATOM
2 ATOM UShort
3 BOOL
4 BOOL Integer
5 BOOLEAN
6 BOOLEAN Byte
7 BYTE
8 BYTE Byte
9 CALLBACK
10 CALLBACK Delegate
11 CCHAR
12 CHAR
13 CHAR SByte
14 COLORREF
15 COLORREF UInteger
16 CONST
17 CONST Const
18 DOUBLE and CY are undocumented
19 DWORD
20 DWORD length
21 DWORD UInteger
22 DWORD_PTR
23 DWORD_PTR UInteger (ULong)
24 DWORD32
25 DWORD32 UInteger
26 DWORD64
27 DWORD64 Long
28 DWORDLONG
29 DWORDLONG ULong
30 FLOAT
31 FLOAT Single
32 HACCEL
33 HACCEL IntPtr
34 HALF_PTR
35 HALF_PTR Short (Integer)
36 HANDLE
37 HANDLE IntPtr
38 HBITMAP
39 HBITMAP IntPtr
40 HBRUSH
41 HBRUSH IntPtr
42 HCOLORSPACE
43 HCONV
44 HCONV IntPtr
45 HCONVLIST
46 HCONVLIST IntPtr
47 HCURSOR
48 HCURSOR IntPtr
49 HDC
50 HDC IntPtr
51 HDDEDATA
52 HDDEDATA IntPtr
53 HDESK
54 HDESK IntPtr
55 HDROP
56 HDROP IntPtr
57 HDWP
58 HDWP IntPtr
59 HENHMETAFILE
60 HENHMETAFILE IntPtr
61 HFILE
62 HFILE Integer
63 HFONT
64 HFONT IntPtr
65 HGDIOBJ
66 HGIDOBJ IntPtr
67 HGLOBAL
68 HGLOBAL IntPtr
69 HHOOK
70 HHOOK IntPtr
71 HICON
72 HICON IntPtr
73 HINSTANCE
74 HINSTANCE IntPtr
75 HKEY
76 HKEY IntPtr
77 HKL
78 HKL IntPtr
79 HLOCAL
80 HLOCAL IntPtr
81 HMENU
82 HMENU IntPtr
83 HMETAFILE
84 HMETAFILE IntPtr
85 HMODULE
86 HMODULE IntPtr
87 HMONITOR
88 HMONITOR IntPtr
89 HPALETTE
90 HPALETTE IntPtr
91 HPEN
92 HPEN IntPtr
93 HRESULT
94 HRESULT Integer
95 HRGN
96 HRGN IntPtr
97 HRSRC
98 HRSRC IntPtr
99 HSZ
100 HSZ IntPtr
101 HWINSTA
102 HWINSTA IntPtr
103 HWND
104 HWND can't be read
105 HWND IntPtr
106 INT
107 INT_PTR
108 INT_PTR Integer (Long)
109 INT16
110 INT32
111 INT32 Integer
112 INT64
113 INT64 Long
114 INT8
115 LANGID
116 LANGID UShort
117 Large Integers
118 LCID
119 LCID UInteger
120 LCTYPE
121 LGRPID
122 LGRPID UInteger
123 LONG
124 LONG Integer
125 LONG_PTR
126 LONG_PTR Integer (Long)
127 LONG32
128 LONG32 Integer
129 LONG64
130 LONG64 Long
131 LONGLONG
132 LONGLONG
133 LONGLONG - defined via double?
134 LONGLONG Long
135 LPARAM
136 LPARAM Integer (Long)
137 LPBOOL
138 LPBOOL ByRef Integer
139 LPBYTE
140 LPBYTE ByRef Byte
141 LPCOLORREF
142 LPCOLORREF UInteger
143 LPCSTR
144 LPCSTR ByRef SByte
145 LPCTSTR
146 LPCTSTR ByRef Char
147 LPCVOID
148 LPCWSTR
149 LPCWSTR ByRef Char
150 LPDWORD
151 LPDWORD UInteger
152 LPHANDLE
153 LPHANDLE ByRef IntPtr
154 LPINT
155 LPINT Integer (Long)
156 LPLONG
157 LPLONG Integer
158 LPSTR
159 LPSTR ByRef SByte
160 LPTSTR
161 LPTSTR ByRef Char
162 LPVOID
163 LPVOID IntPtr
164 LPWORD
165 LPWORD UShort
166 LPWSTR
167 LPWSTR ByRef Char
168 LRESULT
169 LRESULT Integer (Long)
170 PBOOL
171 PBOOL Integer (Long)
172 PBOOLEAN
173 PBOOLEAN ByRef Byte
174 PBYTE
175 PBYTE ByRef Byte
176 PCHAR
177 PCHAR ByRef SByte
178 PCSTR
179 PCSTR ByRef SByte
180 PCTSTR
181 PCTSTR ByRef Char
182 PCWSTR
183 PCWSTR ByRef Char
184 PDWORD
185 PDWORD UInteger
186 PDWORD_PTR
187 PDWORD_PTR ByRef UInteger (ULong)
188 PDWORD32
189 PDWORD32 ByRef UInteger
190 PDWORD64
191 PDWORD64 ByRef Long
192 PDWORDLONG
193 PDWORDLONG ByRef ULong
194 PFLOAT
195 PFLOAT ByRef Single
196 PHALF_PTR
197 PHALF_PTR ByRef Short (Integer)
198 PHANDLE
199 PHANDLE ByRef IntPtr
200 PHKEY
201 PHKEY ByRef IntPtr
202 PINT
203 PINT Integer (Long)
204 PINT_PTR
205 PINT_PTR ByRef Integer (Long)
206 PINT16
207 PINT32
208 PINT32 ByRef Integer
209 PINT64
210 PINT64 ByRef Long
211 PINT8
212 PLCID
213 PLCID UInteger
214 PLONG
215 PLONG Integer
216 PLONG_PTR
217 PLONG_PTR ByRef Integer (Long)
218 PLONG32
219 PLONG32 ByRef Integer
220 PLONG64
221 PLONG64 ByRef Long
222 PLONGLONG
223 PLONGLONG ByRef Long
224 POINTER_32
225 POINTER_32 (IntPtr)
226 POINTER_64
227 POINTER_64 IntPtr
228 POINTER_SIGNED
229 POINTER_SIGNED IntPtr
230 POINTER_UNSIGNED
231 POINTER_UNSIGNED UIntPtr
232 PSHORT
233 PSHORT Short
234 PSIZE_T
235 PSIZE_T ByRef UInteger (ULong)
236 PSSIZE_T
237 PSSIZE_T ByRef Integer (Long)
238 PSTR
239 PSTR ByRef SByte
240 PTBYTE
241 PTBYTE ByRef Char
242 PTCHAR
243 PTCHAR ByRef Char
244 PTSTR
245 PTSTR ByRef Char
246 PUCHAR
247 PUCHAR ByRef Byte
248 PUHALF_PTR
249 PUHALF_PTR ByRef UShort (UInteger)
250 PUINT
251 PUINT ByRef UInteger
252 PUINT_PTR
253 PUINT_PTR ByRef UInteger (ULong)
254 PUINT16
255 PUINT32
256 PUINT32 ByRef UInteger
257 PUINT64
258 PUINT64 ByRef ULong
259 PUINT8
260 PULONG
261 PULONG UInteger
262 PULONG_PTR
263 PULONG_PTR ByRef UInteger (ULong)
264 PULONG32
265 PULONG32 ByRef UInteger
266 PULONG64
267 PULONG64 ByRef ULong
268 PULONGLONG
269 PULONGLONG ByRef ULong
270 PUSHORT
271 PUSHORT UShort
272 PVOID
273 PVOID IntPtr
274 PWCHAR
275 PWCHAR ByRef Char
276 PWORD
277 PWORD UShort
278 PWSTR
279 PWSTR ByRef Char
280 QWORD
281 SC_HANDLE
282 SC_HANDLE IntPtr
283 SC_LOCK
284 SC_LOCK IntPtr
285 SERVICE_STATUS_HANDLE
286 SERVICE_STATUS_HANDLE IntPtr
287 SHORT
288 SHORT Short
289 SIZE_T
290 SIZE_T UInteger (ULong)
291 SSIZE_T
292 SSIZE_T Integer (Long)
293 STRICT Type Checking
294 TBYTE
295 TBYTE Char
296 TCHAR
297 TCHAR Char
298 UCHAR
299 UCHAR Byte
300 UHALF_PTR
301 UHALF_PTR UShort (UInteger)
302 UINT
303 UINT UInteger
304 UINT_PTR
305 UINT_PTR UInteger (ULong)
306 UINT16
307 UINT32
308 UINT32 UInteger
309 UINT64
310 UINT64 ULong
311 UINT8
312 ULONG
313 ULONG UInteger
314 ULONG_PTR
315 ULONG_PTR UInteger (ULong)
316 ULONG32
317 ULONG32 UInteger
318 ULONG64
319 ULONG64 ULong
320 ULONGLONG
321 ULONGLONG ULong
322 UNICODE_STRING
323 UNICODE_STRING Structure UNICODE_STRING : Dim Lenght As UShort, MaximumLenght As UShort, ByRef Buffer As Char : End Structure
324 USHORT
325 USHORT UShort
326 USN
327 USN Long
328 VOID
329 VOID Object
330 WCHAR
331 WCHAR Char
332 Why Windows
333 WIANPI Delegate
334 WINAPI
335 WORD
336 WORD UShort
337 WPARAM
338 WPARAM UInteger (ULong)


"If DWORD is typedef to unsigned long, then its length varies based on CPU type, not necessarily 32bit." ::)

In addition to these 300+ types, there are a few more that you absolutely need for happy coding ("The New Data Types"):1 DWORD32 32-bit unsigned integer
2 DWORD64 64-bit unsigned integer
3 INT32 32-bit signed integer
4 INT64 64-bit signed integer
5 LONG32 32-bit signed integer
6 LONG64 64-bit signed integer
7 UINT32 Unsigned INT32
8 UINT64 Unsigned INT64
9 ULONG32 Unsigned LONG32
10 ULONG64 Unsigned LONG64
11 DWORD_PTR Unsigned long type for pointer precision.
12 HALF_PTR Half the size of a pointer. Use within a structure that contains a pointer and two small fields.
13 INT_PTR Signed integer type for pointer precision.
14 LONG_PTR Signed long type for pointer precision.
15 SIZE_T The maximum number of bytes to which a pointer can refer. Use for a count that must span the full range of a pointer.
16 SSIZE_T Signed SIZE_T.
17 UHALF_PTR Unsigned HALF_PTR.
18 UINT_PTR Unsigned INT_PTR.
19 ULONG_PTR Unsigned LONG_PTR.
20 POINTER_32 A 32-bit pointer. On 32-bit Windows, this is a native pointer. On 64-bit Windows, this is a truncated 64-bit pointer.
21 POINTER_64 A 64-bit pointer. On 64-bit Windows, this is a native pointer. On 32-bit Windows, this is a sign-extended 32-bit pointer.


"adopting these new data types makes your code more robust. To use these data types, you must scan your code for potentially unsafe pointer usage, polymorphism, and data definitions" - WOW, that's great, I've always dreamed of robust Windows software, but this extra-safe stuff endangers Adobe's business model. You know, once a week, the flash update ("safer and faster") with the tick box that installs the McAfee suite 8)

mineiro

Hello sir jj2007
have found this link,  have a definition to double. Shows that unsigned long it's a dword.
https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

jj2007

Quote from: jj2007 on July 29, 2016, 05:07:07 PM"adopting these new data types makes your code more robust. To use these data types, you must scan your code for potentially unsafe pointer usage, polymorphism, and data definitions" - WOW, that's great, I've always dreamed of robust Windows software, but this extra-safe stuff endangers Adobe's business model. You know, once a week, the flash update ("safer and faster") with the tick box that installs the McAfee suite 8)

Google says Adobe Flash has a different business model:
QuoteToday, more than 90% of Flash on the web loads behind the scenes to support things like page analytics. This kind of Flash slows you down

raymond

QuoteMy approach: simply don't use these for your own work. It's an awful lot easier to go back to the good old days, and just "call" (or even "jmp"), and pass arguments any convenient way.

Hear. Hear. :eusa_clap: :eusa_clap: :eusa_clap: :t
Whenever you assume something, you risk being wrong half the time.
https://masm32.com/masmcode/rayfil/index.html

jj2007

SOF: Determining 32 vs 64 bit in C++  :dazzled:

Also nice: A Collection of Examples of 64-bit Errors in Real Programs
QuoteOur company OOO "Program Verification Systems" develops a special static analyzer, Viva64, which detects 64-bit errors in the code of C/C++ applications. During this development process, we constantly enlarge our collection of examples of 64-bit defects, so we decided to gather the most interesting ones in this article.

From the same authors: 20 issues of porting C++ code to the 64-bit platform
QuoteThis article describes the process of porting a 32-bit application to 64-bit systems. The article is written for programmers who use C++ but it may also be useful for all who face the problem of porting applications onto other platforms. The authors of the article are experts in the field of porting applications to 64-bit systems

LiaoMi

Quote from: MichaelW on July 29, 2016, 01:17:19 PM
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

I wonder if this page is up to date:

https://msdn.microsoft.com/en-us/library/cc230350.aspx

Hallo,

to make it convenient, I installed msdn locally, and then I add favorites ... The following picture shows how it looks .. I copied the Help Viewer in a separate folder, exactly the same as the copy of the msdn database. On this page you can find the document - Help Viewer Administrator Guide - https://msdn.microsoft.com/en-us/library/hh492077.aspx  Start Help Viewer autonomously through a shortcut so far without success, we need more option. If you make a start bat file, then you can not run the Help Viewer always through Visual Studio ... I think it very comfortable.

PDF with all types of data can be downloaded here - https://msdn.microsoft.com/en-us/library/cc230273.aspx or direct link https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-DTYP/[MS-DTYP].pdf

Addition: "C:\masm32\jWasm\Microsoft Help Viewer\v2.2\HlpViewer.exe" /catalogName VisualStudio14 /helpQuery  "method=f1&query=masm" With this code for the shortcut Help Viewer can be launched without an assistant visual studio.

jj2007

Quote from: LiaoMi on August 21, 2016, 07:07:08 PMto make it convenient, I installed msdn locally, and then I add favorites

I use the VS help, see screenshot below. Is that a lot different? How do you get context-sensitive help, i.e. user has selected CreateWindowEx and hits F1 or selects menu as shown in screenshot below? Is that what you mean with "favorites"? Your solution with C:\Program Files\Microsoft Help Viewer\v1.0\HlpViewer.exe launches the viewer but it pretends that there is no content installed ::)

LiaoMi

QuoteI use the VS help, see screenshot below. Is that a lot different? How do you get context-sensitive help, i.e. user has selected CreateWindowEx and hits F1 or selects menu as shown in screenshot below? Is that what you mean with "favorites"? Your solution with C:\Program Files\Microsoft Help Viewer\v1.0\HlpViewer.exe launches the viewer but it pretends that there is no content installed ::)

Hallo,

the favorites list is on the left side in the picture, there is different information about the types and macros for assembler, and other information regarding the features of the assembler.

"C:\masm32\jWasm\Microsoft Help Viewer\v2.2\HlpViewer.exe" /catalogName VisualStudio14 /helpQuery  "method=f1&query=masm"

The lines above are responsible for finding specific information - "method=f1&query=masm", where the word "masm" search request, /catalogName VisualStudio14 indicates the version of the studio and the version of the catalog.
This message goes out through the launch of a shortcut? Directory address is prescribed in the system, the path can be seen in the tab "Manage Content". All these lines are added to the shortcut properties in the line "Target".
Your path will be - "C:\Program Files\Microsoft Help Viewer\v1.0\HlpViewer.exe" /catalogName VisualStudio10 /helpQuery  "method=f1&query=CreateWindowsEx"

The second solution may be the "C:\masm32\jWasm\Microsoft Help Viewer\v2.2\HlpViewer.exe" /catalogName VisualStudio14 /helpQuery method=f1&query=msdnstart /locale en-US /launchingApp Microsoft,VisualStudio,14.0

Your solution is also very cool! In the RadAsm 2.2 this function is unfortunately not implemented.

Visual Studio 2010

Visual Studio 2010 ships with Help Viewer 1.x. Help Viewer 1.x supports a custom ms-xhelp:/// protocol that you can use anywhere you can use an http:// url to link to the f1 keyword you created.

Here's an example ms-xhelp:/// uri you can use in a shortcut or as a command line from your application:

ms-xhelp:///?method=f1&query=InnovasysDocsStartPage&product=VS&productversion=100&format=html&locale=EN-US


Maybe directory error occurs because versions of Assistant?


jj2007

#25
Quote from: LiaoMi on August 22, 2016, 08:08:47 PMThe second solution may be the "C:\masm32\jWasm\Microsoft Help Viewer\v2.2\HlpViewer.exe" /catalogName VisualStudio14 /helpQuery method=f1&query=msdnstart /locale en-US /launchingApp Microsoft,VisualStudio,14.0

No luck, it just complains that there is no content installed :(

QuoteYour solution is also very cool!

Thanks, I use it quite a lot :biggrin:

Back to topic: A DWORD is... here are a few "conversions" between DWORDs and other sizes:

lea rcx, [rax + rdx + 123h] ; 8->8
lea ecx, [rax + rdx + 123h] ; 8->4
lea rcx, [eax + edx + 123h] ; 4->8

mov rcx, rax ; 8->8
lea rcx, [eax] ; 4->8
movzx rcx, ax ; 2->8
movzx rcx, al ; 1->8

mov rax, 8765432187654321h ; a negative number
mov eax, eax ; rax=87654321h

mov rax, 8765432187654321h
cdqe      ; rax=0FFFFFFFF87654321h