;--------------------------------------------------------------------------------------------------
: PROGRAMA: pe24_mul
; FUNCION:
Multimplicacion de dos numeros
; REALIZADO POR:
Jose Juan Muñiz Hdz
; FECI-IA : jueves
27 abril 2017
;--------------------------------------------------------------------------------------------------
.model small ;Modelo
de memoria m?s utilizado
.stack
.data definici?n de
datos(variables), donde se almacenara informaci?n
. code
chr1 db?
chr2 db?
chr3 db?
r1 db?
r2 db?
ac db0
. startup
; cls
mov ah,00h
;Function(Set video mode)
mov al,03 ;Mode 80x25
8x8 16
int 10h :Interruption
Video
mov ah,01h
Function(character read)
int 21h ;lnterruption
DOS functions
sub aI,30h
;ajustamos valores
mov chr1,aI
,[chr1]chr2 * chr3 = ac.r1.r2
mov ah,02h
;Function(character read)
int 21h ;lnterruption
DOS functions
sub aI,30h Ajustamos
valores
mov chr2,al ;chr1.[chr2]* chr3 = ac.r1.r2
mov ah,02h ;Function(character to send to standard output)
mov dl,'*' ;Character
to show
int 21h
mov ah,01h
Function(Read character)
int 21h ;lnterruption
DOS Functions
sub al,30h
;Transform(Odec= 30hex)
mov chr3,al
;chr1.chr2 * [chr3]= ac.r1.r2
mov ah,02h
;Character to send to standar output
mov dl,'' ;
int 21h :lnterruption
DOS functions
; Realizamos
operaci?n
mov al,chr3 ;al =
chr3
mov bl,chr2 ;bl =
chr2
mul bl ;AL chr3*chr2
(BL*AL)
Mov Ah,0h ;
AAM ASCII Adjusment
mov ac,AH ;ac = AH
(Acarreo)
mov r2,AL ;r2 = AL
(Unidad del resultado)
mov al,chr3 ;AL =
chr3
mov bl,chr1 ;BL =
chr1
mul bl AL =
chr1*chr3 (BL*AL)
mov r1 ,aL ;r1 = AL
(Decena del resultado)
mov bl,ac ;BL =
Acarreo anterior
add r1 ,bl ;r1 =
r1+ac (r1 + Acarreo)
mov ah,00h ;
mov al,r1 ;AL = r1 (Asignaci?n para el ajust)
AAM ;ASCll Adjustment
mov r1,al ;r1=AL
mov ac,ah ;ac = AH
(Acarreo para Ia Centena del resultado)
; Mostramos
resultado
mov ah,02h
mov dl,ac
add dl,30h
int 21h ;Mostramos ac
(Centena)
mov ah,02H
mov dl,r1
add dl,30h
int 21h ;Mostramos rl
(Decena)
mov ah,02H
mov dl,r2
add dl,30h
int 21h ;Mostramos r2
(Unidad)
.exit
end
0 comentarios:
Publicar un comentario