Not strictly a bug, the code is correct. However djasm should pick the optimal
opcode.
I work with the CVS code, but I'm sure this is present from day 1.
This code is selfexplatory, I hope:
.type "com"
.org 0x100
start:
cmpw [bx], 0 ; Generates op codes 0x81, 0x3f, 0,0
; More compactly coded as:
.db 0x83, 0x3f, 0
cmpd [bx], 0 ; Generates op codes 0x66, 0x81, 0x3f, 0,0,0,0.
; More compactly coded as:
.db 0x66, 0x83, 0x3f, 0
cmp bx, 0 ; This does generate opcode 0x83.
cmp ebx, 0 ; This does generate opcode 0x83.
; cmpw bx, 0 ; Doesn't assemble.
; cmpd ebx, 0 ; Doesn't assemble.