answersLogoWhite

0

Here’s a simple 8086 assembly language program to count the characters in the string "i know assembly programming":

section .data
    s1 db 'i know assembly programming', 0 ; String with null terminator
    count db 0                             ; To store the character count

section .text
    global _start

_start:
    mov si, s1             ; Load address of the string into SI
    xor cx, cx             ; Clear CX for counting characters

count_loop:
    cmp byte [si], 0       ; Check for null terminator
    je done                ; If found, jump to done
    inc cx                 ; Increment character count
    inc si                 ; Move to the next character
    jmp count_loop         ; Repeat the loop

done:
    mov count, cl          ; Store the count in 'count'
    ; Further code to exit or display the count can go here

This program initializes a string and counts the characters until it encounters the null terminator, storing the final count in a variable.

User Avatar

AnswerBot

2mo ago

What else can I help you with?

Related Questions

How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


What is the generation of language?

Programming languages are divided into five different generations. A programming language consists of the symbols, letters and numbers used to communicate with computers.


How do you multiply two numbers in assembly language 8086?

Yes.


Write an assembly language program to multiply two BCD numbers?

fish


Are numbers written the same in every language?

No, numbers are not written the same in every language. Different languages may use different symbols or characters to represent numbers.


What is the memcpy library used for in computer programming?

The memcpy library is used in computer programming to copy the value of numbers from a source to the memory block destination. Memcpy is frequently used in the C++ programming language.


What is Alp for multiplication of two digit BCD numbers in 8086?

Assembly language programe for multiplication


What are the names of some early computer languages?

FORTRAN, FORTH, C, BASIC, COBOL, LISP, LOGO, Pascal, and many more. Algol - Algorithmic Language SAIL - Stanford Artificial Intelligence Language BLISS - Basic Language for Implementation of System Software APL - A Programming Language SNOBOL - String Oriented Symbolic Language


Why does the Russian language have letters that look like numbers?

The Russian language uses the Cyrillic alphabet, which includes some characters that resemble numbers. This is because the Cyrillic alphabet was originally based on the Greek alphabet, which also features some characters that resemble numbers. The use of characters that look like numbers is simply a historical quirk of the development of the Cyrillic script.


Why computer programming languages invented?

As a CPU only processes written in machine language (binary) programming languages, which uses words instead of numbers is the reason that programming languages were invented. It allows programmers to write application in programming language statements that then uses special software to convert the program into machine language. (Gaddis, Tony, Irvine, Kip; Starting out with visual basic, 2005)


Adding numbers from 0 to 5 in assembly language?

0000 0001 0010 0011 0100 0101


Short note on high level language?

Generally languages are used for communication, In the case of computers languages are used to communicate with the Hardware. Language consist of set of rules and syntaxes to frame the valid instructions to work with the Machines.