Operaciones Basicas En Ensamblador

  • Uploaded by: Jose Ake
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Operaciones Basicas En Ensamblador as PDF for free.

More details

  • Words: 531
  • Pages: 4
.model small .stack .data men db 13,10, "Jose Zeusasis Ake Ake $" men1 db 13,10, "Ingrese el primer Numero: $" men2 db 13,10, "Ingrese el segundo Numero: $" men3 db 13,10, "Suma: $" men4 db 13,10, "Resta: $" men5 db 13,10, "Multiplicacion: $" men00 db "Numeros muy grandes, no pueden multiplicarse... $" men6 db 13,10, "Division: $" num1 dw ? num2 dw ? a dw b dw c db d db divi

10000 1000 100 10 dw ?

.code mov ax, @data mov ds, ax mov ah, 09h lea dx, men int 21h mov ah, 09h lea dx, men1 int 21h mov int sub mov mul mov

ah, 1 21h al, 30h ah, 0 a num1, ax

mov int mov sub mul add

ah, 1 21h ah, dl al, 30h b num1, ax

mov int sub mul add

ah, 1 21h al, 30h c num1, ax

mov int sub mul

ah, 1 21h al, 30h d

add num1, ax mov int sub mov add

ah, 1 21h al, 30h ah, 0 num1, ax

;Pedir 2do Numero mov ah, 09h lea dx, men2 int 21h mov int sub mov mul mov

ah, 1 21h al, 30h ah, 0 a num2, ax

mov int mov sub mul add

ah, 1 21h ah, dl al, 30h b num2, ax

mov int sub mul add

ah, 1 21h al, 30h c num2, ax

mov int sub mul add

ah, 1 21h al, 30h d num2, ax

mov int sub mov add

ah, 1 21h al, 30h ah, 0 num2, ax

;Mensaje para el resultado ;Suma mov ah, 09h lea dx, men3 int 21h ;Realizar operaciones para desglozar el num mov ax, num2 add ax, num1 xor cx, cx mov bx, 10

Valor: xor dx, dx div bx push dx inc cx test ax, ax jnz Valor

;Introducir el valor a la pila

Mostrar: pop dx add dl, 30h ;Convertir a caracter cada valor de la pila mov ah, 02h int 21h loop Mostrar

;Resta mov ah, lea dx, int 21h mov ax, sub ax,

09h men4 num1 num2

xor cx, cx mov bx, 10 val: xor dx, dx div bx push dx inc cx test ax, ax jnz val

;Introducir el valor a la pila

most: pop dx add dl, 30h ;Convertir a caracter cada valor de la pila mov ah, 02h int 21h loop most ;Multiplicacion mov ah, 09h lea dx, men5 int 21h mov ah, 09h lea dx, men00 int 21h ; mov ax, num1 ; mov bx, num2 ;

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

mul bx xor cx, cx mov bx, 10 valu: xor dx, dx div bx push dx inc cx test ax, ax jnz valu

;Introducir el valor a la pila

muest: pop dx add dl, 30h ;Convertir a caracter cada valor de la pila mov ah, 02h int 21h loop muest

;Division mov ah, 09h lea dx, men6 int 21h xor mov mov mov div

ax, ax, bx, ax, bx

ax num2 ax num1

mov divi, ax mov add mov int

dx, divi dl, 30h ah, 02h 21h

mov ah, 4ch int 21h

Related Documents


More Documents from "endermelean"