Assignment Help, Cloud Based ERP System, Microsoft NAV Certification
WELCOME !!

Please Register, ask for assignment solutions & post the solutions if you know any.

LETS START POSTING YOUR IDEAS AND THOUGHTS AND BUILD THE COMMUNITY OF EXPERTS.

Assignment Help, Cloud Based ERP System, Microsoft NAV Certification
WELCOME !!

Please Register, ask for assignment solutions & post the solutions if you know any.

LETS START POSTING YOUR IDEAS AND THOUGHTS AND BUILD THE COMMUNITY OF EXPERTS.

Assignment Help, Cloud Based ERP System, Microsoft NAV Certification

Stock Market, Online Tutoring, Cloud Based ERP System, Microsoft Dynamics Reporting, Microsoft Nav Certification


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1Tutorial Problems 2, Q. N. 1 Empty Tutorial Problems 2, Q. N. 1 2nd March 2009, 10:11 pm

diadem59

diadem59
Administrator
Write an ALP to add all the elements of table which are between 50 and 150 only. Display the result as the decimal value.

Solution:

DOSSEG.MODEL SMALL
.STACK 64H
.DATA
TBL DB 2,50,100,200,150
TEMP DB 4 DUP(?)
DIVISOR DB 0AH

.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX

MOV SI,0
MOV AX,0
MOV DH,0
MOV CX,5
NEXT: CMP TBL[SI],50
JBE SKIP
CMP TBL[SI],150
JAE SKIP
MOV DL,TBL[SI]

ADD AX,DX
SKIP: INC SI
LOOP NEXT

MOV DI,0
REDIV: DIV DIVISOR
MOV TEMP[DI],AH
INC DI
MOV AH,0
CMP AL,0
JNE REDIV

MOV AH,02H
RE: DEC DI
MOV DL,TEMP[DI]
ADD DL,30H
INT 21H
CMP DI,0
JNE RE

MOV AX,4C00H
INT 21H

MAIN ENDP
END MAIN

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum