Você está na página 1de 4

ESCUELA POLITECNICA NACIO NAL SISTEMAS MICROPROCESADOS NOMBRE: Wil mer Villegas FECHA: 03 04 2012 Realizar un programa para

ra convertir de binario a bcd por el mtodo de sumas y desplazamientos .


.i ncl ud e" m1 6 4 p d e f.i n c" .eq u n1 =8 .eq u n2 =3 .eq u n3 =4 8 .d e f .d e f .d e f .d e f .d e f .d e f .d e f co n ta=r 1 7 B CD_ T EMP O =r 1 8 n u m=r 1 9 B CD L=r 2 0 B CD H=r 2 1 s u m1 =r 2 2 s u m2 =r 2 3 s ub i B C D_ T EMP O,0 b 0 0 0 0 0 1 0 1 b rlo p ri me ra rcal l s u ma3 p ri mera : MOV B C D_ T EMP O,B C D L and i B CD_ T EMP O ,0 b 1 1 1 1 0 0 0 0 s ub i B C D_ T EMP O,8 0 b rlo se g u nd o rcal l s u ma3 0 se g u nd o : d ec co n ta b rne CO NVE R SI ON1 rj mp fi n s u ma3 : ld i n u m,2 1 5 ld i co n ta, n1 LDI B CD L,0 LDI B CD H,0 ld i B C D_ T EMP O,0 ld i s u m1 , n2 ld i s u m2 , n3 CO NV E RSI ON1 : ls l n u m ro l B CD L RO L B CD H MOV B C D_ T EMP O,B C D L and i B CD_ T EMP O ,0 b 0 0 0 0 1 1 1 1 ad d B C D L, SU M2 sb rc B C D L,7 RET RO L B CD H ret fi n: rj mp fi n ad d B C D L, s u m1 sb rc B C D L,3 RET RO L B CD H ret s u ma3 0 :

.o rg 0 x0 0 ld i r1 6 , lo w( r a me nd ) o ut sp l,r1 6 ld i r1 6 , h i g h( r a me nd ) o ut sp h ,r1 6

Você também pode gostar