<feed xmlns='http://www.w3.org/2005/Atom'>
<title>torque-asm/src/stages, branch v2.4.0</title>
<subtitle>Lightweight meta-assembler</subtitle>
<id>https://code.benbridle.com/torque-asm/atom?h=v2.4.0</id>
<link rel='self' href='https://code.benbridle.com/torque-asm/atom?h=v2.4.0'/>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/'/>
<updated>2025-04-26T02:45:05Z</updated>
<entry>
<title>Allow label references in pinned address calculations</title>
<updated>2025-04-26T02:45:05Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-04-26T02:44:50Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=50592a5184e701dd09eee024bb773ec57c1cd6bf'/>
<id>urn:sha1:50592a5184e701dd09eee024bb773ec57c1cd6bf</id>
<content type='text'>
This is a relaxation of the rule where a label reference could not
be used in any context that could change the length of an assembled
program.

We implement this in the bytecode stage by naively calculating an
initial address for each label as before. If a pinned address is
calculated from a label reference, some of the calculated addresses
could be incorrect. We then attempt to run the bytecode stage, which
will calculate a more accurate address for each label based on how
pinned addresses are calculated. If the address of any label was
changed by running this stage, we re-run the stage up to three more
times until all labels stabilise. If the labels fail to stabilise, we
return an error.
</content>
</entry>
<entry>
<title>Implement first-class string literals</title>
<updated>2025-04-26T01:00:51Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-04-26T01:00:51Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=e5447e2568e24db9a5218bbe452b856266ca39ae'/>
<id>urn:sha1:e5447e2568e24db9a5218bbe452b856266ca39ae</id>
<content type='text'>
This feature promotes strings to a first-class type in the language.
If a string is passed to an invocation via the new string-type argument,
the string will be passed as a whole value. String arguments can still
be passed to an invocation via an integer-type argument, in which case
they'll be broken apart into individual characters with the macro being
invoked once per character.

String-type macro arguments are declared like "name".
</content>
</entry>
<entry>
<title>Fix misleading error message</title>
<updated>2025-04-25T21:31:58Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-04-25T21:30:24Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=83e5107684a37aa825d626c19a2af7fd6bfc231a'/>
<id>urn:sha1:83e5107684a37aa825d626c19a2af7fd6bfc231a</id>
<content type='text'>
The code here is really expecting a block value, but has received an
integer value. This catches the case where an integer value is
incorrectly included in a macro definition body alongside block tokens.
</content>
</entry>
<entry>
<title>Allow a macro to invoke itself safely</title>
<updated>2025-04-18T08:47:59Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-04-18T08:47:47Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=75018f1ec69162a0695e603030f5e1a5cc105af0'/>
<id>urn:sha1:75018f1ec69162a0695e603030f5e1a5cc105af0</id>
<content type='text'>
A macro can now invoke itself if the invocation is inside a conditional
block that will eventually return false. The assembler stack can still
overflow if the macro recurses too deeply, or if a macro calls itself
without a conditional block.
</content>
</entry>
<entry>
<title>Allow a macro to invoke itself</title>
<updated>2025-04-18T08:45:19Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-04-18T08:43:37Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=e0595e64cc1fa3c9b01a73ed9c67487e40dc54f9'/>
<id>urn:sha1:e0595e64cc1fa3c9b01a73ed9c67487e40dc54f9</id>
<content type='text'>
This will currently cause the assembler to hang in all situations where
it is used.
</content>
</entry>
<entry>
<title>Implement &lt;len&gt; operator for expressions</title>
<updated>2025-04-18T08:34:39Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-04-18T08:34:39Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=373c512397dde9c767ac65453780931a84704ce4'/>
<id>urn:sha1:373c512397dde9c767ac65453780931a84704ce4</id>
<content type='text'>
The &lt;len&gt; operator returns the width of an integer in bits, using the
same calculation as for packing an integer into a bit field.
</content>
</entry>
<entry>
<title>Implement octal literals</title>
<updated>2025-04-17T04:37:45Z</updated>
<author>
<name>Ben Bridle</name>
<email>bridle.benjamin@gmail.com</email>
</author>
<published>2025-04-17T04:37:45Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=6eb86dc668ccd3e3b263f5942ab4eef63f49a7db'/>
<id>urn:sha1:6eb86dc668ccd3e3b263f5942ab4eef63f49a7db</id>
<content type='text'>
Octal literals use the prefix '0o'.
</content>
</entry>
<entry>
<title>Fix width checks for negative integers</title>
<updated>2025-04-11T22:19:26Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-04-11T22:19:26Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=dddb76c4ad504022fa4f4c4f6965c08da22c387e'/>
<id>urn:sha1:dddb76c4ad504022fa4f4c4f6965c08da22c387e</id>
<content type='text'>
The width of a negative integer was previously being counted in the
same way as for a positive integer, by inverting the bits to make it a
positive integer and then finding the placement of the highest-order 1
bit.

The actual width of a negative integer will always be one greater than
this value however, because the highest-order 1 bit of an inverted
negative integer will always have directly above it a significant 0 bit
used as the sign bit.
</content>
</entry>
<entry>
<title>Implement negative integer literals</title>
<updated>2025-04-11T22:08:09Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-04-11T22:08:09Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=c724c9157dbc4721fa8ed93033cd9699c9652277'/>
<id>urn:sha1:c724c9157dbc4721fa8ed93033cd9699c9652277</id>
<content type='text'>
Negative literals take the forms -29, -0x1D, and -0b11101 for decimal,
hexadecimal, and binary.
</content>
</entry>
<entry>
<title>Report token without prefix in invalid literal errors</title>
<updated>2025-03-22T22:37:29Z</updated>
<author>
<name>Ben Bridle</name>
<email>ben@derelict.engineering</email>
</author>
<published>2025-03-22T22:37:29Z</published>
<link rel='alternate' type='text/html' href='https://code.benbridle.com/torque-asm/commit/?id=315d23bf2148e831b0c14a118841133aacc1fb96'/>
<id>urn:sha1:315d23bf2148e831b0c14a118841133aacc1fb96</id>
<content type='text'>
Previously, the token quoted in the error message for an invalid
literal error included the radix prefix. This is already visible in
the highlighted source report, and implied by the named radix in the
error message.
</content>
</entry>
</feed>
