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.

Posicionar ca<strong>de</strong>na indicada por el usuario en coor<strong>de</strong>nadas<br />

indicadas por el usuario<br />

TITLE Ca<strong>de</strong>na que solicita una ca<strong>de</strong>na y una posición para mostrarla<br />

gotoxy macro fila,col<br />

mov ah,02h<br />

mov dh,fila<br />

mov dl,col<br />

mov bh,0h<br />

int 10h<br />

endm<br />

pantalla macro que<br />

mov ah,02h<br />

mov dl,que<br />

int 21h<br />

endm<br />

imprime macro eztryng<br />

mov dx,offset eztryng<br />

mov ah,9<br />

int 21h<br />

endm<br />

DATOS SEGMENT PARA PUBLIC<br />

mensaje DB "INGRESE UN CARACTER: ",13,10,"$"<br />

mensaje2 DB "INGRESE X <strong>de</strong>l 0 al 9: ",13,10,"$"<br />

mensaje3 DB "INGRESE Y <strong>de</strong>l 0 al 9: ",13,10,"$"<br />

caracter DB 40<br />

varx DB ?<br />

vary DB ?<br />

vtext db 100 dup('$')<br />

DATOS ENDS<br />

CODIGO SEGMENT PARA PUBLIC 'co<strong>de</strong>'<br />

ASSUME CS:CODIGO,DS:DATOS<br />

startup:<br />

mov ax,DATOS<br />

mov ds,ax<br />

imprime mensaje<br />

mov si,00h<br />

leer:<br />

79

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

Saved successfully!

Ooh no, something went wrong!