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

Implement a data segment #23

Open
4 tasks
ralfgerlich opened this issue Apr 26, 2023 · 0 comments
Open
4 tasks

Implement a data segment #23

ralfgerlich opened this issue Apr 26, 2023 · 0 comments
Assignees

Comments

@ralfgerlich
Copy link
Collaborator

ralfgerlich commented Apr 26, 2023

Defining data contents is quite tedious now: One has to write code that places the data somewhere in memory - currently only the stack is available for that - and the data cannot be referred to by labels. There is some support for generating this code using the "Code Gen Save String" example, which queries for a string and outputs the code to be used for storing it in memory, but again, this is tedious to use.

The MARS Emulator - which seems to have been a bit of an inspiration for WeMIPS - provides a separate .data segment and some directives - including an .asciiz directive - to define data contents, and a .text directive to introduce actual assembly code. We could implement something similar to that.

A good start would be to implement the follwing

  • .data directive to introduce data declarations
  • .text directive to introduce code definitions (without any directives used, this would be the default at the start)
  • .word directive to fill the data segment with word-sized entries (signed or unsigned)
  • labels in data space referring to data locations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant