assembly - ARM Assembler on Raspberry Pi loading hexadecimals as constants if the hexadecimal contains a letter -


i have program converts numbers ascii in gnu arm assembler can printed.

when mov r0, #130, hexadecimal 82 , printed after executing rest of code. i've tried mov r0, #1280 , program prints 500 correct. r0 input program basically.

now when try mov r0, #230 or mov r0, #330 doesn't work correctly. hexadecimals e6 #230 b6 while hex 14a #330 gets me error. can see, these hexadecimals contain letters.i error runs , says it's loaded constant instead? can explain theory behind , give me clues how solve it?.

error: invalid constant (14a) after fixup

 .data tab:    .asciz "0123456789abcedf"  message: .space 200 message2: .space 200 message3: .space 200 .text _start:   @mov r0, #130 @ldr r11, =message @bl print32bitar mov r0, #130 ldr r11, =message2 b print32bitar mov r0,#1 mov r7,#1 swi 0x0  print32bitar: stmdb sp!,{r1-r10,r12}  mov r1, #0xf0000000 mov r2, #0 mov r3, #0 mov r4, #0 mov r6, #32 mov r5, #0 mov r7,#0 mov r9, #0 mov r8, r11 mov r10, #0 mov r12, #0  loop: mov r3, #8 mov r5, r0 , r5, r1 sub r6, #4 lsr r5, r6 lsr r1, #4 add r4, #1  ldr r7, =tab ldrb r9, [r7,r5] cmp r12, #1 beq storeloop cmp r9, #48 bne flagloop b loop storeloop:   strb r9, [r8],#4 cmp r3,r4 bne loop  mov r0, #1 mov r1, r11 mov r2, #100 mov r7, #4 swi 0x0  ldmia sp!, {r1-r10,r12}  flagloop: mov r12, #1 b storeloop 


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -