* wrong opcode?
@ 2002-06-14 17:27 kieft_brian
2002-06-14 19:06 ` Peter Barada
2002-06-14 20:18 ` Andreas Schwab
0 siblings, 2 replies; 3+ messages in thread
From: kieft_brian @ 2002-06-14 17:27 UTC (permalink / raw)
To: linux-assembly, binutils
I curious as to why the code generated for these two move.w commands is
completely different. In the first assembly I used two variables (one equal to 0
and the other equal to 8). I tried doing a move using the variables added
together as my offset to register A1 and managed to get 33B9 0000 0000 0170 0000
0008. When I simply put an 8 in instead of the variables, I got the correct
code. 3379 0000 0000 0008. Any ideas??????
I'm using gnu as on a pc-cygwin system with a m68k target.
3901 034a 0000 0008 .DC.L C_WCP1_MSG_PARM
3902 034e 0000 0000 .DC.L HWPN_PARM_OFS
3903 0352 33B9 0000 MOVE.W SYS_SYS_VERS_W,C_WCP_MSG_PARM+HWPN_PARM_OFS(%A1)
3903 0000 0170
3903 0000 0008
3901 034a 0000 0008 .DC.L C_WCP1_MSG_PARM
3902 034e 0000 0000 .DC.L HWPN_PARM_OFS
3904
3905 0352 3379 0000 MOVE.W M_SYS_SYS_VERS_W,8(%A1)
3905 0000 0008
3906
**********************************************************************
This e-mail and any files transmitted with it are confidential and may
be legally privileged or otherwise exempt from disclosure under
applicable law. This e-mail and its files are intended solely for
the individual or entity to whom they are addressed and their content
is the property of Smiths Aerospace. If you are not the intended
recipient, please do not read, copy, use or disclose this communication.
If you have received this e-mail in error please notify the e-mail
administrator at postmaster@si.com and then delete this e-mail, its
files and any copies.
This footnote also confirms that this e-mail message has been scanned
for the presence of known computer viruses.
***********************************************************************
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: wrong opcode?
2002-06-14 17:27 wrong opcode? kieft_brian
@ 2002-06-14 19:06 ` Peter Barada
2002-06-14 20:18 ` Andreas Schwab
1 sibling, 0 replies; 3+ messages in thread
From: Peter Barada @ 2002-06-14 19:06 UTC (permalink / raw)
To: kieft_brian; +Cc: linux-assembly, binutils
>I curious as to why the code generated for these two move.w commands
>is completely different. In the first assembly I used two variables
>(one equal to 0 and the other equal to 8). I tried doing a move using
>the variables added together as my offset to register A1 and managed
>to get 33B9 0000 0000 0170 0000 0008. When I simply put an 8 in
>instead of the variables, I got the correct code. 3379 0000 0000
>0008. Any ideas??????
>
>I'm using gnu as on a pc-cygwin system with a m68k target.
>
>
>3901 034a 0000 0008 .DC.L C_WCP1_MSG_PARM
> 3902 034e 0000 0000 .DC.L HWPN_PARM_OFS
> 3903 0352 33B9 0000 MOVE.W SYS_SYS_VERS_W,C_WCP_MSG_PARM+HWPN_PARM_OFS(%A1)
> 3903 0000 0170
> 3903 0000 0008
>
>
>
> 3901 034a 0000 0008 .DC.L C_WCP1_MSG_PARM
> 3902 034e 0000 0000 .DC.L HWPN_PARM_OFS
> 3904
> 3905 0352 3379 0000 MOVE.W M_SYS_SYS_VERS_W,8(%A1)
> 3905 0000 0008
> 3906
From what I see, in the case of 0x33b9, its using mode 6 for the
destination which with the extension word of 0x0170 that
decodes(look at page 2-2 of the MC68000 Family Programmer's Reference
Manual) into a full extension word format where:
D/A = 0
REG = 0
W/L = 0
SCALE = 0
BS = 0
IS = 1
BDSIZE = 3
I/IS = 0
Which means that the index register is suppressed, the base register
is not suppressed, the base displacement size is 32 bits, I/S
indicates that no memory indirection is done(so its not pre-indexed or
post-indexed), so this is equivilent to addressing mode 5 but with a
32 bit displacement instead of the 16 bits that mode 5 supports.
I think that this addressing mode is being picked since the assembler
sees the expression C_WCP_MSG_PARM+HWPN_PARM_OFS and determines that
the resulting expression contains 32 bits of significance(including
all possible relocation) and hence can't stuff it into addressing mode 5.
Check how C_WCP_MSG_PARM and HWPN_PARM_OFS are being declared. is it
with .equ, or is one of them a label(which requires 32 bits of
significance to allow its relocation anywhere in the 4GB address space)?
Hope this helps...
--
Peter Barada Peter.Barada@motorola.com
Wizard 781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola) 781-270-0193 (fax)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: wrong opcode?
2002-06-14 17:27 wrong opcode? kieft_brian
2002-06-14 19:06 ` Peter Barada
@ 2002-06-14 20:18 ` Andreas Schwab
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2002-06-14 20:18 UTC (permalink / raw)
To: kieft_brian; +Cc: linux-assembly, binutils
<kieft_brian@si.com> writes:
|> I curious as to why the code generated for these two move.w commands is
|> completely different. In the first assembly I used two variables (one equal to 0
|> and the other equal to 8). I tried doing a move using the variables added
|> together as my offset to register A1 and managed to get 33B9 0000 0000 0170 0000
|> 0008. When I simply put an 8 in instead of the variables, I got the correct
|> code. 3379 0000 0000 0008. Any ideas??????
|>
|> I'm using gnu as on a pc-cygwin system with a m68k target.
|>
|>
|> 3901 034a 0000 0008 .DC.L C_WCP1_MSG_PARM
|> 3902 034e 0000 0000 .DC.L HWPN_PARM_OFS
|> 3903 0352 33B9 0000 MOVE.W SYS_SYS_VERS_W,C_WCP_MSG_PARM+HWPN_PARM_OFS(%A1)
|> 3903 0000 0170
|> 3903 0000 0008
The other opcode is not wrong, it just uses the 32bit offset form. How
are C_WCP_MSG_PARM and HWPN_PARM_OFS defined? Please provide a complete,
self-contained test case.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-06-14 20:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-14 17:27 wrong opcode? kieft_brian
2002-06-14 19:06 ` Peter Barada
2002-06-14 20:18 ` Andreas Schwab
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.