programa de valeria
name "potencia"
include "emu8086.inc"
include "macroos.txt"
.model small
data segment
base dw ?
exp dw ?
resul dw ?
ends
code segment
call basic
basic proc
call start
call objetive
call capture
potencia_num
call printer
call salir
ret
basic endp
start proc
mov ax,data
mov ds,ax
mov es,ax
ret
start endp
objetive proc
printn " "
printn " "
printn " Potencia de un Numero "
ret
objetive endp
capture proc
printn " "
printn " "
printn " Dame tu numero ===> "
call scan_num
mov base,cx
printn " "
printn " "
print " dame el exponente ==> "
call scan_num
mov exp,cx
ret
capture endp
printer proc
printn " "
printn " "
print " Resultado ==> "
call print_num
ret
printer endp
salir proc
printn " "
printn " "
print " presione una tecla para continuar..."
mov ah,1
int 21h
mov ax,4c00h
int 21h
ret
salir endp
define_scan_num
define_print_string
define_print_num
define_print_num_uns
define_pthis
ends
----------------ESTA PARTE VA EN UN BLOC DE NOTAS--------------------------------------------------
POTENCIA_NUM MACRO
mov ax,1
mov bx,base
mov cx,exp
ciclo:
mul bx
loop ciclo
mov resul,ax
ENDM
include "emu8086.inc"
include "macroos.txt"
.model small
data segment
base dw ?
exp dw ?
resul dw ?
ends
code segment
call basic
basic proc
call start
call objetive
call capture
potencia_num
call printer
call salir
ret
basic endp
start proc
mov ax,data
mov ds,ax
mov es,ax
ret
start endp
objetive proc
printn " "
printn " "
printn " Potencia de un Numero "
ret
objetive endp
capture proc
printn " "
printn " "
printn " Dame tu numero ===> "
call scan_num
mov base,cx
printn " "
printn " "
print " dame el exponente ==> "
call scan_num
mov exp,cx
ret
capture endp
printer proc
printn " "
printn " "
print " Resultado ==> "
call print_num
ret
printer endp
salir proc
printn " "
printn " "
print " presione una tecla para continuar..."
mov ah,1
int 21h
mov ax,4c00h
int 21h
ret
salir endp
define_scan_num
define_print_string
define_print_num
define_print_num_uns
define_pthis
ends
----------------ESTA PARTE VA EN UN BLOC DE NOTAS--------------------------------------------------
POTENCIA_NUM MACRO
mov ax,1
mov bx,base
mov cx,exp
ciclo:
mul bx
loop ciclo
mov resul,ax
ENDM
Comentarios
Publicar un comentario