X Tutup
The Wayback Machine - https://web.archive.org/web/20210115082532/https://github.com/davidgiven/cowgol/pull/19
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

File I/O works on CP/M #19

Merged
merged 12 commits into from Jan 13, 2020
Merged

File I/O works on CP/M #19

merged 12 commits into from Jan 13, 2020

Conversation

@davidgiven
Copy link
Owner

@davidgiven davidgiven commented Jan 13, 2020

This implements a whole bunch of stuff, including some register allocator improvements, allowing almost non-trivial code; enough that the CP/M file I/O library now works well enough to copy files.

The main compiler core issues run into:

  • turns out that mixing stacked and registered parameters in a rule is awkward. If the register is on the LHS and gets spilt to the stack, then this screws up the stack for the RHS. So, this is only allowed if the register is on the RHS. The only time this actually comes into play is STORE4 via a pointer, so change that so that the pointer is on the RHS.

  • the register allocator needs to handle loops in spills and reloads --- e.g. a->b, b->c, c->a. This is now broken by promoting something to a push/pop. A future improvement would be to use a register for this if one's available.

@davidgiven davidgiven merged commit 4ff23b7 into master Jan 13, 2020
1 check passed
1 check passed
build-linux
Details
@davidgiven davidgiven deleted the newgen branch Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.
X Tutup