about summary refs log tree commit diff stats
path: root/apps/calls.subx
Commit message (Collapse)AuthorAgeFilesLines
* 6943Kartik Agaram2020-10-041-1/+58
| | | | | | | | Move some implementation around for floating-point. I originally thought I wouldn't bother supporting sigils like %xmm0. But it turns out I need them to pass floats into SubX function calls. And it turns out the sigils work fine for free.
* 6595Kartik Agaram2020-06-291-3/+3
|
* 6507 - use syscall names everywhereKartik Agaram2020-06-101-16/+8
|
* 6212Kartik Agaram2020-04-251-1/+1
|
* 6158 - standardize opcode namesKartik Agaram2020-03-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the lowest level, SubX without syntax sugar uses names without prepositions. For example, 01 and 03 are both called 'add', irrespective of source and destination operand. Horizontal space is at a premium, and we rely on the comments at the end of each line to fully describe what is happening. Above that, however, we standardize on a slightly different naming convention across: a) SubX with syntax sugar, b) Mu, and c) the SubX code that the Mu compiler emits. Conventions, in brief: - by default, the source is on the left and destination on the right. e.g. add %eax, 1/r32/ecx ("add eax to ecx") - prepositions reverse the direction. e.g. add-to %eax, 1/r32/ecx ("add ecx to eax") subtract-from %eax, 1/r32/ecx ("subtract ecx from eax") - by default, comparisons are left to right while 'compare<-' reverses. Before, I was sometimes swapping args to make the operation more obvious, but that would complicate the code-generation of the Mu compiler, and it's nice to be able to read the output of the compiler just like hand-written code. One place where SubX differs from Mu: copy opcodes are called '<-' and '->'. Hopefully that fits with the spirit of Mu rather than the letter of the 'copy' and 'copy-to' instructions.
* 6046Kartik Agaram2020-02-211-45/+42
| | | | One more error condition when desugaring function calls in SubX.
* 5924Kartik Agaram2020-01-271-25/+25
|
* 5903Kartik Agaram2020-01-191-4/+5
|
* 5897 - rename comparison instructionsKartik Agaram2020-01-161-25/+25
| | | | | | | Signed and unsigned don't quite capture the essence of what the different combinations of x86 flags are doing for SubX. The crucial distinction is that one set of comparison operators is for integers and the second is for addresses.
* 5896Kartik Agaram2020-01-161-1/+1
|
* 5895Kartik Agaram2020-01-161-1/+1
|
* 5883 - drop the `ref` keywordKartik Agaram2020-01-121-16/+16
| | | | | | | | | | When I created it I was conflating two things: a) needing to refer to just the start, rather than the whole, and b) counting indirections. Both are kinda ill-posed. Now Mu will have just `addr` and `handle` types. Normal types will translate implicitly to `addr` types, while `handle` will always require explicit handling.
* 5880Kartik Agaram2020-01-101-1/+1
|
* 5876 - address -> addrKartik Agaram2020-01-031-7/+7
|
* 5844Kartik Agaram2019-12-301-3/+3
| | | | | Let's start putting r32 first in compare instructions that need it. Ordering there is quite subtle and of great import.
* 5804Kartik Agaram2019-12-081-28/+28
| | | | | Try to make the comments consistent with the type system we'll eventually have.
* 5790Kartik Agaram2019-12-051-10/+10
| | | | | | Standardize conventions for labels within objects in the data segment. We're going to use this in a new tool.
* 5715Kartik Agaram2019-10-261-2/+2
| | | | | | | Clean up pseudocode to match planned syntax for the type- and memory-safe level-2 Mu language. http://akkartik.name/post/mu-2019-2 is already out of date.
* 5714Kartik Agaram2019-10-251-24/+10
| | | | Replace calculations of constants with labels.
* 5700Kartik Agaram2019-10-171-1/+1
|
* 5698Kartik Agaram2019-10-151-33/+33
| | | | Thanks Andrew Owen for reporting this typo.
* 5678Kartik Agaram2019-09-191-29/+29
|
* 5675 - move helpers from subx-common into layersKartik Agaram2019-09-191-1/+1
| | | | | | | | | | | | | | | | This undoes 5672 in favor of a new plan: Layers 000 - 099 are for running without syntax sugar. We use them for building syntax-sugar passes. Layers 100 and up are for running with all syntax sugar. The layers are arranged in approximate order so more phases rely on earlier layers than later ones. I plan to not use intermediate syntax sugar (just sigils without calls, or sigils and calls without braces) anywhere except in the specific passes implementing them.
* 5664Kartik Agaram2019-09-181-1/+0
|
* 5661Kartik Agaram2019-09-151-1/+1
|
* 5637Kartik Agaram2019-09-071-2/+2
|
* 5631 - syntax for calls starting to work!Kartik Agaram2019-09-061-13/+554
| | | | Now added to CI.
* 5630Kartik Agaram2019-09-061-5/+57
|
* 5627Kartik Agaram2019-09-061-41/+41
|
* 5626Kartik Agaram2019-09-061-285/+285
|
* 5624Kartik Agaram2019-09-051-1/+69
| | | | Fix a bug in call.subx's tokenizer.
* 5621Kartik Agaram2019-09-041-8/+160
| | | | Done with calls.subx's variant of next-word.
* 5620Kartik Agaram2019-09-041-25/+629
| | | | | | Further flesh out next-word variant for calls.subx. All the code is sketched out, and baseline tests pass. No tests yet for new functionality compared to sigils.subx.
* 5613Kartik Agaram2019-09-031-0/+167
| | | | | Translating common bits from sigils.subx expression-aware variant of next-word to use sigils in calls.subx.
* 5612Kartik Agaram2019-09-021-1/+1
|
* 5611Kartik Agaram2019-09-021-3/+3
|
* 5607 - start of notation for function callsKartik Agaram2019-09-021-0/+216