- 9 15 Write An Arm Assembly Language Code Segment That Will Input A Four Bit Binary Variable X Use Port B For Your 1 (48.73 KiB) Viewed 24 times
9. (15) Write an ARM assembly language code segment that will input a four-bit binary variable 'x'. Use port B for your
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
9. (15) Write an ARM assembly language code segment that will input a four-bit binary variable 'x'. Use port B for your
9. (15) Write an ARM assembly language code segment that will input a four-bit binary variable 'x'. Use port B for your input port. This variable is associated with the first four bits of the port (low nibble, bits 0-3); whereas the other twelve (bits 4 - 15) are unaccounted for and will therefore be allowed to float. You must account for this in your code. Once the port is read and masked appropriately it will then pass this value into a function that multiplies this variable, x by 11 (decimal) using shifts and adds (or subtracts) and not any direct multiply (e.g., MUL or UMULL) instructions. Following the computation, it will output the binary result to the 16-bit port C. The program will continuously monitor (poll) the input port and update the output port accordingly. Use indirect addressing mode instructions for input and output. You do not need to set up the ports (DDR, Clock, etc.); simply use them as you can assume that they have been taken care of beforehand using a device driver routine. You should refer to the 16-bit ports as PORTB and PORTC in your program.