Arm/7seg8

From ASMBits

arm/7segPrevious

Write a function that will return a 64-bit value that can be used to display a 32-bit number as 8 hexadecimal digits, on 8 seven-segment displays. The 8 displays are separated into two groups of four, with each group of four being controlled by a 32-bit bit pattern (as four groups of 8 bits, with the highest bit of each byte unused).

  • bit[6:0]: right-most digit
  • bit[14:8]
  • bit[22:16]
  • bit[30:24]: left-most digit
unsigned long long hexdisplay(unsigned int number);

Your function will be passed one parameter: The number to be displayed. It should return the 64-bit bit pattern in r0 (least-significant 32 bits) and r1 (most-significant 32 bits).

Use the following bit patterns for digits. You may wish to reuse arm/7seg.


Sample Input

r0=8

Sample Output

r1=0x3f3f3f3f, r0=0x3f3f3f7f

Write your solution here

Upload a source file...