04.06.2013 Views

PRÁCTICA 13

PRÁCTICA 13

PRÁCTICA 13

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LENGUAJE ENSAMBLADOR 80386 <strong>PRÁCTICA</strong> <strong>13</strong><br />

@@170:<br />

mov di,offset CadIN ;valor de –infinito<br />

mov cx,LonIN<br />

@@200:<br />

xchg si,di ;SI = cadena enlatada<br />

push di, ;DI = área del llamador<br />

rep movsb ;copia cadena enlatada<br />

pop si ;restaura SI<br />

fstp st(0) ;descarta valor original<br />

jmp @@80<br />

TipoTab dw @@140 ;0000 +anormal<br />

dw @@150 ;0001 +NaN<br />

dw @@140 ;0010 –anormal<br />

dw @@150 ;0011 -NaN<br />

dw @@10 ;0100 +normal<br />

dw @@160 ;0101 +infinito<br />

dw @@10 ;0110 –normal<br />

dw @@170 ;0111 –infinito<br />

dw @@100 ;1000 +cero<br />

dw @@120 ;1001 vacío<br />

dw @@110 ;1010 –cero<br />

dw @@120 ;1011 vacío<br />

dw @@<strong>13</strong>0 ;1100 +denormal<br />

dw @@120 ;1101 vacío<br />

dw @@<strong>13</strong>0 ;1110 –denormal<br />

dw @@120 ;1111 vacío<br />

ENDP ftoa<br />

;<br />

; DIGIT: Convierte el nibble bajo en AL a un dígito ASCII y lo salva en dirección dada por ES:DI<br />

; Llamar con: AL = valor a convertir en bits 0-3<br />

; ES:DI =dirección donde poner carácter ASCII<br />

; Retorna: AL = sin cambio<br />

; ES:DI = dirección+1<br />

;<br />

PROC digit ;nibble a dígito ASCII<br />

push ax ;salva registro<br />

add al,’0’ ;convierte a carácter ASCII<br />

stosb ;salva el carácter<br />

pop ax ;restaura registro<br />

ret<br />

ENDP digit<br />

end ;fin de módulo FTOA.ASM<br />

AUTOR: PROFESOR SALVADOR SAUCEDO FLORES<br />

EDICIÓN: PROFESOR PABLO FUENTES RAMOS<br />

<strong>13</strong>-10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!