アドレス計算で eax を使用できない理由がわかりません...次は無効なオペランド型エラーを返します...
1 つのパラメーターを取るマクロがあります。
%macro IdPrompt 1 ; 1% - the offset within Buff at which to write the ID that is read in
mov eax, 3 ; Specify sys_read call
mov ebx, 0 ; Specify File Descriptor 0: Stdin
mov ecx, Buff+([%1]*2) ; Pass offset of the buffer to read ID into, 2 is the scale
mov edx, 3 ; Pass number of bytes to read at one pass
int 80h ; call sys_read to fill the buffer
%endmacro
マクロは、別のマクロ内でこれによって呼び出されます。
IdPrompt eax ; call IdPrompt to get one ID
私はより小さなレジスタを使用してみました。また、バッファアドレスを次のように使用してみました: Buff+%1*2 運が悪い