Post ADmjEYgkLsGY8TCsHQ by neauoire@merveilles.town
 (DIR) More posts by neauoire@merveilles.town
 (DIR) Post #ADmjEYgkLsGY8TCsHQ by neauoire@merveilles.town
       2021-11-24T22:20:33Z
       
       0 likes, 0 repeats
       
       @alderwick I can't come on irc right now, but I've been toying with an idea and I'd like to have your opinion.I was wondering if it would be a good idea to make it so the assembler merges sequences of byte literals into literal shorts. I've made a VERY POOR implementation of that in uxnasm to test, and in left there's more than a 100 bytes saved, and it makes the rom considerably faster.I haven't been able to implement this in a way that doesn't make an absolute mess in the source yet-
       
 (DIR) Post #ADmjEZAAaTnlbiyN8q by alderwick@merveilles.town
       2021-11-24T23:45:30Z
       
       0 likes, 0 repeats
       
       @neauoire I'd love it if this optimised use of labels, so (silly example) “,&loop .Console/write” got merged into “LIT df18”. Does your patch do that already?If it also optimised “.Console/write LIT &value 00” then that's more of a grey area. I intend that label should point to that 00 byte for writing a different value at some other time; but even then, conversion to “LIT2 18 &value 00” wouldn't break that use of code.
       
 (DIR) Post #ADmjEZa32GVAtz52Tg by karolbelina@merveilles.town
       2021-11-25T10:24:23Z
       
       0 likes, 0 repeats
       
       @alderwick u just destroyed my brain with “.Console/write LIT &value 00” thanksss
       
 (DIR) Post #ADmjEZzvU3CaCFBhoW by alderwick@merveilles.town
       2021-11-25T10:55:02Z
       
       0 likes, 0 repeats
       
       @karolbelina Perhaps without the “.Console/write” in front, 😉 but “LIT @my-value 00” is one of my favourite ways of1️⃣  saving space for a variable that's only read in one place in the code, but can be written in many places; and2️⃣  summoning the elder gods of self-modifying code and confusion 🦑
       
 (DIR) Post #ADmjEaPnvptzUVIN9M by la_ninpre@distrotoot.com
       2021-11-26T06:53:03Z
       
       0 likes, 0 repeats
       
       @alderwick @karolbelina hmm, sorry to interrupt, but what is the difference between that and just @my-value $1?
       
 (DIR) Post #ADmjEasWD4s2vYjIuG by alderwick@merveilles.town
       2021-11-25T00:10:21Z
       
       0 likes, 0 repeats
       
       @neauoire I'm starting to realise how tricky this is to implement in uxnasm! I thought I was being clever with https://paste.sr.ht/~alderwick/f7fc7ebd1da320921120d11b6d99eb9df59da96f but now I realise that only affects pass 2, so all the labels after the first optimisation are wrong. 🙄
       
 (DIR) Post #ADmmI1C57qbBH6CksK by alderwick@merveilles.town
       2021-11-26T07:27:18Z
       
       0 likes, 0 repeats
       
       @la_ninpre @karolbelina don't worry about interrupting! This is why we have these conversations in the Fediverse 😊There's very little difference between "00" and "$1". In the middle of a Uxntal file it's all down to personal taste. At the end of the file, using only | and $ don't extend the resulting ROM, allowing labels to be placed "beyond" the end of file (which is all zeroes anyway).Of course, if I needed 0000 then $2 is quicker to type, and $3 onwards have no equivalent.
       
 (DIR) Post #ADmnd2dL4Hevm7XhRY by la_ninpre@distrotoot.com
       2021-11-26T07:42:19Z
       
       0 likes, 0 repeats
       
       @alderwick @karolbelina oh, thanks. tried it quickly and really something like |0200 LIT @my-value 00 at the end result in binary full of zeroes.