The assembly code below is equivalent to:


It is generated code so don't worry about inefficiency. My problem is when I use the sete command I get the error "error: invalid combination of opcode and operands". Here is the code:

[list -]
%include ''
[list +]

section .bss use32
section .data use32
section .code use32
	cpu 386

extern WriteFile
extern GetStdHandle
extern ExitProcess
import WriteFile kernel32.dll
import GetStdHandle kernel32.dll
import ExitProcess kernel32.dll

section .code

call	[GetStdHandle]			;Get stdout
mov	 [stdout_handle], eax	  ;Save the handle

mov		eax, 1
mov		[A], eax
mov		eax, 1
mov		[B], eax
mov		eax, [A]
push 	eax
mov		eax, [B]
pop		ebx
cmp 	eax, ebx
sete 	eax
test 	eax, 0
jz	L0
mov		eax, 2
push	eax
mov		eax, 2
pop		ebx
add		eax, ebx
mov		[X], eax
add		dword [X], 48

;Write a message to stdout
push	dword 0
push	dword 0
push	dword textlen
push	dword X
push	dword [stdout_handle]
call	[WriteFile]
jmp exit

push	dword 0					;Point at error code
call	[ExitProcess]
jmp		exit					;Should never reach here

section .data

stdout_handle	dd	0
string			dd	0
textlen			equ	$ - string
A			dd 0
X			dd 0
B			dd 0

What am I doing wrong?

Nevermind, the operand needs to be 16 bits, not 32.