RE:programa de suma y reste
Tienes la mitad de tu programa aquí. La otra mitad la puedes hacer en 12 dias je,je.
title sumres.asm
.model small
.stack 64
.data
CR equ 13
LF equ 10
suma1 label byte
max1 db 4
tam1 db ?
ass1 db 4 dup (' ')
suma2 label byte
max2 db 4
tam2 db ?
ass2 db 4 dup (' ')
assum db '0000'
cha db ?
row db 00
col db 00
;----------------------------------------------------------------------------------------------------------------------------------------
.code
inicio:
mov ax,@data
mov ds,ax
push ds
pop es
call clean
call poscur
mov ah,0ah
lea dx,suma1 ;introduce la primer cifra (3 digitos)
int 21h
mov ah,02h
mov dl,CR
int 21h
mov ah,02h
mov dl,LF
int 21h
mov ah,0ah
lea dx,suma2 ;introduce la segunda cifra (3 digitos)
int 21h
clc
lea si,ass1+2
lea di,ass2+2
lea bx,assum+3
mov cx,03
a20:
mov ah,00
mov al,[si]
adc al,[di]
aaa
mov [bx],al
dec si
dec di
dec bx
loop a20
mov row,03
mov col,04
mov [bx],ah
lea bx,assum+3
mov cx,04
a30:
or byte ptr [bx],30h ;resulta
mov dl,[bx]
mov cha,dl
dec bx
push bx
call poscur
mov ah,02h
mov dl,cha
int 21h
dec col
pop bx
loop a30
mov ax,4c00h
int 21h
;----------------------------------------------------------------------------------------------------------------------------------------
poscur proc
mov ah,02h
mov bx,0
mov dh,row
mov dl,col
int 10h
ret
poscur endp
;...........................................
clean proc
mov ax,0700h
mov bh,17h
mov cx,0000h
mov dx,314fh
int 10h
ret
clean endp
;----------------------------------------------------------------------------------------------------------------------------------------
end inicio