Giter Site home page Giter Site logo

bootstrap's People

Contributors

mmastrac avatar rain-1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bootstrap's Issues

Reduce use of hardcoded addresses in bootstrap2

bootstrap2 hardcodes a whole bunch of addresses, and uses a bunch of registers for others. Most (if not all) of these address could be pushed into the jump table at the start of the program (or alternatively, create an aux address table) to make this program easier to modify.

bootstrap3's %call should use stack to stage args

As return values and arguments share the same register (r0), attempting to make a call to another function where the return value is in another position other than the first one causes that argument to get corrupted.

For example:

%call function @foo, @ret will first clobber @ret (aka r0) with @foo, then attempt to put the clobbered value of r0 into r1.

Instead, %call should push the arguments to the stack and then pop them into registers. This is far less efficient, but we're not worried about efficiency in this stage.

This could potentially simplify some argument handling in bootstrap4/compiler0 as well.

Implement %tcall in bootstrap3

Having a tail call macro in bootstrap3 would simplify a lot of code. This code would need to adjust the stack pointer like %ret does before making the call to the procedure.

Create calling convention for bootstrap3

bootstrap3 currently uses an ad-hoc calling convention. After #1 is implemented we could create macros for a function prefix/suffix that would allow us to automatically save and restore a set of registers to the stack on function entry/exit.

There is currently a calling convention in bootstrap4 but that might be too much and too complex for this particular stage. It might be best to just always assume that there are 8 parameters to every function and create the prefix and suffix with that assumption.

This is a pretty big chunk of work as it requires refactoring almost every function in this file.

file not being created, invalid opcode

when I run it I get this

$ sh ./bootstrap/make.sh 
open: No such file or directory
Invalid opcode

I tried changing this line

//		int r = open((const char*)&program[arg1], arg2, 0777);
		int r = open((const char*)&program[arg1], arg2|O_RDWR|O_CREAT, 0777);

and this happens

$ sh ./bootstrap/make.sh 
Invalid opcode
Invalid opcode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.