-
Notifications
You must be signed in to change notification settings - Fork 587
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
Avr #409
Conversation
tballmsft
commented
Oct 3, 2016
- refactoring to support AVR assembler and Thumb Assembler
- refactoring of backthumb.ts to backbase.ts, hexfile.ts, backthumb.ts
# Conflicts: # pxtlib/emitter/avr.ts
# Conflicts: # pxtlib/emitter/assembler.ts # pxtlib/emitter/thumb.ts
@@ -3240,6 3251,7 @@ cmd("extract [FILENAME] - extract sources from .hex/.jsz file, stdin ( | |||
cmd("test - run tests on current package", testAsync, 1) | |||
cmd("gendocs - build current package and its docs", gendocsAsync, 1) | |||
cmd("format [-i] file.ts... - pretty-print TS files; -i = in-place", formatAsync, 1) | |||
cmd("testassembler - test the assemblers", testAssemblers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to have ,1)
or ,2)
to hide from simple help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
// more special characters to handle | ||
if (s.indexOf("@") >= 0) { | ||
m = /^(\w )@(-?\d )$/.exec(s) | ||
if (m) { | ||
if (mul != 1) | ||
this.directiveError(lf("multiplication not supported with saved stacks")); | ||
if (this.stackpointers.hasOwnProperty(m[1])) | ||
// TODO: ARM-specific??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not ARM-specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
v = 4 * (this.stack - this.stackpointers[m[1]] parseInt(m[2])) | ||
else | ||
this.directiveError(lf("saved stack not found")) | ||
} | ||
|
||
// TODO: ARM-specific??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
@@ -390,17 387,14 @@ namespace ts.pxtc.assembler { | |||
if (this.finalEmit) | |||
this.directiveError(lf("unknown label: {0}", name)); | |||
else | |||
// Is this a joke? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There needs to be a value here, and in the first emit labels might not be resolved yet. I think there was some reason not to use 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
// - pop/push receive register sets: { r0, r3, r4 } | ||
// - r0 is the current value (from expression evaluation) | ||
// - also used (fixed) are r1, r2, r5, r6 (what about r3, r4?) | ||
// - registers for runtime calls (r1,r2,r3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also r0
// - registers are 32-bit (really???) | ||
// - pop/push receive register sets: { r0, r3, r4 } | ||
// - r0 is the current value (from expression evaluation) | ||
// - also used (fixed) are r1, r2, r5, r6 (what about r3, r4?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r5 is for captured locals in lambda and r6 for globals; it's unclear why not r4 and r5
return r | ||
} | ||
|
||
// TODO: generalize and lift out ARM-specific code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's nothing ARM-specific in this function
@@ -0,0 1,77 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have a "tests" folder, can you move all the /test/avr/
files under there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong button.
@@ -0,0 1,183 @@ | |||
import re |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pxt is fundamentally a JS project. We should avoid adding dependencies to Python. Can this be rewritten in JS instead?
@@ -0,0 1,77 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong button.