From 5852bb94373c7b8dddd7c4b0b5a105b2d769d4ac Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 8 Aug 2018 23:28:58 -0700 Subject: 4497 --- subx/035labels.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/subx/035labels.cc b/subx/035labels.cc index b3638c8b..957fa5a0 100644 --- a/subx/035labels.cc +++ b/subx/035labels.cc @@ -1,6 +1,20 @@ //: Labels are defined by ending names with a ':'. This layer will compute //: addresses for labels, and compute the offset for instructions using them. +//: We're introducing non-number names for the first time, so it's worth +//: laying down some ground rules all transforms will follow, so things don't +//: get too confusing: +//: - if it starts with a digit, it's treated as a number. If it can't be +//: parsed as hex it will raise an error. +//: - if it starts with '-' it's treated as a number. +//: - if it starts with '0x' it's treated as a number. +//: - if it's two characters long, it can't be a name. Either it's a hex +//: byte, or it raises an error. +//: That's it. Names can start with any non-digit that isn't a dash. They can +//: be a single character long. 'a' is not a hex number, it's a variable. +//: Later layers may add more conventions partitioning the space of names. But +//: the above rules will remain inviolate. + :(scenarios transform) :(scenario map_label) == 0x1 -- cgit 1.4.1-2-gfad0