Tag Archives: [X86/ARM Assembly Optimization]

【arm】arm-assembly-print-register-value-in-decimal

Date: 2018-7-15


1. Reference:
https://stackoverflow.com/questions/2370942/arm-assembly-print-register-value-in-decimal
2. Arm register printing
Since the ARM register print is always in hexadecimal, it seems to be a bit of a struggle. Therefore, we have been exploring the relatively convenient method of arm register printing recently, and now there are two methods for reference.
Method one:

print_decimal:
        stmfd   sp!, {
  r4,r5,lr}

        cmp     r0, #0
        moveq   r0, #'0'
        bleq    putchar
        beq     done

        mov