.386
.model flat, stdcall
option casemap:none
test proto
.DATA
.DATA?
.CONST
.CODE
start:
invoke test
test proc
pushad
pushfd
;
popfd
popad
test endp
end start
A2008: syntax error : proto
A2008: syntax error : test
syntax error : in instruction
syntax error : endp
help me.. :(
;assemble error reason
test is an instruction in asm, so can't use it for function name.
thanks for help.
Hi
test is a register you can see this
test eax,eax
change your proc in _test or what ever
.386
.model flat, stdcall
option casemap:none
_test proto
.DATA
.DATA?
.CONST
.CODE
start:
invoke _test
_test proc
pushad
pushfd
;
popfd
popad
_test endp
end start
Quotetest is a register you can see this
"test" is an instruction
sorry yes i mean this :bg
greest
The term is "RESERVE WORD" and it applies to the entire intel instruction set as well as MASM specific operators. Its for a very obvious reason, the assembler has no way of distinguishing between a variable/label/operator of the same name so it says unhappy things to you in the form of error messages.
A characteristic of MASM (not a necessarily good one) is that after the FIRST error, often the rest is nonsense.
Quote from: ragdog on September 12, 2009, 09:38:50 AM
...
change your proc in _test or what ever
.386
.model flat, stdcall
option casemap:none
_test proto
.DATA
.DATA?
.CONST
.CODE
start:
invoke _test
_test proc
pushad
pushfd
;
popfd
popad
RET ; would be nice to have - usually we want to return don't we?
_test endp
end start
Well, if we're correcting code here, after the call to _test returns the program will proceed through it one more time because he doesn't terminate. This will result in a stack misalignment and likely a GP when the RET is executed (since no meaningful return address is likely to be on the stack). There should be an ExitProcess in there....
.CODE
start:
invoke _test
invoke ExitProcess, 0
_test proc
pushad
pushfd
;
popfd
popad
RET ; would be nice to have - usually we want to return don't we?
_test endp
end start
And by the way, the proper term is test is an assembly mnemonic
Quote from: donkey on September 15, 2009, 05:03:05 AM
Well, if we're correcting code here, after the call to _test returns the program will proceed through it one more time because he doesn't terminate. This will result in a stack misalignment and likely a GP when the RET is executed (since no meaningful return address is likely to be on the stack). There should be an ExitProcess in there....
Haha actually, if I'm not wrong, every thread's starting ESP is a pointer to code for :
push eax
call RtlExitUserThread
Hence what the return value for applications is for. This is why you can use ret as a quick way of finish threads.
Hi Slugsnack,
Actually thinking about it you're probably right :)