microprocessor
microprocessor
APPLICATIONS
The 8086 microprocessor has been widely used in various applications,
including early personal computers (PCs), industrial control systems, embedded
systems, and instrumentation.
It played a significant role in the development of the IBM PC and the
subsequent success of the PC industry.
Resources required
Step 2. Declare a string ‘This is a sample string’ in the data section, terminated with ‘$’.
Step 3. Start the main code section and set up the data segment register.
Step 6. Output the string using DOS interrupt 21H function 09H.
Step 7. Use DOS interrupt 21H function 4CH to exit the program.
- Push each character onto the stack and increment the pointer and count.
START
Main PROC
MOV AX,@DATA
MOV DS,AX
CALL
Reverse
MOV AH,09H
INT 21H
END MAIN
.CODE
MOV AX,@DATA
MOV DS,AX ; call reverse function
LEA DX,STRING
INT 21H
MAIN ENDP
REVERSE PROC
MOV CX, 0H
LOOP1:
INC SI
INC CX
JMP LOOP1
CMP CX,0
JE EXIT
POP DX
; make dh, 0
XOR DH, DH
; put the character of the reversed string;
MOV [SI], DX
; increment si and;
;decrement count
INC SI
DEC CX
JMP LOOP2
EXIT:
MOV [SI],’$ ‘
RET
REVERSE ENDP
END MAIN
CONCLUSION
Hence, from this microproject I learnt how a string is reversed using stack and I get know
some other more keywords and directives from this microproject. I have successfully done
this microproject.