News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A couple problems

Started by bunnyboi, July 22, 2008, 10:13:43 AM

Previous topic - Next topic

bunnyboi

I'm having a two problems. The first is: I'm trying to make a small program that'll log-off the current user but when I use the invoke ExitWindows,0,0 function it give the following error: test.asm(32) : error A2006: undefined symbol : ExitWindows. I'm using the includes and libs: user32 and kernel32 and not sure if its in another include or not. The second problem is I found an old article about a few undocumented instructions in the AMD 3DNow instruction set but when I try to use them I get instruction or register not accepted in current CPU mode but it gives me the same error with the example code for square roots taken from the 3DNow instruction manual. I am using the .586, .mmx, and .k3d derivatives and I'm using masm 9.0 for the code for both programs.

PBrennick

bunnyboi,
This works fine:



        .386
        .model  flat, stdcall
        option  casemap:none

; Includes
;---------------------------------------
        include     \masm32\include\windows.inc
        include     \masm32\include\kernel32.inc
        include     \masm32\include\user32.inc

; Libraries
;---------------------------------------
        includelib  \masm32\lib\kernel32.lib
        includelib  \masm32\lib\user32.lib

.code
;---------------------------------------
Start:  invoke  ExitWindowsEx, EWX_LOGOFF, 0
        invoke  ExitProcess, eax

        end     Start



About the second issue, probably will need to see the source.

-- Paul
The GeneSys Project is available from:
The Repository or My crappy website

bunnyboi

Thanks for the reply. The cause of the first problem was that I didn't know I needed to use windows.inc to log-off. And I fixed the second problem too. It was a spelling mistake :red. The example from the 3DNow manual works fine now. The code using the undocumented functions compiles and links but that code causes a crash. I'm currently looking into that. The snippet of code using the undocumented functions and explaining what they do is located here: http://www.x86.org/articles/3dnow/amd_3dnow.htm

PBrennick

bunnyboi,

A word to the wise is sufficient. Using undocumented APIs c-a-n be useful but the fact that they are what they are means that they can disappear version to version and you can wind up with broken code.

Just something to keep in mind. We have all played in that area but the key word is 'played.' Nothing serious should ever be done that way (if you were marketting code for example). Guaranteed, it will come back to haunt you.

CPU specifiec instructions? Same thing, narrows the market.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

bunnyboi

Oh I know Paul. I just get very curious. I'm never going to use undocumented functions in production code.