Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > WinXP 64 Bit driver with asm-file - Argument error by ml64

Reply
Thread Tools Display Modes

WinXP 64 Bit driver with asm-file - Argument error by ml64

 
 
maddin123
Guest
Posts: n/a

 
      12-05-2005
Hi,
trying to add asm-file with functions to my driver gives an error whenever
my asm-functions have arguments. When not ml64 gives no error.

ALIGN 16
Foo PROC xWORD, yWORD

MOV AX, 1
RET

Foo ENDP

ERROR: error A2070: invalid instruction operands

Foo PROC

MOV AX, 1
RET

Foo ENDP

NO ERROR!

Bye
Martin

Shall i use stack pointer instead? Or must i tell ml64 something that it
accepts arguments? Or not allowed in drivers?

Thx
Martin


--
Everyone is a newbie to something the first time.
 
Reply With Quote
 
 
 
 
Pavel A.
Guest
Posts: n/a

 
      12-05-2005
"maddin123" wrote:
> Hi,
> trying to add asm-file with functions to my driver gives an error whenever
> my asm-functions have arguments. When not ml64 gives no error.
>
> ALIGN 16
> Foo PROC xWORD, yWORD
>
> MOV AX, 1
> RET
>
> Foo ENDP
>
> ERROR: error A2070: invalid instruction operands
>
> Foo PROC
>
> MOV AX, 1
> RET
>
> Foo ENDP
>
> NO ERROR!
>
> Bye
> Martin
>
> Shall i use stack pointer instead? Or must i tell ml64 something that it
> accepts arguments? Or not allowed in drivers?
>
> Thx
> Martin
>
>
> --
> Everyone is a newbie to something the first time.


Well... so goes...

1. In the "fancy" asm, RET is a pseudo instruction that generates function
return sequence (unwind the stack etc).
Turn detailed listing of generated code on and see which generated
instruction gives this error.

2. Write prototype of your function in C. Compile with assembly listing.
Use code created by C compiler as starting point for your assembly function.

0. The DDK compiler supports intrinsic functions that can save you from
using assembly. Many of them are defined in ntddk.h.

Good luck
--PA

 
Reply With Quote
 
Ivan Brugiolo [MSFT]
Guest
Posts: n/a

 
      12-05-2005
Please use
`include macamd64.inc`
at the beginning of the file, and, later one,
read about LEAF_ENTRY function, and NESTED_ENTRY functions,
and about the exception unwind model of AMD64.
Once you are familiar with the expectations of the OS runtime environment
with regard of your code, you migh be able to write ASM code for AMD64.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"maddin123" <> wrote in message
newsF7BAA76-814C-4AEE-998F-...
> Hi,
> trying to add asm-file with functions to my driver gives an error whenever
> my asm-functions have arguments. When not ml64 gives no error.
>
> ALIGN 16
> Foo PROC xWORD, yWORD
>
> MOV AX, 1
> RET
>
> Foo ENDP
>
> ERROR: error A2070: invalid instruction operands
>
> Foo PROC
>
> MOV AX, 1
> RET
>
> Foo ENDP
>
> NO ERROR!
>
> Bye
> Martin
>
> Shall i use stack pointer instead? Or must i tell ml64 something that it
> accepts arguments? Or not allowed in drivers?
>
> Thx
> Martin
>
>
> --
> Everyone is a newbie to something the first time.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UniCode Resouce (RC) file crashes WinXP Driver build. S. Mark Courter Windows Vista Drivers 4 11-10-2005 10:04 PM
INF file for AHA154x sample driver in the WinXP SP1 DDK does not w Long Ta Windows Vista Drivers 1 01-18-2005 01:26 PM
WINXP USB Driver Problem F18 Windows Vista Drivers 1 11-20-2004 04:15 AM
WDM driver for WinXP writefile and readfile error Felisberto Coimbra Windows Vista Drivers 1 10-14-2004 08:12 AM
Device Driver loading error on 2nd PCI card, WinXP SP1 Curtis Rubel Windows Vista Drivers 3 05-13-2004 01:51 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59