Question: Write subroutine named CHKSUM in 328PB assembly language to find the 12. a checksum of a block of memory, and return that checksum in RO.

 Write subroutine named CHKSUM in 328PB assembly language to find the

Write subroutine named CHKSUM in 328PB assembly language to find the 12. a checksum of a block of memory, and return that checksum in RO. The starting address of the block is contained in R17:R16 (R17 contains the upper 8 bits, and R16 contans the lower 8 bits of the address). The length of the block is contained in R19:R18 (similarly, R19 contains the upper 8 bits of the length and R18 contains the lower 8 bits). The checksum is found by adding each of the bytes in the block and ignoring any carry. For example, if memory locations 0x200 through 0x205 contained 0x50, Ox51, 0x80, 0x81, 0x00, 0x03, then the following code should result in OxA5 in RO (because 0x50+0x51+0x80+0x81+0x00+0x03 0x1A5). LDI R17,HIGH(0x200) LDI R16,LO(0x200) LDI R19,HIGH(6) LDI R18,LOW (6) CALL CHKSUM ; RO should contain A5 ; ONLY WRITE THE CHKSUM ROUTINE THIS IS ONLY AN EXAMPLE YOUR CODE SHOULD HANDLE ANY ; SIZED BLOCK (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!