Note that there are some explanatory texts on larger screens.

plurals
  1. POCompiling and Running ARM Assembly thumb-2 in Rasperry pi?
    primarykey
    data
    text
    <p>I am taking an assembly class and turns out i can't run the Assembly program they gave, due to being Windows 95 compliant x.x </p> <p>I am running Rasperry PI and can easily run the Assembly for ARM code via </p> <p><a href="http://thinkingeek.com/2013/01/09/arm-assembler-raspberry-pi-chapter-1/" rel="nofollow">http://thinkingeek.com/2013/01/09/arm-assembler-raspberry-pi-chapter-1/</a></p> <pre><code>/* -- first.s */ /* This is a comment */ .global main /* 'main' is our entry point and must be global */ .func main /* 'main' is a function */ main: /* This is main */ mov r0, #2 /* Put a 2 inside the register r0 */ bx lr /* Return from main */ $ as -o first.o first.s $ gcc -o first first.o $ ./first ; echo $? 2 </code></pre> <p>But this is the standard ARM 32 bit setup and need to compile and run for a thumb-2 setup for example:</p> <pre><code> AREA PrintText, CODE, READONLY SWI_WriteC EQU &amp;0 ;output character in r0 SWI_Exit EQU &amp;11 ;finish program ENTRY BL Print ;call print subroutine = "Text to print",&amp;0a,&amp;0d,0 ALIGN SWI SWI_Exit ;finish Print LDRB r0,[r14], #1 ;get a character CMP r0, #0 ;end mark NUL? SWINE SWI_WriteC ;if not, print BNE Print ADD r14, r14, #3 ; pass next word boundary BIC r14, r14, #3 ; round back to boundary MOV pc, r14 ;return END </code></pre> <p>Does anyone know what I need to in Pi to run this thumb style ? EDIT:</p> <p>for the commands above I tried adding -mthumb but dont think its right as i dont see any changes. </p> <p>as -mthumb -o test.o test.s </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload