Skip to content

Commit b3358fe

Browse files
author
H. Peter Anvin
committed
insns.dat: reinstate TEST reg,mem alias
Officially the syntax for TEST is "rm,reg"; however TEST is commutative in every aspect, and as such "reg,mem" is an equivalent form that NASM has also supported in the past. Reinstate it properly. Fixes: https://bugzilla.nasm.us/show_bug.cgi?id=3392962 Reported-by: E. C. Masloch <pushbx@ulukai.org> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1 parent 2bb275d commit b3358fe

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

travis/test/testmem.asm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bits 64
2+
3+
test al,[rbx]
4+
test ax,[rbx]
5+
test eax,[rbx]
6+
test rax,[rbx]
7+
8+
test cl,[rbx]
9+
test cx,[rbx]
10+
test ecx,[rbx]
11+
test rcx,[rbx]

travis/test/testmem.bin.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
�f��H�� f� � H�

travis/test/testmem.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"description": "Test TEST reg,mem instruction alias",
4+
"id": "testmem",
5+
"format": "bin",
6+
"source": "testmem.asm",
7+
"target": [
8+
{ "output": "testmem.bin" }
9+
]
10+
}
11+
]

x86/insns.dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ $arith nf=nf ADD OR nf=,ADC nf=,SBB AND SUB XOR nf=,!evex,CMP
7373

7474
;# Bitwise testing
7575
$bwdq TEST rm#,reg# [mr: o# 84# /r ] 8086,SM
76+
$bwdq TEST reg#,mem# [rm: o# 84# /r ] 8086,SM,ND
7677
$bwdq TEST ax#,imm# [-i: o# a8# i# ] 8086,SM,NOAPX
7778
$bwdq TEST rm#,imm# [mi: o# f6# /0 i# ] 8086,SM
7879

0 commit comments

Comments
 (0)