delorie.com/djgpp/bugs/show.cgi   search  
Bug 000371

When Created: 05/15/2005 04:19:16
Against DJGPP version: cvs
By whom: ams@ludd.ltu.se
Abstract: Not optimal opcode selected
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.



  webmaster     delorie software   privacy  
  Copyright © 2010   by DJ Delorie     Updated Jul 2010