19.04.2018 Views

Tutorial de ensamblador

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Programa con directivas simplificadas <strong>de</strong> segmento<br />

.MODEL SMALL<br />

.STACK 100H<br />

.DATA<br />

Es otra manera <strong>de</strong> <strong>de</strong>clarar los segmentos. En esta, como se mencionó<br />

anteriormente, no es necesario indicar el final <strong>de</strong> los segmentos. Ensamblador lo<br />

hace automáticamente en cuanto encuentra otro punto. Para terminar el segmento<br />

<strong>de</strong> código, se termina cerrando una etiqueta.<br />

Cambiar modo <strong>de</strong> vi<strong>de</strong>o<br />

MOV AH,0FH<br />

INT 10H<br />

La primera línea cambia el modo <strong>de</strong> vi<strong>de</strong>o. Nótese que se está asignando a<br />

la parte alta <strong>de</strong>l registro acumulador.<br />

MOV AH,0H<br />

INT 10H<br />

Limpia la pantalla. Borra el texto que había y lo <strong>de</strong>ja vacío.<br />

Validación <strong>de</strong> entrada <strong>de</strong> teclado<br />

MOV AH,0AH<br />

INT 21H<br />

Este código pi<strong>de</strong> la entrada <strong>de</strong> un Enter.<br />

MOV AH, 0<br />

Int 16h<br />

Esta línea espera a que el usuario presione cualquier tecla. La Interrupción<br />

16H hace que, mientras no se presione alguna tecla, el programa no continúe.<br />

88

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

Saved successfully!

Ooh no, something went wrong!