Cuestion 17 (MC68000, programa ensamblador)

Image 2005Jun1BC17
Solucion:


    0000 1111 0101 1111
AND   0000 0100 1100 0011
    0000 0100 0100 0011

\begin{displaymath}0000\,0100\,0100\,0011=\underbrace{0000}_{0}\underbrace{0100}_{4}\underbrace{0100}_{4}\underbrace{0011}_{3}=\$0443\end{displaymath}




\begin{displaymath}D2=\$ 000F\,0443\end{displaymath}



Vamos a comprobarlo con el Mathematica:

z1 := 16^^000F0481 + 16^^00000042
BaseForm[z1, 16]
z2 := 16^^04c3
z3 := 16^^0f5f
IntegerDigits[z2, 2]
IntegerDigits[z3, 2]
z4 := {0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1}
z5 := {1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1}
z6 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
For[i = 1, i < 13, i++, z6[[i]] = BitAnd[z4[[i]], z5[[i]]]]
FromDigits[z6]
BaseForm[2^^10001000011, 16]


Vamos a compilar el programa ensamblador con el ESy68k:

*-----------------------------------------------------------
* Program    :
* Written by :
* Date       :
* Description:
*-----------------------------------------------------------
	
START:		ORG	$2500		; first instruction of program


INI 	EQU $F5F
    	MOVE.L #$000F0481,D2
    	ADD.L ET,D2
    	AND.W #INI,D2
 
* Variables and Strings
ET	DC.L	$42


	END	START		; last line of source



Image 2005Jun1AC16b




2011-07-31