From f2a4cb0a0edc95ae74816275e82b4ade71c6f37a Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 16 May 2016 05:10:21 +0200 Subject: x86-asm: Reject some invalid arith imm8 instruction There were two errors in the arithmetic imm8 instruction. They accept only REGW, and in case the user write a xxxb opcode that variant needs to be rejected as well (it's not automatically rejected by REGW in case the destination is memory). --- tests/asmtest.S | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/asmtest.S') diff --git a/tests/asmtest.S b/tests/asmtest.S index a221126..fd0629c 100644 --- a/tests/asmtest.S +++ b/tests/asmtest.S @@ -158,6 +158,22 @@ addl $0x123, %eax add $0x123, %ebx add $-16, %ecx add $-0x123, %esi +add $1, %bx +add $1, %ebx +add $-1, %bx +add $-1, %ebx +add $127, %bx +addl $127, %ebx +addl $-128, %ebx +addl $-128, %ebx +addl $-129, %ebx +addl $128, %ebx +addl $255, %ebx +addl $256, %ebx +andb $0xf, %ah +andb $-15, %cl +xorb $127, %dh +cmpb $42, (%eax) addl $0x123, 0x100 addl $0x123, 0x100(%ebx) addl $0x123, 0x100(%ebx,%edx,2) -- cgit v1.3.1