Questions tagged [assembly]
A low-level programming language providing symbolic representation of machine code.
36 questions
-3
votes
1
answer
34
views
Can I boot an Arm32 OS on the latest RPIs
I am learning ARM assembly, and my final project is to create an OS fully in ASM and C. So, can I run this future OS on latest RPIs that are arm64 ?
Even if the answer is probably no.
0
votes
0
answers
92
views
For Baremetal Raspberry Pi Zero 2W, how can I use GPIO pins?
I did find the Megathread on RPI forums
https://forums.raspberrypi.com/viewtopic.php?f=72&t=72260
and many tutorials but I can't seem to make them work
I wanted to follow this tutorial, https://...
0
votes
0
answers
85
views
The following code is for a random number guessing game using Arm assembly on Raspberry pi 4 .Can anyone help with it?
.data
//* The welcome message. */
welcome_message: .asciz "Welcome to the guessing game! This has been created by Ahmed Imran naeem (6779560)"
/* The prompt for the user to ...
2
votes
1
answer
478
views
Which raspberry pi nowadays is compatible with 32bit ARMv7 assembly code?
I'm taking an assembly code class in college, and we're going to study ARM assembly. However, we'll only cover 32bit ARMv7 assembly code.
The class uses some weird ARM emulator, but I would much ...
1
vote
1
answer
831
views
Bare metal LED access on RPi 4
I've been playing with the Baking Pi tutorials, getting assembly code to work on the [bare metal] Pi 1 (BCM2835).
I'm now interested in adapting the code to work on the Pi 4 BCM2711 but I'm struggling ...
4
votes
1
answer
434
views
Does the Raspberry Pi 4's processor support ARM's SHA256 instructions?
According to Wikipedia, every Armv8 processor should support sha256 hashing instructions however /proc/cpuinfo doesn't list it. Could there be a failure to identify the feature by the kernel?
...
0
votes
1
answer
508
views
ArmV7 Assembly returning 1 for basic add function call
I'm trying to get into Assembly development for the purposes of better understanding lower level development and I'm doing this with my Raspberry Pi Model 4B. I am going through this tutorial at the ...
5
votes
1
answer
2k
views
How do I read the cpuid in aarch64 asm?
In armv7 / 32bit mode I can read the cpuid using
uint32_t arm_cpuid;
__asm__("mrc p15, 0, %0, c0, c0, 0" : "=r"(arm_cpuid));
This gives 0x410FD034 for RPi3 and 0x410FD083 ...
4
votes
1
answer
2k
views
BCM2835 GPIO Pins vs. Physical Pin Numbers
Good morning.
I am attempting some low-level assembly coding for Raspberry Pi. Using the BCM2835 Peripherals Doc, I have successfully been able to work with the GPIO controller on my RPi Model B rev. ...
2
votes
1
answer
86
views
BCM2835 datasheet addressing system
I've been interested in writing a kernel for my old Raspberry Pi for quite a while, and managed to make work some ARM assembly code I found on the famous "Baking Pi" course by the University ...
2
votes
3
answers
4k
views
How can I run 32-bit compiled assembly code on Rasberry PI 4 B, if possible at all?
I bought the PI 4 B for a university project, as I have to make small 32-bit ARM assembly program. However I realized it too late, that it comes with an aarch64 architecture ARM processor.
I would ...
2
votes
0
answers
578
views
Lighting an LED through Pi 4 Model B using Assembly
I have been struggling to light an LED using my raspberry pi 4 model b but have not been able to find a solution.
My assembly code :
.section .init
.globl _start
_start:
mov r0, #0xF0000000
orr r0, ...
4
votes
1
answer
275
views
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 ...
1
vote
1
answer
136
views
Radio Transmission
Yes, I pretty much a noob, but I was wondering if there is a way to program the Raspberry Pi in Assembly Code to transmit data via radio frequencies (like remote control) between itself and another ...
0
votes
1
answer
687
views
Read/Write GPIO
I wrote an assembly code for my Raspberry Pi to read an I/O with a button and switch an LED according to the state of the button. It seems that the I/O with the LED is toggling all the time and I don´...
2
votes
1
answer
1k
views
bootcode.bin RPi 3
I've been reading this document:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/bootflow.md
About the boot process of the Raspberry Pi. I want to make a simple "Hello, ...
3
votes
1
answer
309
views
Why does adding a nop or constant break my code?
I am learning the ARM architecture via bare metal programming on the Raspberry Pi 3. I have a booting "kernel" that prints out some info. I have reached a point that I don't understand what is ...
1
vote
2
answers
2k
views
Is there a program to execute assembly code and check registers?
In our university we have a computer's technology subject in which we have to program in ARM's assembly language.
We have the chance to use a simulator but I was wondering if I was able to execute ...
3
votes
1
answer
189
views
OS-less raspberry pi 2 debugging of Assembly language
I have a Raspberry Pi 2 without an OS installed. I have an assignment where I have to create and display some code in assembly language for the Pi 2.
The lab that we have set up at school has ...
0
votes
1
answer
200
views
unable to set GPIO 17 as an output by assembly program
I am trying to st GPIO 17 as an output. I am using Pi 2 model B. By searching for the base address of peripherals, I found that it is 0x3F000000. I want to write a code in assembly language, Following ...
3
votes
1
answer
305
views
Regarding assembly language programming in Raspberry Pi
I am learning assembly language programming in Raspberry Pi 2 model B. I know about Code::Blocks and gdb. Using assembly language the processor's register can be controlled, but I want to control the ...
1
vote
0
answers
268
views
RPi2 bare metal blinker
This is my first assembly program. I have a FAT32 formatted SD card with latest bootcode.bin, start.elf, and a flat binary named kernel7.img converted from the following dumped ELF file:
build/kernal....
2
votes
2
answers
2k
views
On-board LED connection to GPIO
I stumbled on this tutorial: http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/ok01.html
Unfortunately this is only made for the B rev2 board, whereas I got a B+ board and the board setup is ...
3
votes
1
answer
648
views
Disassemble i386 in Raspbian?
I want to disassemble i386 machine instructions into human readable text in Raspbian.
I am a rookie Linux user and don't know the configuration of installed tools, but from what I understand I need ...
2
votes
1
answer
993
views
Windows IoT Core GpioController - assembly 'Windows' causes a cycle
I am trying my new Raspberry Pi with Windows 10 IoT Core.
I have fallowed the steps of the installations and cofigurations, and every thing was fine until I've got to Blanky tutorial
http://ms-iot....
0
votes
1
answer
83
views
Baking Pi OK05 - Why "ldr" twice to make the pattern work?
I'm carefully following Baking Pi with my model B, making sure I fully understand everything going on. I am now at lesson 5, to flash the SOS Morse code. It works fine, but I am curious why it needs ...
2
votes
2
answers
2k
views
Pi 2 CPU Documentation
I'm interested in processor architecture, and assembly programming, but I can't seem to find any documentation, or even the datasheet on the CPU of the Pi 2 (BCM2836). The document I'm looking for ...
3
votes
1
answer
812
views
Baking Pi Lesson 02 does not work on B+
I would like to comprehend lesson 2 of Baking Pi, but I am not able to get the LED blinking.
I am using Windows and have installed Cygwin and the ARM tool chain. As explained in the requirements, I ...
3
votes
1
answer
934
views
ASM - how do I write graphics straight to the screen
I have some old RISC OS assembly programmes I wrote a few years back and I want to port them to Raspberry Pi.
I ran Mode 28 and wrote output directly to the screen using the memory address where v-...
2
votes
0
answers
2k
views
Assembly - set gpio as input
I have 2 leds and one button.
both green and yellow led off when booting from card.
When the button is pressed, i want to turn green led off and yellow led on.
However, I have to write assembly. I ...
1
vote
0
answers
234
views
Memory addresses
I am writing an assembly program, assembling it and replacing the kernel.img file on a SD card with raspbian installed on it.
Will the memory address of the first instruction be zero? Either because ...
3
votes
3
answers
5k
views
Assembly code on Raspberry Pi
What's the file extension for assembly code? Can it even be written by a text editor?
My plan was to use nano to write the program (for syntax highlighting), so would that work? If not, what do I ...
2
votes
1
answer
722
views
Run program on Baking Pi ARM ASM OS
I am following the Baking Pi Raspberry Pi ASM OS tutorial here, and I thought that it would be cool if I could create a compiler/runner for like, BASIC or a language I create. I don't have the skill ...
0
votes
2
answers
2k
views
Kernel module assembly output
I compiled the kernel modules written in C directly on my Raspberry Pi using this Makefile:
obj-m := HelloWorld.o
all:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
...
20
votes
5
answers
28k
views
Write an OS for Raspberry Pi in C
I already found the Baking Pi tutorials, but they only use assembly language. I followed the first lessons, but I am already wondering how to use C instead. I mean, there is a reason they invented ...
1
vote
1
answer
505
views
Assembling Thumb on Rasparian
Has anyone been successful in assembling, compiling and running thumb or thumb-2 on Rasparian. Here is an example of my assembly code:
.text
.global main
.code 16
main:
MOV r3,#1
finish:
...