/* The operand to a branch insn indicates an absolute branch. */
bool jumpabsolute;
+ /* There is a memory operand of (%dx) which should be only used
+ with input/output instructions. */
+ bool input_output_operand;
+
/* Extended states. */
enum
{
i.disp_operands = 0;
}
+ /* The memory operand of (%dx) should be only used with input/output
+ instructions (base opcodes: 0x6c, 0x6e, 0xec, 0xee). */
+ if (i.input_output_operand
+ && ((i.tm.base_opcode | 0x82) != 0xee
+ || i.tm.opcode_modifier.opcodespace != SPACE_BASE))
+ {
+ as_bad (_("input/output port address isn't allowed with `%s'"),
+ i.tm.name);
+ return;
+ }
+
if (optimize && !i.no_optimize && i.tm.opcode_modifier.optimize)
optimize_encoding ();
&& !operand_type_check (i.types[this_operand], disp))
{
i.types[this_operand] = i.base_reg->reg_type;
+ i.input_output_operand = true;
return 1;
}
.*:115: Error: .*
.*:116: Error: .*
.*:117: Error: .*
+.*:119: Error: .*
+.*:120: Error: .*
+.*:121: Error: .*
+.*:122: Error: .*
[ ]*1[ ]+\.text
[ ]*2[ ]+\.allow_index_reg
[ ]*3[ ]+\# All the following should be illegal
[ ]*[1-9][0-9]*[ ]+inb %dx, %ax
[ ]*[1-9][0-9]*[ ]+outb %ax, %dx
[ ]*[1-9][0-9]*[ ]+movb %ax, %bx
+[ ]*[1-9][0-9]*[ ]+
+[ ]*[1-9][0-9]*[ ]+incl \(%dx\)
+[ ]*[1-9][0-9]*[ ]+incw \(%dx\)
+[ ]*[1-9][0-9]*[ ]+mov \(%dx\), %ax
+[ ]*[1-9][0-9]*[ ]+mov %ax, \(%dx\)
#pass
.*:117: Error: .*
.*:118: Error: .*
.*:121: Error: .*
+.*:123: Error: .*
+.*:124: Error: .*
+.*:125: Error: .*
+.*:126: Error: .*
GAS LISTING .*
[ ]*[1-9][0-9]*[ ]+
[ ]*[1-9][0-9]*[ ]+\.att_syntax prefix
[ ]*[1-9][0-9]*[ ]+movsd \(%rsi\), %ss:\(%rdi\), %ss:\(%rax\)
+[ ]*[1-9][0-9]*[ ]+
+[ ]*[1-9][0-9]*[ ]+incl \(%dx\)
+[ ]*[1-9][0-9]*[ ]+incw \(%dx\)
+[ ]*[1-9][0-9]*[ ]+mov \(%dx\), %ax
+[ ]*[1-9][0-9]*[ ]+mov %ax, \(%dx\)