Questions tagged [assembler]

For questions pertaining to compiling code.

An assembler translates high-level computer code into machine code that can be read and interpreted by the computer.

8 questions
20
votes
5 answers

Writing ARM Assembly code

After getting my Raspberry Pi, I decided that I wanted to learn how to write ARM assembly code. My question is, what do I need to get started? I assume that there is already a compiler installed but I don't know what it is (gcc maybe?). Any help is…
ohblahitsme
  • 741
  • 1
  • 7
  • 18
15
votes
1 answer

Is the Raspberry Pi a good teaching tool for students learning assembler?

When I took an assembler course, we used a NIOS II Altera board which had a display, some LED lights and programmable buttons. One of the more useful exercises was to write a binary calculator using the LEDs' and the buttons. So, here's my…
keyser
  • 255
  • 2
  • 11
8
votes
1 answer

Locked (Atomic) Register read/write

I'm coding something using direct control of GPIO, there are some good resources around for this, such as http://elinux.org/RPi_Low-level_peripherals#GPIO_hardware_hacking ; the process involves open("/dev/mem") and then a mmap operation effectively…
greggo
  • 631
  • 2
  • 5
  • 11
5
votes
1 answer

Bare Metal Assembly/C(++) Programming

I'm trying to make a small os on my Raspberry Pi. I have good assembly and strong c/c++ knowledges but I need some help. For my first experiments I worked with Qemu and it's serial output but now I would like to launch it on a real raspberry pi,…
abidon
  • 153
  • 1
  • 5
4
votes
1 answer

gcc does not compile code that compiles in 'as'

I'm trying to learn assembly using the raspberry pi. I have code that compiles using as but will not compile with gcc. I thought that as was the backend for gcc assembly so I'm confused why it is not working. It says that udiv is undefined. test.s …
user668074
  • 141
  • 3
2
votes
1 answer

Flat Assembler Binary

I am trying to compile a program using Flat Assembler (fasm) but I can't find a binary that works for the RPi. I have tried the regular and arm versions which both complain of "Exec Format Error". Is there any such binary that I can use?
Scoder12
  • 23
  • 3
2
votes
1 answer

ARM dissasembler

I'm attempting to do an object dump of an assembled program for the pi. I have main.o main.s main.elf and main.bin otool -tV main.o This results in main.o: is not an object file What am I doing wrong?
Paul Meier
  • 23
  • 3
0
votes
1 answer

I want to mmap the GPIO on Raspberry Pi 4b+ but get invalid argument. (Running Raspbian Buster)

// The c code shown here works: int fd = open("/dev/gpiomem", O_FLAGS); printf("fd = %d\n", fd); long int* addr = mmap(0, 0x1000, PROT_RDWR, MAP_SHARED, fd, …