Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming style is very important in assembly language. It is expected to do the following in your programs: . Using EQU directive to give a

image text in transcribed

Programming style is very important in assembly language. It is expected to do the following in your programs: . Using EQU directive to give a symbolic name to a numeric constant to make it more readable. Applying neat spacing and code organization: o Assembly language source code should be arranged in three columns: label, instruction, and comments: the label field starts at the beginning of the line, the instruction field (opcodes+ operands) starts at the next TAB stop, and ' the comments are aligned in a column on the right .Using appropriate label names. Commeting each assembly line Commenting each logical part of your code. Most goods sold in U.S. and Canadian stores are marked with a Universal Product Code (UPC). The meanings of the digits underneath the bar code (from left to right) are: First digit: type of item, First group of five digits: manufacturer . Second group of five digits: product, and Final digit: check digit, used to help identify an error in the preceding digits. To compute the check digit, 0 13800'150738 .Add the first, third, fifth, seventh, ninth, and eleventh digits .Add the second, fourth, sixth, eighth, and tenth digits .Multiply the first sum by 3 and add it to the second sum The check digit is the digit which, when added to the above sum, produces a sum that is multiple of 10 o Subtract 1 from the total o Compute the remainder when the adjusted total is divided by 10 o Subtract the remainder from 9 Example for UPC 0 13800 15073 8: First sum: 0+3 +0+1 +0+3-7 e Second sum: 1 +8+0+5+7-21 Multiplying the first sum by 3 and adding the second yields 42 Subtracting 1 gives 41 Remainder upon dividing by 10 is 1 Remainder is subtracted from 9 Result is 8 Draw a detailed lowchart and write an ARM assembl to just verify whether a string of 12 ASCII encoded Your code should be highly optimized. Use as few instructions as possible (as little as 19 assembly instructions only Define in your assembly program the 12 digits UPC string as follow UPC DCB "013800150738" UPC string To test your program, you can use the following UPCs: 0 60383 755577 0 65633 45471 2 You can also get more UPC codes from your own kitchen items. HINT 1: To load a byte to a register, use LDRB not LDR HINT 2: To calculate 3 x Z, you can do so using only one ADD instruction with LSL#1 shift. HINT 3: You can implement the division operation using repeated subtraction. Programming style is very important in assembly language. It is expected to do the following in your programs: . Using EQU directive to give a symbolic name to a numeric constant to make it more readable. Applying neat spacing and code organization: o Assembly language source code should be arranged in three columns: label, instruction, and comments: the label field starts at the beginning of the line, the instruction field (opcodes+ operands) starts at the next TAB stop, and ' the comments are aligned in a column on the right .Using appropriate label names. Commeting each assembly line Commenting each logical part of your code. Most goods sold in U.S. and Canadian stores are marked with a Universal Product Code (UPC). The meanings of the digits underneath the bar code (from left to right) are: First digit: type of item, First group of five digits: manufacturer . Second group of five digits: product, and Final digit: check digit, used to help identify an error in the preceding digits. To compute the check digit, 0 13800'150738 .Add the first, third, fifth, seventh, ninth, and eleventh digits .Add the second, fourth, sixth, eighth, and tenth digits .Multiply the first sum by 3 and add it to the second sum The check digit is the digit which, when added to the above sum, produces a sum that is multiple of 10 o Subtract 1 from the total o Compute the remainder when the adjusted total is divided by 10 o Subtract the remainder from 9 Example for UPC 0 13800 15073 8: First sum: 0+3 +0+1 +0+3-7 e Second sum: 1 +8+0+5+7-21 Multiplying the first sum by 3 and adding the second yields 42 Subtracting 1 gives 41 Remainder upon dividing by 10 is 1 Remainder is subtracted from 9 Result is 8 Draw a detailed lowchart and write an ARM assembl to just verify whether a string of 12 ASCII encoded Your code should be highly optimized. Use as few instructions as possible (as little as 19 assembly instructions only Define in your assembly program the 12 digits UPC string as follow UPC DCB "013800150738" UPC string To test your program, you can use the following UPCs: 0 60383 755577 0 65633 45471 2 You can also get more UPC codes from your own kitchen items. HINT 1: To load a byte to a register, use LDRB not LDR HINT 2: To calculate 3 x Z, you can do so using only one ADD instruction with LSL#1 shift. HINT 3: You can implement the division operation using repeated subtraction

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

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

7-16 Compare Web 2.0 and Web 3.0.

Answered: 1 week ago