소스 검색

fix bug in lab1-ex3.c, %% eax --> %eax in basic inline asm

the reference is from
https://gcc.gnu.org/onlinedocs/gcc.pdf (5.0.0 pre-release),
section 6.43 (How to Use Inline Assembly Language in C Code)
and http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html

syntax of basic asm statement:
asm [ volatile ] ( Assembler Instructions )

syntax of extended asm statement
asm [volatile] ( Assembler Template
: Output Operands
[ : Input Operands
[ : Clobbers ] ])

Alanpsc, thanks you!
main
yuchen 9 년 전
부모
커밋
316bbf6b92
2개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +0
    -0
      related_info/lab1/lab1-ex2.c
  2. +1
    -1
      related_info/lab1/lab1-ex3.c

+ 0
- 0
related_info/lab1/lab1-ex2.c 파일 보기


+ 1
- 1
related_info/lab1/lab1-ex3.c 파일 보기

@ -1,5 +1,5 @@
void inline ex1(void){
asm ("movl $0xffff, %%eax\n");
asm ("movl $0xffff, %eax\n");
}
void inline ex2(void){

불러오는 중...
취소
저장