By Schmidt G.

Show description

Read or Download Beginners introduction to the assembly language of Atmel AVR microprocessors PDF

Best education books

Rethinking the BSE Crisis: A Study of Scientific Reasoning under Uncertainty

In 1986, the emergence of a unique mind affliction in British livestock awarded a special problem to scientists. How that problem was once addressed has been the topic of a public inquiry and various educational reviews performed up to now. although, none of those investigations has sought to envision the reasoning of scientists in this severe interval within the public well-being of the united kingdom.

The Christian Muslim Frontier: A Zone of Contact, Conflict and Co-operation (Routledgecurzon Advances in Middle East and Islamic Studies)

The Christian-Muslim Frontier describes the old formation of this sector, and its modern dimensions: geopolitical, mental, financial and safeguard. detailed realization is given to the concept that of state-frontiers, to the results of the asymmetric improvement of country states and the modern interspersing of groups, which creates new practical frontiers.

Additional info for Beginners introduction to the assembly language of Atmel AVR microprocessors

Example text

Adding the previously copied number to this yields a multiplication with 5. Now a mulitiplication with 2 (left shift/roll) yields the 10-fold of the result. Finally we add the BCD and repeat that algorithm until all decimal digits are converted. If, during one of these operations, there occurs a carry of the result, the BCD is too big to be converted. This algorithm handles numbers of any length, as long as the result registers are prepared. The conversion of a binary to BCDs is more complicated than that.

Net R2 is rotated to the right, to roll the least significant bit into the carry bit. 1010). Because the carry bit had a one the content of the registers R1:R0 is added to the (empty) register pair R4:R3, resulting in 0x00AA there. Now the register pair R1:R0 is rotated one position left to multiply this binary by 2. From 0x00AA, multiplication by 2 yields 0x0154. The whole multiplication loop is repeated as long there is at least one binary 1 in register R2. These following loops are not shown here.

In this notation, we mean that the first register is the most signifant byte, the second the least significant). ADD R2,R4 ; first add the two low-bytes ADC R1,R3 ; then the two high-bytes Instead of a second ADD we use ADC in the second instruction. That means add with carry, which is set or cleared during the first instruction, depending from the result. Already scared enough by that complicated math? If not: take this! We subtract R3:R4 from R1:R2. SUB R2,R4 ; first the low-byte SBC R1,R3 ; then the high-byte Again the same trick: during the second instruction we subract another 1 from the result if the result of the first instruction had an overflow.

Download PDF sample

Beginners introduction to the assembly language of Atmel AVR by Schmidt G.
Rated 4.83 of 5 – based on 9 votes