Question

Write an 8086 assembly Language Program to find the length of a string that is available in the memory. The program output this value on the monitor. Assume that the end of a string is the character ‘#’. For example, if a string IGNOU# is available in program memory, then program will output string length 5 as the output. Make suitable assumptions, if any.

30 Nov 2017
Answer :
Word Count : 412

Here's an example of an 8086 assembly language program that calculates the length of a string stored in memory and outputs the result:

```assembly
.model small
.data
    msg db 'IGNOU#'
    len db 0

.code
    org 100h

main:
    mov ax, @data       ; Load data segment address into AX
    mov ds, ax          ; Set DS to point to the data segment

    mov si, 0           ; Initialize source index to 0
    mov al, msg[si]     ; Load the first character of the string

count_loop:
    cmp al, '#'         ; Compare AL (current character) with '#'
    je done             ; If '#' is found, jump to the

_________ ______ ___ __________ _________ _______ ____ _____ _______ ________.
__________ ______ ________ _______ _______ ______ ______ ____ ________ __________ __________ __________.
_________ ____ ________ ______ _______ _________ _____ _________ ___ _______.
_______ _______ ________ ______ __________ __________ __________ ____ ________ ___.
______ _______ ______ ___ _________ __________ ___ _______ __________.
____ ______ _____ _____ __________ __________ _______.
_________ __________ ______ _______ ___ ____ ___ ________ ________.
______ ___ ________ ______ _____ ________ ___ __________ _________ _______ _______ ___.
__________ _________ _____ ________ ________ ___ __________.
______ _____ ______ ____ _________ __________ __________ ___ ______.
_______ _____ __________ _____ _________ ________.
___ ______ __________ ________ _________ _____ _____ _______ _________ ____.
_________ ________ _________ _________ ___ _____ __________ __________ _____ _________.
___ __________ __________ _________ ___ _____ ________ _____ ______ ______ ______ _____.
______ ______ _____ ____ _____ _________ ________ ________.
________ _____ ___ _____ _________ __________.
______ _________ ______ ___ __________ ________ ____ __________ _____ __________ __________ ________.
____ __________ ________ ____ __________ _____ ____ __________ ________ _______.
_________ ____ ____ ____ ______ ______ _________ __________ __________.
_________ _____ _____ ______ _________ __________ ___.
_______ ________ _______ ___ __________ ________ ____ __________ _________ _________ ________ _____.
________ _________ _____ ______ ______.
________ ______ ____ ______ ________ ___ _______.
__________ ____ ______ ______ _______.
_____ _______ _________ ______ _______ ______ ________ ___ ________ ___ _____.
_______ _____ ___ _________ ___ __________.
___ _____ ______ _________ ___ ______ _______ ______ _______ _______.
____ ______ ___ ______ ______ __________ ___ __________ _____.
_____ _______ _____ ________ ________.
___ __________ _______ ________ _____.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCS 12 2010 - Write an 8086 assembly Language Program to find the length of a string | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→