Write an ASM program to count number of zeros and ones?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: Embedded SystemWrite an ASM program to count number of zeros and ones?
Chetan Shidling Staff asked 6 years ago

I need code.

1 Answers
Chetan Shidling Staff answered 6 years ago

Code:

AREA ZEROS_ONES, CODE
ENTRY
LDR R0,= VAR
MOV R1, #32
LDR R2, [R0] Z1MOVS R2, R2, LSL#1
ADDCS R3, R3, #1
ADDCC R4, R4, #1
SUBS R1, R1, #1
BNE Z1
STOP B STOP
VAR DCD 0X01010101
END