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]

1 Tutorial Problems 2, Q. N. 8 on 4th March 2009, 11:21 am

diadem59

avatar
Administrator
Write a program to add the sequence 1+2+3+4+... ... upto 100 steps and display the result in hexadecimal format.

Solution:

Code:
DOSSEG
.STACK 64H
.DATA     
SEQ DB 100 DUP(?)
TEMP DB 4 DUP(?) 
DIVS DW 10H

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

MOV AL,1
MOV DI,0
NXT: MOV SEQ[DI],AL
INC DI
INC AL
CMP AL,65H
JNE NXT
     
MOV AX,0
AGNADD:  DEC DI
ADD AL,SEQ[DI]
JNC SKP
INC AH
SKP:  CMP DI,0
JNE AGNADD
       
MOV DX,00
MOV DI,0
REDIV:  DIV DIVS
MOV TEMP[DI],DL
INC DI
MOV DL,00
CMP AX,00
JNZ REDIV

MOV AH,02
NEXT:  DEC DI
MOV DL,TEMP[DI]
CMP DL,0AH
JB SKIP
ADD DL,7
SKIP:  ADD DL,30H
INT 21H
CMP DI,0
JNE NEXT

MOV AX,4C00H
INT 21H
MAIN ENDP
END MAIN

View user profile

2 Re: Tutorial Problems 2, Q. N. 8 on 4th March 2009, 3:22 pm

Dudes ! Pulchowk ko tutorial questions haru chha bhane post garau hai Rolling Eyes Any subjet for 2nd year BEX
Thankx in advance. Basketball

View user profile

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