9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: quanstro@labs.coraid.com
Cc: 9fans@9fans.net
Subject: [9fans] MOVLQSX wrong operand order
Date: Fri, 17 Jan 2014 21:07:45 +0100	[thread overview]
Message-ID: <16c90927387c0a9664e3f4c14e0736b3@felloff.net> (raw)

just disassembled some code generated by 6c
and found something funny. the debugger seems
to print the operands of MOVLQSX in the wrong
order.

output of 6c -S:

	MOVLQSX	BP,CX
	ADDQ	CX,AX
	RET	,

output of acid:

foo+0x1a 0x00200042	MOVLQSX	CX,BP
foo+0x1d 0x00200045	ADDQ	CX,AX
foo+0x20 0x00200048	RET

fix:

diff -r 4e094627d459 sys/src/libmach/8db.c
--- a/sys/src/libmach/8db.c	Tue Jan 14 00:22:13 2014 +0100
+++ b/sys/src/libmach/8db.c	Fri Jan 17 21:06:42 2014 +0100
@@ -1223,7 +1223,7 @@
 [0xfd]	0,0,		"STD",
 [0xfe]	RMOPB,0,	optabFE,
 [0xff]	RMOP,0,		optabFF,
-[0x100]	RM,0,		"MOVLQSX	%r,%e",
+[0x100]	RM,0,		"MOVLQSX	%e,%r",
 };

--
cinap



             reply	other threads:[~2014-01-17 20:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 20:07 cinap_lenrek [this message]
2014-01-17 20:40 ` erik quanstrom
2014-01-17 21:07 ` Steven Stallion

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16c90927387c0a9664e3f4c14e0736b3@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9fans@9fans.net \
    --cc=quanstro@labs.coraid.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).