Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why not used c in utils.S #252

Open
merelyaspirant opened this issue Jun 3, 2022 · 1 comment
Open

why not used c in utils.S #252

merelyaspirant opened this issue Jun 3, 2022 · 1 comment

Comments

@merelyaspirant
Copy link

In lesson 1, any specific reason of not using C to implement put32 and get32 in utils.
Please clarify if its just a choice or any specific reason.

@seusher
Copy link

seusher commented Apr 30, 2023

For anyone who is wondering the same: utils.S is an assembly source file, so you can't directly use C code in it. You can write the uart code all in C if you want to - see https://github.com/bztsrc/raspi3-tutorial/blob/master/03_uart1/uart.c

I'm not the author, but using assembly instead of C is a better educational experience and helps you understand ARM64 calling conventions rather than glossing over them and letting the compiler figure out the low-level details for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@seusher @merelyaspirant and others