| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
New convention: compare 'with' for asymmetric comparisons (greater or lesser
than), and compare 'and' for symmetric comparisons. Worth making this distinction
even though the opcodes are identical; when we compare 'with', the order
of operands is significant.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Considering how much trouble a merge phase would be (commit 4978), it seems
simpler to just add the extra syntax for controlling the entry point of
the generated ELF binary.
But I wouldn't have noticed this if I hadn't taken the time to write out
the commit messages of 4976 and 4978.
Even if we happened to already have linked list primitives built, this
may still be a good idea considering that I'm saving quite a lot of code
in duplicated entrypoints.
|
|
|
|
|
| |
Support immediate operands in the data segment in all the ways we support
them in the code segment.
|
| |
|
| |
|
|
|
|
|
| |
We want slice-equal? for length-prefixed strings, not null-terminated "kernel"
strings.
|
| |
|
|
|
|
| |
We only can't use rm32=5 when mod=0. Totally fine when it's mod=1.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some automated commenting cleanup. Still needs more careful manual scanning.
sed -i 's/^# 1-3/# . 1-3/' *.subx */*.subx
sed -i 's/^# op/# . op/' *.subx */*.subx
sed -i 's/# vim/# . . vim/' *.subx */*.subx
sed -i 's/^ # push args/ # . . push args/' *.subx */*.subx
sed -i 's/^ # discard args/ # . . discard args/' *.subx */*.subx
sed -i 's/^ # call/ # . . call/' *.subx */*.subx
sed -i 's/^ # prolog/ # . prolog/' *.subx */*.subx
sed -i 's/^ # epilog/ # . epilog/' *.subx */*.subx
sed -i 's/^ # save registers/ # . save registers/' *.subx */*.subx
sed -i 's/^ # restore registers/ # . restore registers/' *.subx */*.subx
sed -i 's/ operand / register /' *.subx */*.subx
|
|
|
|
| |
Reindent all SubX code to make some room for the new comment style.
|
|
|
|
| |
Thanks Pelle Hjek for the feedback: http://arclanguage.org/item?id=20870
|
| |
|
|
|
|
|
|
| |
Let's start highlighting all global variables in Red. Assembly programming
has a tendency to over-use them. They're a necessary evil, but we should
minimize the number of functions that access them.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Standardize on hyphens in all names.
And we'll use colons for namespacing labels in functions.
|
| |
|
|
|
|
|
| |
Make segment management a little more consistent between initial segments
and add-on segments (using `mmap`).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Start requiring a '-o' flag to designate the output binary when translating.
Things currently get funky if you pass in multiple inputs, but that's ok.
This is the first step to supporting multiple input files for a single
output binary.
|
|
|
|
|
| |
When I started SubX I imagined that being able to write machine code directly
was a feature. Now it's just a hole I haven't bothered closing yet.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
It was broken since I added support for global variables, back on Sep 1.
One other subtle thing I've improved is the name `looks_like_hex_int`.
We can now distinguish in the pack-operands transform between ignoring
'foo' because it doesn't look like a number, and immediately flagging '0xfoo'
as an error because it *should* be a number.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
More calling convention tweaks.
Use EBP to get consistently at parameters and locals.
Always put the first function argument closest to EBP.
|
|
|
|
|
|
|
|
| |
New helper: compare a null-terminated string (from argv) with a length-prefixed
string (anywhere else).
As long as ex11 continues to pass we can copy the function and its tests
to other programs.
|
|
|
|
| |
Include LEA (load effective address) in the SubX subset of x86 ISA.
|
| |
|
| |
|
| |
|