sai685
Junior Member level 2
Code:
#include<stdio.h>
#define GPIO_PORTA_DIR_R (*((volatile unsigned long *)0x40004400))
int main()
{
GPIO_PORTA_DIR_R = 0x80;
printf("GPIO_PORTA=%x",GPIO_PORTA_DIR_R);
}
This code is converted into assembly after this command in linux
$ gcc -S try.c
which is like
Code:
.file "try.c"
.text
.globl main
.type main, @function
main:
.LFB2:
pushq %rbp
.LCFI0:
movq %rsp, %rbp
.LCFI1:
movl $1073759232, %eax
movq $128, (%rax)
leave
ret
.LFE2:
.size main, .-main
.section .eh_frame,"a",@progbits
.Lframe1:
.long .LECIE1-.LSCIE1
.LSCIE1:
.long 0x0
.byte 0x1
.string "zR"
.uleb128 0x1
.sleb128 -8
.byte 0x10
.uleb128 0x1
.byte 0x3
.byte 0xc
.uleb128 0x7
.uleb128 0x8
.byte 0x90
.uleb128 0x1
.align 8
.LECIE1:
.LSFDE1:
.long .LEFDE1-.LASFDE1
.LASFDE1:
.long .LASFDE1-.Lframe1
.long .LFB2
.long .LFE2-.LFB2
.uleb128 0x0
.byte 0x4
.long .LCFI0-.LFB2
.byte 0xe
.uleb128 0x10
.byte 0x86
.uleb128 0x2
.byte 0x4
.long .LCFI1-.LCFI0
.byte 0xd
.uleb128 0x6
.align 8
.LEFDE1:
.ident "GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-44)"
.section .note.GNU-stack,"",@progbits
but after this i have enter the command to link the files
which is
$ as -o try.s
after executing this command i am getting only empty lines that means it is not asking to me write any other command just it is showing a blank space.
let me know what is the solution for this and at the same time if you have any best material for this cross compiler please include link