Let’s see how write a ARM assembly code to find number of even numbers in an array. ALGORITHM Start Load the base address of array. Initialize a counter register to number of elements in array. Initialize a register(Rd) to zero to store number of even numbers. Load the value from…
Author: codesexplorer
8051 ALP to generate look up table for first 10 odd numbers
Have a look at my older program on how to find an odd number… ORG 000h MOV R0,#0Ah ; you can change this value to N numbers MOV R1,#00h ;operand MOV DPTR,#0Ah ;memory adress…
8051 ALP to generate look up table for first 10 even numbers
Have a look at my older program on how to find a even number… ORG 000h MOV R0,#0Ah ; you can change this value to N numbers MOV R1,#00h ;operand MOV DPTR,#0Ah ;memory…
8051 code to use R4(LSB) and R5(MSB) as a single 16bit counter, and increment the pair untill number is FFFFh
Logic is too simple. For better understanding, I would suggest you something. Use a scientific calculator and in hex mode go on adding 0x01 each time. And then study my code. You will have a better understanding. ORG 000h MOV R4,#00h MOV R5,#00h main: INC R4…
8051 code to use R4 (LSB) and R5(MSB) as a single 16-bit counter and decrement the pair until number is 0000h
The logic is easy. Go on decrementing LSB . Let me consider an example. let the number be 0xffff . this means 0xff in both R4 and R5 registers. go on decrementing R4(LSB).once it reaches 0x00,then decrement R5(MSB) which makes it 0xfe in R5. Then reset the value of R4…
ARM Assembly code for block transfer of data
ARM processor is used in all the Embedded systems that are being built now.ARM has both 32-bit and 64-bit RISC multi-core processors. RISC processors are designed to perform a smaller number of types of computer instructions so that they can operate at a higher speed, performing more millions…
8051 code to find the number of positive numbers in an array .
I have posted how to find a number is positive or negative before…. Just check it. ORG 000h MOV DPTR,#0Ah ; an external address MOV RO,#0Ah ;array counter …
8051 ALP program to find number of negative numbers in an array
I have posted how to find a number is positive or negative before…. Just check it. ORG 000h MOV DPTR,#0Ah ; an external address MOV RO,#0Ah ;array counter …
8051 code to find a number is even or odd
A negative number has its msb as binary 1 …Hence we rotate the number through carry to the left and then decide upon the status of the carry flag. ORG 000h MOV A,#number ;The number…
Half ascending and half descending code in 8051
8051 code to arrange the given numbers in half ascending and half descending order. In this article let’s see how to arrange a given array in half ascending and half descending. I think it’s weird to hear the word half ascending and half descending but it is interesting as well.…