| OLD | NEW |
| 1 # You'll find a bunch of nop opcodes in the below macros. They are | 1 # You'll find a bunch of nop opcodes in the below macros. They are |
| 2 # there to keep the code correctly aligned. Be careful to maintain | 2 # there to keep the code correctly aligned. Be careful to maintain |
| 3 # them when changing the code. | 3 # them when changing the code. |
| 4 | 4 |
| 5 comment "subroutine declare" | 5 comment "subroutine declare" |
| 6 .purgem gdbasm_declare | 6 .purgem gdbasm_declare |
| 7 .macro gdbasm_declare name | 7 .macro gdbasm_declare name |
| 8 .align 1 | 8 .align 1 |
| 9 .global \name | 9 .global \name |
| 10 \name: | 10 \name: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 lds.l @r15+,pr | 24 lds.l @r15+,pr |
| 25 mov.l @r15+,r14 | 25 mov.l @r15+,r14 |
| 26 rts | 26 rts |
| 27 nop | 27 nop |
| 28 nop | 28 nop |
| 29 .endm | 29 .endm |
| 30 | 30 |
| 31 comment "subroutine end" | 31 comment "subroutine end" |
| 32 .purgem gdbasm_end | 32 .purgem gdbasm_end |
| 33 .macro gdbasm_end name | 33 .macro gdbasm_end name |
| 34 » .size \name, .-_foo1 | 34 » .size \name, . - \name |
| 35 .align 1 | 35 .align 1 |
| 36 .endm | 36 .endm |
| 37 | 37 |
| 38 comment "subroutine call" | 38 comment "subroutine call" |
| 39 .macro gdbasm_call subr | 39 .macro gdbasm_call subr |
| 40 mov.l .Lconst\@,r1 | 40 mov.l .Lconst\@,r1 |
| 41 bra .Lafterconst\@ | 41 bra .Lafterconst\@ |
| 42 nop | 42 nop |
| 43 nop | 43 nop |
| 44 .Lconst\@: | 44 .Lconst\@: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 .endm | 58 .endm |
| 59 | 59 |
| 60 comment "exit (0)" | 60 comment "exit (0)" |
| 61 .macro gdbasm_exit0 | 61 .macro gdbasm_exit0 |
| 62 sleep | 62 sleep |
| 63 nop | 63 nop |
| 64 .endm | 64 .endm |
| 65 | 65 |
| 66 comment "crt0 startup" | 66 comment "crt0 startup" |
| 67 .macro gdbasm_startup | 67 .macro gdbasm_startup |
| 68 » mov.l» .stackaddr,r15 | 68 » comment "If there is a _stack symbol, use it for setting up the stack" |
| 69 » comment "pointer. In hosted mode (when there is no _stack symbol)," |
| 70 » comment "the operating system will have initialized it already." |
| 71 » mov.l» .stackaddr, r0 |
| 72 » tst» r0, r0 |
| 73 » bt» .afterstackaddr |
| 74 » mov» r0, r15 |
| 69 bra .afterstackaddr | 75 bra .afterstackaddr |
| 70 nop | 76 nop |
| 71 nop | |
| 72 .align 2 | 77 .align 2 |
| 73 .stackaddr: | 78 .stackaddr: |
| 74 » .long» 196608» » ! 0x30000 | 79 » .weak» _stack |
| 80 » .long» _stack |
| 75 .align 1 | 81 .align 1 |
| 76 .afterstackaddr: | 82 .afterstackaddr: |
| 77 .endm | 83 .endm |
| 78 | 84 |
| 79 comment "Declare a data variable" | 85 comment "Declare a data variable" |
| 80 .purgem gdbasm_datavar | 86 .purgem gdbasm_datavar |
| 81 .macro gdbasm_datavar name value | 87 .macro gdbasm_datavar name value |
| 82 .data | 88 .data |
| 83 .align 2 | 89 .align 2 |
| 84 .type \name, @object | 90 .type \name, @object |
| 85 .size \name, 4 | 91 .size \name, 4 |
| 86 \name: | 92 \name: |
| 87 .long \value | 93 .long \value |
| 88 .endm | 94 .endm |
| OLD | NEW |