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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
.586P .model flat,stdcall ;------------------ includelib masm32libkernel32.lib includelib masm32libuser32.lib extern ExitProcess@4:near extern GetStdHandle@4:near extern CloseHandle@4:near extern WriteConsoleA@20:near extern ReadConsoleA@20:near extern wsprintfA:near ;------------------ _DATA SEGMENT ExitCode dd 0 szIntro db 13,10,"Press <q> to quit or <a> to exicute Small.",13,10,0 szError db "Imput error! PLease try again.",13,10,0 szSmall db 07,"Hello! Here I am, Smally:)",13,10,7 szBuffer db 255 dub(0) _DATA ENDS _TEXT SEGMENT START: call main ;------------------ push [ExitCode] call ExitProcess@4 ;**************************************************** main proc _do: push offset szIntro call cout ;------------------ _while_: push offset szBuffer call cin ;------------------ mov al,byte ptr[szBuffer] ;------------------ cmp al,71h ;q je _do_end ;------------------ cmp al,'a' je _small ;------------------ push offset szError call cout ;------------------ jmp _while_ _small: call small jmp _while_ _do_end: ret main endp ;**************************************************** ;ebp+8 = pStr cout proc push ebp mov ebp,esp add esp,-8 ;------------- push ebx push esi push edi ;------------- push -11 call GetStdHandle@4 mov dword ptr[ebp-4],eax ;------------- mov esi,dword ptr[ebp+8] ;------------- push esi call lens ;------------- push 0 mov ebx,ebp sub ebx,8 ;------------- push ebx push eax push esi push dword ptr[ebp-4] call WriteConsoleA@20 ;------------- pop edi pop esi pop ebx mov esp,ebp pop ebp ret 4 cout endp ;**************************************************** cin proc push ebp mov ebp,esp add esp,-4 ;------------- push ebx push esi push edi ;------------- mov edi,dword ptr[ebp+8] ;------------- push -10 call GetStdHandle@4 ;------------- mov esi,ebp sub esi,4 ;------------- push 0 push esi push 255 push edi push eax call ReadConsoleA@20 ;------------- sub dword ptr[esi],2 mov esi, dword ptr[esi] ;------------- mov byte ptr[edi+esi],0 ;------------- pop edi pop esi pop ebx mov esp,ebp pop ebp ret cin endp ;**************************************************** lens proc push ebp mov ebp,esp push ebx push esi push edi ;------------- mov esi,dword ptr[ebp+8] ;------------- sub ecx,ecx ;------------- _while: mov al,byte ptr[ebp+8] cmp al,0 je _end_while ;------------- inc ecx inc esi jmp _while ;------------- _end_while: mov eax,ecx ;------------- pop edi pop esi pop ebx mov esp,ebp pop ebp ret 4 lens endp ;**************************************************** small proc enter 0,0 ;-------- push ebx push esi push edi ;------------- push offset szSmall call cout ;------------- pop edi pop esi pop ebx leave ret small endp ;--------------------- _TEXT ENDS END START |
Содержание
- Error a2206 missing operator in expression
- Asked by:
- Question
- All replies
- Error a2206 missing operator in expression
Error a2206 missing operator in expression
Asked by:
Question
ml64.exe gave an error A2070: invalid instruction operands.
This instruction worked in Linux. What’s wrong here? Thanks.
Welcome to MSDN forums! Thank you for your question.
We’re doing research on this issue. It might take some time before we get back to you.
Have you check instruction reference here: http://msdn.microsoft.com/en-us/library/x8zs5twb.aspx, you may find correct syntax from this page.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
movq rax, 0x00ff00ff00ff00ff
has «error A2206: missing operator in expression». While it works in Linux.
Just because it works on Linux doesn’t mean it is right.
Reading the Intel instruction reference in the Intel Software Developer’s Manual volume 2A, the MOVQ has 4 forms
MOVQ mm, mm/m64 Move quadword from mm/m64 to mm.
MOVQ mm/m64, mm Move quadword from mm to mm/m64.
MOVQ xmm1, xmm2/m64 Move quadword from xmm2/mem64 to xmm1.
MOVQ xmm2/m64, xmm1 Move quadword from xmm1 to xmm2/mem64.
So what this mean is your first one is invalid because it is going from a general purpose register, even if it is a 64 bit one. The second one is invalid because it is a literal going to a general purpose register. The second one also has the problem of in ML64, hexadecimal numbers are written as 1234567890h not 0x1234567890.
As to why it works on Linux, who knows. Maybe the assembler is doing something like injecting instructions to make it work, like
Источник
Error a2206 missing operator in expression
include masm32includewindows.inc
include masm32includeuser32.inc
include masm32includekernel32.inc
includelib masm32libuser32.lib
includelib masm32libkernel32.lib
fname db «log.txt», 0
fhandle dd ?
cwritten dd ?
var dd ?
invoke CreateFile, addr fname, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL
mov fhandle, eax
LOCAL KeyCode:DWORD
LOCAL KB_State[256]:BYTE
LOCAL Char:WORD
invoke GetKeyboardState, addr KB_State
invoke ToAscii, KeyCode, 0, addr KB_State, addr Char,0
invoke WriteFile, fhandle, addr Char, 1, addr cwritten, NULL
main endp
invoke CloseHandle, fhandle
end start
Автор: oleg1973 27.7.2005, 14:51 |
ну если это кейлогер то нада засунуть все в ДЛЛ и потом сделать ХУК таким образом параметр KeyCode будет приходить из окна в котором нажатие было а в данном примере KeyCode у тебя = 0 |
Автор: туварищь 29.7.2005, 19:48 | ||
oleg1973 Прочитал на форуме твой топик кейлогер без dll так он вроде называется попробовал периписать всё на masm но вылетает много ошибок
. ошибки: |
Автор: oleg1973 30.7.2005, 10:19 |
ну в масме я не селен, но ошибки изза разницы синтаксиса код делался для фасма |
Автор: туварищь 30.7.2005, 15:36 | ||
oleg1973 Пробовал компилить твою прогу Fasm’ ом компилер ругался на
Скачивал последнюю версию Fasm с официального сайта и там тоже файла api.inc не было. |
Автор: oleg1973 31.7.2005, 22:13 |
ну файлик етот я сам делал для удобства там просто описание импортов функций |
Автор: туварищь 1.8.2005, 19:15 |
oleg1973 спасиб тебе я правда и сам уже допёр но ещё раз спасибо |
Автор: Guest 14.8.2005, 13:30 |
[code=asm] proc KeyBoardProc, code, wParam, lParam kbuff: times 1 db ? cmp [code=asm], HC_ACTION .write: .next: Источник Adblock |
Topic: error A2206: missing operator in expression (Read 7838 times)
What is wrong with my code ? I am getting the error for the line ‘integer db 0y01010101’ where I am simply trying to define a binary number.
This is my code:
.386
.model flat, stdcall
option casemap :none
include masm32includewindows.inc
include masm32includekernel32.inc
include masm32includemasm32.inc
includelib masm32libkernel32.lib
includelib masm32libmasm32.lib
.data
integer db 0y01010101
.code
start:
lea eax,integer
push eax
call StdOut
push 0
call ExitProcess
end start
Logged
.data
integer db 01010101b
Logged
Logged
You’re reading debugger reference
A few days ago qWord uploaded MASM reference . You may download it here.
Logged
For MASM y and b can be used as suffix for binary numbers, whereas the first one is independent of the current radix setting.
e.g.: 101010y
Logged
MREAL macros — when you need floating point arithmetic while assembling!
- Статус темы:
-
Закрыта.
-
Arvis
New Member
- Публикаций:
-
0
- Регистрация:
- 24 авг 2004
- Сообщения:
- 26
- Адрес:
- Ukraine
Добрый день, господа.
У меня возникла необходимость переписать программу с ТАСМа на МАСМ(615). Практически все получилось без особых проблем(по крайней мере внешне), но возник ряд сложностей. Я перечислю строки вызвавшие затруднения, если кто знает как их перевести в МАСМ и поделится, буду очень признателен.
Итак:
-
mov cl, [byte bx+di] ;error A2206: missing operator in expression
-
mov [byte ptr di], ASCNull ;error A2032: invalid use of register
-
mov [byte di], ASCnull ;error A2206: missing operator in expression
-
mov dl, [byte si-1] ;тоже
Вот и все. Приношу свои извинения за ламерские вопросы, но у меня большая проблема с Интернетом и поиски через гуглю затруднены до невозможности.
Заранее благодарен всем откликнувшимся.
-
ProgramMan
New Member
- Публикаций:
-
0
- Регистрация:
- 13 янв 2004
- Сообщения:
- 263
mov cl, byte [bx+di]
mov byte ptr [di], ASCNull
mov byte [di], ASCnull
mov byte [di], ‘-‘
mov dl, byte [si-1]
Может так…
P.S.: сам пишу на FASM, так что сильно не бить
-
Arvis
New Member
- Публикаций:
-
0
- Регистрация:
- 24 авг 2004
- Сообщения:
- 26
- Адрес:
- Ukraine
Спасибо за ответ, компилятор уже не ругается, но прога работать перестала так как надо….
-
Asterix
New Member
- Публикаций:
-
0
- Регистрация:
- 25 фев 2003
- Сообщения:
- 3.576
Arvis
Посмотри в отладчике работающую прогу на tasm’е, в этом месте, чтоб не сомневаться..
в OllyDbg например, там синтаксис masm.
-
ava
New Member
- Публикаций:
-
0
- Регистрация:
- 11 окт 2003
- Сообщения:
- 169
Если мне не изменяет память, в TASM-е byte — это всего лишь константа, равная 1. Так что byte [di], например, эквивалентно [di+1]. При указании типа операнда требуется ptr.
-
Turkish
New Member
- Публикаций:
-
0
- Регистрация:
- 25 окт 2004
- Сообщения:
- 80
- Адрес:
- Russia
А что этот кусок должен делать? может легче по-новой переписать?
-
ava
New Member
- Публикаций:
-
0
- Регистрация:
- 11 окт 2003
- Сообщения:
- 169
Quantum, у меня TASM превращает mov al,byte [di] в 8A 45 01, а mov al,byte ptr [di] — в 8A 05.
-
ava
Точно. Никогда бы не подумал
-
Arvis
New Member
- Публикаций:
-
0
- Регистрация:
- 24 авг 2004
- Сообщения:
- 26
- Адрес:
- Ukraine
Да, забыл сказать, может кому поможет разобраться(сам я этого пока не сделал) — прога на тасме в режиме IDEAL.
[to Turkish]
Вообще-то это не кусок кода, а набор строк вырванных из разных частей проги, так что переписывать нужно каждую по отдельности.
И еще одно: не ругается только masm.exe, а ml.exe все равно что-то не устраивает.
-
S_T_A_S_
New Member
- Публикаций:
-
0
- Регистрация:
- 27 окт 2003
- Сообщения:
- 1.754
masm.exe ?
Это ж какая версия-то MASM ? уже вроде есть ml.exe v8
По поводу ideal могу сказать, что FASM основан на подобном синтаксисе, может быть проще будет взять его? (если нужен coff, то он способен его создать.)
С MASM IMHO много головняка будет, т.к. <font face=»monospace]mov eax,foo</font><!—face—> он понимает как <font face=»monospace]mov eax,[foo]</font><!—face—>, и ему нужно далать <font face=»monospace]mov eax,offset foo</font><!—face—>.
Из-за путаницы с режимами адресации прога и не работает наверное.
Asterix дело говорит — смотри в Olly, там можно переключаться между режимами MASM / ideal.
-
Arvis
New Member
- Публикаций:
-
0
- Регистрация:
- 24 авг 2004
- Сообщения:
- 26
- Адрес:
- Ukraine
Хорошо посмотрю.
> masm.exe ?
> Это ж какая версия-то MASM ? уже вроде есть ml.exe v8
615
-
Arvis
New Member
- Публикаций:
-
0
- Регистрация:
- 24 авг 2004
- Сообщения:
- 26
- Адрес:
- Ukraine
Попробывал ее загрузить в Олли. Он что-то не то выдал, она уменя под ДОС, он умеет с такими работать?
-
Arvis
New Member
- Публикаций:
-
0
- Регистрация:
- 24 авг 2004
- Сообщения:
- 26
- Адрес:
- Ukraine
Все, разобрался с помощью Turbo Debugger.
Заработало после того, как изменил код предоставленный ProgramMan’ом на:
И дальше в том же духе. Спасибо всем кто помогал.
- Статус темы:
-
Закрыта.
Error a2206 missing operator in expression
Asked by:
Question
ml64.exe gave an error A2070: invalid instruction operands.
This instruction worked in Linux. What’s wrong here? Thanks.
All replies
Welcome to MSDN forums! Thank you for your question.
We’re doing research on this issue. It might take some time before we get back to you.
Have you check instruction reference here: http://msdn.microsoft.com/en-us/library/x8zs5twb.aspx, you may find correct syntax from this page.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
movq rax, 0x00ff00ff00ff00ff
has «error A2206: missing operator in expression». While it works in Linux.
Just because it works on Linux doesn’t mean it is right.
Reading the Intel instruction reference in the Intel Software Developer’s Manual volume 2A, the MOVQ has 4 forms
MOVQ mm, mm/m64 Move quadword from mm/m64 to mm.
MOVQ mm/m64, mm Move quadword from mm to mm/m64.
MOVQ xmm1, xmm2/m64 Move quadword from xmm2/mem64 to xmm1.
MOVQ xmm2/m64, xmm1 Move quadword from xmm1 to xmm2/mem64.
So what this mean is your first one is invalid because it is going from a general purpose register, even if it is a 64 bit one. The second one is invalid because it is a literal going to a general purpose register. The second one also has the problem of in ML64, hexadecimal numbers are written as 1234567890h not 0x1234567890.
As to why it works on Linux, who knows. Maybe the assembler is doing something like injecting instructions to make it work, like
Источник
Error a2206 missing operator in expression
Asked by:
Question
ml64.exe gave an error A2070: invalid instruction operands.
This instruction worked in Linux. What’s wrong here? Thanks.
All replies
Welcome to MSDN forums! Thank you for your question.
We’re doing research on this issue. It might take some time before we get back to you.
Have you check instruction reference here: http://msdn.microsoft.com/en-us/library/x8zs5twb.aspx, you may find correct syntax from this page.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
movq rax, 0x00ff00ff00ff00ff
has «error A2206: missing operator in expression». While it works in Linux.
Just because it works on Linux doesn’t mean it is right.
Reading the Intel instruction reference in the Intel Software Developer’s Manual volume 2A, the MOVQ has 4 forms
MOVQ mm, mm/m64 Move quadword from mm/m64 to mm.
MOVQ mm/m64, mm Move quadword from mm to mm/m64.
MOVQ xmm1, xmm2/m64 Move quadword from xmm2/mem64 to xmm1.
MOVQ xmm2/m64, xmm1 Move quadword from xmm1 to xmm2/mem64.
So what this mean is your first one is invalid because it is going from a general purpose register, even if it is a 64 bit one. The second one is invalid because it is a literal going to a general purpose register. The second one also has the problem of in ML64, hexadecimal numbers are written as 1234567890h not 0x1234567890.
As to why it works on Linux, who knows. Maybe the assembler is doing something like injecting instructions to make it work, like
Источник