News:

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

Main Menu

How to test and run assembly programs without Visual Studio

Started by RedSkeleton007, September 11, 2015, 12:24:20 AM

Previous topic - Next topic

jj2007


Oliver Scantleberry

Quote from: hutch-- on December 02, 2015, 03:51:11 PM
. . . but sad to say its also (OZ) the idiomatic abbreviation for Australia where this forum is located and where I live. . .

I have a first cousin born and raised here in Maine USA and until very recently, lived in Australia in a place called Round Corner--not too far from Sydney--for over thirty years. Spoke to him hundreds of times over the years and he never once mentioned "OZ".

hutch--

I would not hold it against him, not everyone is familiar with older AU idiom.

With thanks to Don McLean.

Quote
Over the rainbow a Kansas tornado
Can twist up a little girls head
Aunt Em's on relief and the tin man's a thief
And even the wizard can't wake the dead

Oliver Scantleberry

Quote from: hutch-- on December 03, 2015, 10:42:28 PM
I would not hold it against him, not everyone is familiar with older AU idiom.

Next time I speak to him, I'm gonna call him a dumb, numskull, ignorant, nincompoop Aussie.

By the way, where can I find out how to adjust Windows (Win 10) sequential file pointer? I didn't see any thing in MASM32 that would help. DOS used to do it with Int 21h, function 42h (I think).

TWell

If you use Win32 API search from MSDN SetFilePointer()

Oliver Scantleberry

Quote from: TWell on December 05, 2015, 08:06:46 AM
If you use Win32 API search from MSDN SetFilePointer()

The only thing regarding SetFilePointer I saw in MSDN was in C++ and C, neither of which I use much. In fact, I never use C++.

TWell

A silly question.
You can use Win32 API with masm too.

BTW:
How about your drugs, remember to take them too.

Oliver Scantleberry

Quote from: TWell on December 05, 2015, 08:21:42 AM
A silly question.
You can use Win32 API with masm too.

BTW:
How about your drugs, remember to take them too.

Don't know about Win32 API. Don't know where it is nor how to use it.

I take lots of drugs. Always take them on time. Especially insulin.

hutch--

> Next time I speak to him, I'm gonna call him a dumb, numskull, ignorant, nincompoop Aussie.

Most foreigners make a mess of Australian idiom, you don't appear to be an exception.

dedndave

Quote from: Oliver Scantleberry on December 05, 2015, 08:18:00 AM
The only thing regarding SetFilePointer I saw in MSDN was in C++ and C, neither of which I use much. In fact, I never use C++.

just because the example they offer is in C, doesn't mean it can't be used by other compilers or assemblers
"windows API" refers to the "Application Programming Interface"
it includes thousands of functions that provide a programming interface layer - access to the OS

if you have written any windows program, you have used the API
ExitProcess is a windows API function   :P

Oliver Scantleberry

Quote from: dedndave on December 05, 2015, 11:45:34 PM
Quote from: Oliver Scantleberry on December 05, 2015, 08:18:00 AM
The only thing regarding SetFilePointer I saw in MSDN was in C++ and C, neither of which I use much. In fact, I never use C++.

if you have written any windows program, you have used the API
ExitProcess is a windows API function   :P

The only thing I have found that's useful is: SetFilePointer  :DWORD, :DWORD, :DWORD, :DWORD. I just need to know what the four double word arguments are. I have only been vectored to C and C++ stuff which, for me, is useless. I have only been using COBOL, Perl, and Assembly during the past few years. I'll just keep looking.


Grincheux

Take a look here : https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Quote
DWORD WINAPI SetFilePointer(  _In_        HANDLE hFile, _In_        LONG   lDistanceToMove, _Inout_opt_ PLONG  lpDistanceToMoveHigh, _In_        DWORD  dwMoveMethod );

There are all DWORD

dedndave

SetFilePointer
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx

SetFilePointerEx
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365542%28v=vs.85%29.aspx

first, nearly all windows API functions have such a page
there are similar MSDN pages for most constants, structures, messages, notifications, enumerations, and so on
(use the index in the left pane of the pages to find other pages)

now, as to syntax...

this is the normal C declaration syntax
the assembly language equivalent is the PROTO (prototype)

DWORD WINAPI SetFilePointer(
  _In_        HANDLE hFile,
  _In_        LONG   lDistanceToMove,
  _Inout_opt_ PLONG  lpDistanceToMoveHigh,
  _In_        DWORD  dwMoveMethod
);


if you examine the windows.inc file, you will see that Hutch has TYPEDEF'ed many of the C types to DWORD's

HANDLE TYPEDEF DWORD

the C language uses "strong" typing
that means that if you try to pass a LONG integer as a HANDLE, some sort of compiler error will be generated
assembly language is not strong typed
the assembler is really only concerned with the size of each argument
so, we can just refer to HANDLE, LPSTR, LPVOID, LONG, etc, as DWORD's

the best thing to do is to learn Hungarian Notation so that you can tell if an argument is a value, or a pointer to a value   :biggrin:

in assembly language, we can use INVOKE to call these functions (as long as the function is prototyped)

    INVOKE  SetFilePointer, hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod

refer to the MSDN page for a description of each argument

Oliver Scantleberry

Quote from: dedndave on December 11, 2015, 03:45:18 AM
SetFilePointer
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx

Now, as to syntax...

this is the normal C declaration syntax
the assembly language equivalent is the PROTO (prototype)

DWORD WINAPI SetFilePointer(
  _In_        HANDLE hFile,
  _In_        LONG   lDistanceToMove,
  _Inout_opt_ PLONG  lpDistanceToMoveHigh,
  _In_        DWORD  dwMoveMethod
);


if you examine the windows.inc file, you will see that Hutch has TYPEDEF'ed many of the C types to DWORD's

Thank you, Dave. I now have enough to try 'er out.

Oliver Scantleberry

Quote from: Grincheux on December 10, 2015, 09:15:43 PM
Take a look here : https://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Quote
DWORD WINAPI SetFilePointer(  _In_        HANDLE hFile, _In_        LONG   lDistanceToMove, _Inout_opt_ PLONG  lpDistanceToMoveHigh, _In_        DWORD  dwMoveMethod );

There are all DWORD

Thank you, Grinch. I'm gonna try it out.