Jump to content

nescito ayudaaaaaa


Recommended Posts

Mira no te entendí mucho, alguna vez me acuerdo que hice una sumatoria en assembler, y justo lo entontré. Ojalá te sirva.

 

#make_COM#

include 'emu8086.inc'

ORG 100h

 

JMP INICIO()

 

INICIO():

CALL PTHIS

DB 13, 10, 'ingrese hasta que numero quiere sumar: ', 0

 

CALL scan_num

CMP CX,0 ;pide valor hasta que sea positivo

JL INICIO()

 

MOV SI,0

SUMATORIA(): ;funcion que hace la sumatoria

ADD AX,SI

INC SI

;mientras SI sea <= que el numero ingresado sigue sumando

CMP SI,CX

JBE SUMATORIA()

 

TOTAL():

CALL PTHIS

DB 13, 10, 'la sumatoria total es: ', 0

CALL print_num ;muestra en pantalla la suma total

JMP FIN()

 

FIN():

RET

DEFINE_PTHIS

DEFINE_SCAN_NUM

DEFINE_PRINT_NUM

DEFINE_PRINT_NUM_UNS

END

 

PD: No pude ver el enunciado ya que esta en tu plataforma virtual y no tengo acceso.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...