私はRISC-Vテストパターンのソースコードを読んでいました。 そしてマクロが、私は1:
は、このコードでは意味ないかを知りたい、riscv-TEST.Hにアセンブリ言語で1とは何ですか?
を定義している:
#define RVTEST_CODE_BEGIN \
.section .text.init; \
.align 6; \
.weak stvec_handler; \
.weak mtvec_handler; \
.globl _start; \
_start: \
/* reset vector */ \
j reset_vector; \
.align 2; \
trap_vector: \
/* test whether the test came from pass/fail */ \
csrr t5, mcause; \
li t6, CAUSE_USER_ECALL; \
beq t5, t6, write_tohost; \
li t6, CAUSE_SUPERVISOR_ECALL; \
beq t5, t6, write_tohost; \
li t6, CAUSE_MACHINE_ECALL; \
beq t5, t6, write_tohost; \
/* if an mtvec_handler is defined, jump to it */ \
la t5, mtvec_handler; \
beqz t5, 1f; \
jr t5; \
/* was it an interrupt or an exception? */ \
1: csrr t5, mcause; \
bgez t5, handle_exception; \
INTERRUPT_HANDLER; \
'1:'はラベルです。 –
私はasmコードを書いてからしばらくしていますが、1:確かに私のラベルのようです。 – richb01
特にローカルラベルです。ここでそれらの詳細を読むことができます:https://sourceware.org/binutils/docs-2.24/as/Symbol-Names.html#Symbol-Names –