![]() |
Re: Add 10 numbers stored in consecutive memory locations
How do we get square of a number in ALP
|
Re: Add 10 numbers stored in consecutive memory locations
mvi b,09h ; load the number you want to sqaure
mov c,b ; c is the counter for repeating loop mvi a,00h ; empty the contents of accumulator repeat: add b ; add n to accumulator, n times e.g add 9, 9 times dcr c jnz repeat hlt ; the answer lies in the accumulator, you can also store it at some mem location or output port |
Re: Add 10 numbers stored in consecutive memory locations
what is repeat: means
|
Re: Add 10 numbers stored in consecutive memory locations
REPEAT: This statement will add the content of b with content of accumulator again and again till the value of c is decreased to 0.
|
Re: Add 10 numbers stored in consecutive memory locations
hi i am using SDK6800 emulator assembly program
i need to create this below mentioned program Create a 6800 program which determines if a number, n, is prime. A prime number has only two factors. Your program should work with any input for n where n >= 0 and n <= 127. If the number is prime, then print the letter Y to the display, otherwise print the letter N. The following example has n = 5 and should print Y since n is a prime number. n .byte 5 please help thanks sooraj |
| All times are GMT +5.5. The time now is 22:42. |