The first program is to count the number of zeros in $3855. Please     add comments to...

90.2K

Verified Solution

Question

Programming

The first program is to count the number of zeros in$3855. Please

    add comments to eachline

         

      org   $1000

array     db $38, $55 ; data to betested

          

          org$1100

zero_cnt ds.b   1

lp_cnt     ds.b   1

            org   $1500

            clr  zero_cnt       ;initialize the 0count to 0

            movb#16,lp_cnt     

            ldd  array        

again     lsrd

           bcs  chk_end         ;

           inc   zero_cnt

chk_end   dec  lp_cnt              

           bne  again                  

           swi             

           end

Answer & Explanation Solved by verified expert
4.1 Ratings (731 Votes)
org 1000 set the location counter to 1000 array db 38 55 data to be tested initializes 2 bytes in memory to 38 55 and the assembler will use array as the symbolic address of    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students