/* * fp_scan.S * * Copyright Roman Zippel, 1997. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * ALTERNATIVELY, this product may be distributed under the terms of * the GNU General Public License, in which case the provisions of the GPL are * required INSTEAD OF the above restrictions. (This clause is * necessary due to a potential bad interaction between the GPL and * the restrictions contained in a BSD-style copyright.) * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "fp_emu.h"
#include "fp_decode.h"
.globl fp_scan, fp_datasize
.data
| %d2 - first two instr words
| %d1 - operand size
/* operand formats are:
Long = 0, i.e. fmove.l Single, i.e. fmove.s Extended, i.e. fmove.x Packed-BCD, i.e. fmove.p Word, i.e. fmove.w Double, i.e. fmove.d
*/
.text
| On entry:
| FPDATA - base of emulated FPU registers
fp_scan:
| normal fpu instruction? (this excludes fsave/frestore)
fp_get_pc %a0
printf PDECODE,"%08x: ",1,%a0
getuser.b (%a0),%d0,fp_err_ua1,%a0
#if 1
cmp.b #0xf2,%d0 | cpid = 1
#else
cmp.b #0xfc,%d0 | cpid = 6
#endif
jne fp_nonstd
| first two instruction words are kept in %d2
getuser.l (%a0)+,%d2,fp_err_ua1,%a0
fp_put_pc %a0
fp_decode_cond: | separate conditional instr
fp_decode_cond_instr_type
| now all arithmetic instr and a few move instr are left
fp_fgen_fp: | source is a fpu register clr.b (FPD_FPSR+2,FPDATA) | clear the exception byte
fp_decode_sourcespec
printf PDECODE,"f.x fp%d",1,%d0
fp_get_fp_reg
lea (FPD_TEMPFP1,FPDATA),%a1 | copy src into a temp location
move.l (%a0)+,(%a1)+
move.l (%a0)+,(%a1)+
move.l (%a0),(%a1)
lea (-8,%a1),%a0
jra fp_getdest
fp_fgen_ea: | source is <ea> clr.b (FPD_FPSR+2,FPDATA) | clear the exception byte
| sort out fmovecr, keep datasize in %d1
fp_decode_sourcespec
cmp.w #7,%d0
jeq fp_fmovecr
move.w %d0,%d1 | store datasize twice in %d1
swap %d1 | one can be trashed below
move.w %d0,%d1
#ifdef FPU_EMU_DEBUG
lea 0f,%a0 clr.l %d0
move.b (%a0,%d1.w),%d0
printf PDECODE,"f.%c ",1,%d0
basically, we end up with a pointer to the source operand in %a1, and a pointer to the destination operand in %a0. both are, of course, 96-bit extended floating point numbers.
*/
fp_getsource:
| decode addressing mode for source
fp_decode_addr_mode
| all other indirect addressing modes will finally end up here
fp_extmode0:
fp_mode_addr_indirect_extmode0
jra fp_fetchsource
| all pc relative addressing modes and immediate/absolute modes end up here
| the first ones are sent to fp_extmode0 or fp_disp16
| and only the latter are handled here
fp_extmode1:
fp_decode_addr_reg
jmp ([0f:w,%pc,%d0*4])
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.