Documentos de Académico
Documentos de Profesional
Documentos de Cultura
page 60,132
;---------------------------------------------------------------------
title SOPA DE LETRAS
;---------------------------------------------------------------------
; Descripcion del programa:
comment* El siguiente programa desarrolla un juego conocido como sopa de letras
pero con algunas restricciones, las oraciones que estan ocultas ya estan definidas
en el segmento de datos, y estas se habilitan tecleando la letra inicial de cada
oracion, se presiona la tecla r para salir del programa"*
; Autor: Acarapi Quispe Rodrigo Ronald
;---------------------------------------------------------------------
; SEGMENTO DE PILA (STACK SEGMENT)
;---------------------------------------------------------------------
pila segment para stack 'stack'
dw 32 dup(0)
pila ends
;---------------------------------------------------------------------
; SEGMENTO DE DATOS (DATA SEGMENT)
;---------------------------------------------------------------------
datos segment para 'data'
mensaje db " S H M I F D F G D H H
E F F V A M O S N O S "
db " E G F S H F T U P A Z L
F G N B M K J H D G Y S "
db " L R Q I U H G H F B V A E
Q M L D X C V B Y H R D S "
db " Q W E U F D G T H Y J B B G
F D C X Z L K J I O P Y T U "
db " ? S D F I E W Q R T G O H U J
I K O L P Y T R G E F G G R T "
db " F U J K I E H M I F D R G D H H
E F F P E D F D N B B T D W D F "
db " D F R G G R Y J U Y A S D S W E
D G T H N B V D C X Z A S H G J "
db " L P O P O E I U J T N B G T R F
V T G B Y H N R F E D C X S W Q "
db " Z S X C D N V B O M J H Y U I O
L K J H G F R D E S W Q D E R T "
db " R G F T Y H U R K L I O P A Z X
C B R G E F R T U J D V B N W S "
db " L F G T H Y I U K P F H D V D E
G H A C E R V D W H J K X D H R "
db " F G T H Y O J K N M B F D C D D
F G V C S X Z ? O J I P K J H G "
db " G T H Y ? J Y J H G F A Z Q W X
M L F P J H G T V F D Z A C ! F "
db " ? A W S D E R G F Y T N V M K !
D ? Q W R F 1 R G C B R H G A ? "
db " P O I U Y H J K L D M N G B R
F V C D E S W V B G T H U I O "
db " A Z A X S W D E F V B G T Y
H N M T E M P R A N O A Z D "
db " G T H Y U J K I D G F B C
E R T Y P O Z X C S D V C "
db " Q W E R E R E Y U I P K
Z F C D S B V G R F S W "
db " ? Q R G D H V C L O P
A S F V R E H Y D D T ","$"
text1 db "QUIEREN"
text2 db "HACER"
text3 db "SU"
text4 db "LABORATORIO?"
text5 db "NOS"
text6 db "VAMOS"
text7 db "TEMPRANO"
datos ends
;----------------------------------------------------------------------
; SEGMENDO DE CODIGO (CODE SEGMENT)
;----------------------------------------------------------------------
codigo segment para 'code'
programa proc far
assume ss:pila,cs:codigo,ds:datos,es:datos
push ds
sub ax,ax
push ax
mov ax,datos
mov es,ax
mov ds,ax
cmp al,'q'
je sis1
cmp al,'h'
je sis2
cmp al,'s'
je sis3
cmp al,'l'
je sis4
cmp al,'n'
je sis5
cmp al,'v'
je sis6
cmp al,'t'
je sis7
cmp al,'r'
je chau
jmp inicio
sis1:
call leerQ
jmp inicio
sis2:
call leerH
jmp inicio
sis3:
call leerS
jmp inicio
sis4:
call leerL
jmp inicio
sis5:
call leerN
jmp inicio
sis6:
call leerV
jmp inicio
sis7:
call leerT
jmp inicio
chau:
mov ax,4C00h
int 21h
ret
programa endp
;----------------------------------------------------------------------
; BORRA LA PANTALLA
;----------------------------------------------------------------------
borrar proc
ret
borrar endp
;-----------------------------------------------------------------------
; DIBUJAMOS LA SOPA DE LETRAS
;-----------------------------------------------------------------------
sopa proc
ret
sopa endp
;-----------------------------------------------------------------------
; APARECE MENSAJE "QUIEREN"
;-----------------------------------------------------------------------
leerQ proc
mov ah,09h
mov al,[di]
mov bh,0
mov bl,70h
mov cx,1
int 10h
inc di
inc dh
call pocur
pop cx
loop nuevaq
ret
leerQ endp
;-----------------------------------------------------------------------
; APARECE MENSAJE "HACER"
;-----------------------------------------------------------------------
leerH proc
mov ah,09h
mov al,[di]
mov bh,0
mov bl,70h
mov cx,1
int 10h
inc di
inc dl
inc dl
call pocur
pop cx
loop nuevah
ret
leerH endp
;-----------------------------------------------------------------------
; APARECE MENSAJE "SU"
;-----------------------------------------------------------------------
leerS proc
mov ah,09h
mov al,[di]
mov bh,0
mov bl,70h
mov cx,1
int 10h
inc di
inc dl
inc dh
inc dl
call pocur
pop cx
loop nuevas
ret
leerS endp
;-----------------------------------------------------------------------
; APARECE MENSAJE "LABORATORIO?"
;-----------------------------------------------------------------------
leerL proc
mov ah,09h
mov al,[di]
mov bh,0
mov bl,70h
mov cx,1
int 10h
inc di
dec dl
inc dh
dec dl
call pocur
pop cx
loop nueval
ret
leerL endp
;-----------------------------------------------------------------------
; APARECE MENSAJE "NOS"
;-----------------------------------------------------------------------
leerN proc
mov ah,09h
mov al,[di]
mov bh,0
mov bl,70h
mov cx,1
int 10h
inc di
inc dl
inc dl
call pocur
pop cx
loop nuevan
ret
leerN endp
;-----------------------------------------------------------------------
; APARECE MENSAJE "VAMOS"
;-----------------------------------------------------------------------
leerV proc
mov ah,09h
mov al,[di]
mov bh,0
mov bl,70h
mov cx,1
int 10h
inc di
inc dl
inc dl
call pocur
pop cx
loop nuevav
ret
leerV endp
;-----------------------------------------------------------------------
; APARECE MENSAJE "TEMPRANO"
;-----------------------------------------------------------------------
leerT proc
mov ah,09h
mov al,[di]
mov bh,0
mov bl,70h
mov cx,1
int 10h
inc di
inc dl
inc dl
call pocur
pop cx
loop nuevat
ret
leerT endp
;-----------------------------------------------------------------------
; POSICIONA EL CURSOR
;-----------------------------------------------------------------------
pocur proc
ret
pocur endp
;-----------------------------------------------------------------------
codigo ends
;-----------------------------------------------------------------------
end programa