Assembly Language Programming Using TI MSP430 and IAR Workbe
Assembly Language Programming Using TI MSP430 and IAR Workbench.
Write an assembly program that first initializes two 16-bit signed integers, A and B. Create a subroutine, called SW_MUL, that multiplies the two integers together using the multiplication technique of your choice. Parameters should be passed to the subroutine using the stack and the result stored in R14. A second subroutine, called HW_MUL, must then be created that multiplies the two integers using the hardware multiplier. The parameters should be passed using registers and the result should be stored in R15. Assess the performance of the subroutines by monitoring the clock cycle counter in the IAR Workbench.
Thanks in advance for any help!
Solution
An assembly (or assembler) language,[1] often abbreviated asm, is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture\'s machine code instructions. Each assembly language is specific to a particular computer architecture. In contrast, most high-level programming languages are generally portable across multiple architectures but require interpretingor compiling. Assembly language may also be called symbolic machine code.[2]
Assembly language is converted into executable machine code by a utility program referred to as an assembler. The conversion process is referred to as assembly, or assembling the source code. Assembly time is the computational step where an assembler is run.
Assembly language uses a mnemonic to represent each low-level machine instruction or operation, typically also each architectural register, flag, etc. Many operations require one or more operands in order to form a complete instruction and most assemblers can take expressions of numbers and named constants as well as registers and labels as operands, freeing the programmer from tedious repetitive calculations. Depending on the architecture, these elements may also be combined for specific instructions or addressing modes using offsets or other data as well as fixed addresses. Many assemblers offer additional mechanisms to facilitate program development, to control the assembly process, and to aid debugging.
