Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

Solve for y in terms of x: 3 log 7 x log 7 y = 2.

Answered: 1 week ago