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

[ Question ] UART FIFO Constant #7

Open
ldelossa opened this issue Aug 29, 2021 · 1 comment
Open

[ Question ] UART FIFO Constant #7

ldelossa opened this issue Aug 29, 2021 · 1 comment

Comments

@ldelossa
Copy link

Hey there,

I'm trying to write directly to UART on the riscv virt machine type in qemu.

I see you're usage here:
https://github.com/noteed/riscv-hello-asm/blob/main/hello.s#L28

I'm not familiar with the way the defined constant is wrapping the t0 register. What is this doing?

@noteed
Copy link
Owner

noteed commented Oct 16, 2021

Hi, I'm not at all experienced in assembly, but my guess is that it defines t0 to be UART_BASE 5 lines above. Then at the line you highlighted, it defines t2 to be UART_REG_TXFIFO further than t0. A bit like array indexing, where t0 is the beginning of the array, and UART_REG_TXFIFO is its index.

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

2 participants