code logs -> 2019 -> Thu, 22 Aug 2019< code.20190821.log - code.20190823.log >
--- Log opened Thu Aug 22 00:00:56 2019
00:28 McMartin [mcmartin@Nightstar-ipm463.ca.comcast.net] has quit [[NS] Quit: Kernel upgrade]
00:40 McMartin [mcmartin@Nightstar-ipm463.ca.comcast.net] has joined #code
00:40 mode/#code [+ao McMartin McMartin] by ChanServ
00:49 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
01:45 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has joined #code
01:45 mode/#code [+o himi] by ChanServ
02:17 celmin|away is now known as celticminstrel
02:29
<&ToxicFrog>
I think this may be a new record for number of closing parens: (withBackgroundColor (Colour "#000000"))))))))
02:37
<@Reiv>
Impressive!
03:15
<&McMartin>
Clojure?
04:46 Derakon is now known as Derakon[AFK]
06:00 Vorntastic [uid293981@Nightstar-2dc.p8m.184.192.IP] has joined #code
06:00 mode/#code [+qo Vorntastic Vorntastic] by ChanServ
06:18 celticminstrel [celticminst@Nightstar-6an2qt.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:21 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Ping timeout: 121 seconds]
08:31
< Yossarian>
Vorntastic: https://hackaday.com/2019/08/20/dirty-tricks-for-6502-programming/#more-372673
08:39
<&McMartin>
My absolute favorite version of the "what the instruction is depends on where you jump" trick is this one. https://bumbershootsoft.wordpress.com/2014/05/04/cycle-exact-delays-on-the-6502/
08:40
<&McMartin>
https://bumbershootsoft.wordpress.com/2015/12/13/raster-grip/ is a technique I managed to devise on my one, though there is a broader and very well established C64 technique it is part of.
08:40
<&McMartin>
*on my own
08:45
<&McMartin>
https://en.wikipedia.org/wiki/MOS_Technology_6502#Bugs_and_quirks is also a valuable list.
08:45
<&McMartin>
And once you have your feet under you CodeBase64 is an excellent cite for C64 stuff specifically.
08:47
<~Vorntastic>
At this point I can read most of the assembler in here at speed, the only question is semantics
08:48 * McMartin nods
08:48
<&McMartin>
6502 is really clean that way
08:49
<~Vorntastic>
Like I haven't opened the opcode reference in several days
08:49
<&McMartin>
It's also got the unusual property that you can meaningfully assemble it with, like sed.
08:49
<&McMartin>
The first byte of every instruction is the opcode and addressing more as an arbitrary lump, and then the argument follows
08:49
<&McMartin>
Everything that matters is at byte boundaries
08:49
<&McMartin>
This is not as true for Z80, even less true for x86, and the opposite of true for 68000 and ARM
08:50
<&McMartin>
It's not technically true for MIPS but it's close; all instructions are one word long and looking at the most significant few bits will tell you which bitfield layout (of like four total) will correctly decode the instruction
08:53
<&McMartin>
ARM is similar until you get to THUMB but even then the encodings are kind of bonkers
08:55
<&McMartin>
arguments in noncontiguous bitfields, or chunks of arguments are not in significance order, etc
08:56
<~Vorntastic>
That's wild
09:04
<&McMartin>
Remember, bitfield decoding is free in hardware, because you just hook up the wires differently from output to next input~
09:04
<&McMartin>
(Today in statements that are maybe not completely false)
09:05 * McMartin finishes auditing the month's UQM hacking to note which bits he needs to tear back out now that he realizes what he should have been doing all along, heads to bed
09:06
<&McMartin>
Though re: Z80 it being almost true: all numeric arguments are split at byte boundaries like in the 6502
09:06
<&McMartin>
But all register arguments are glommed into the opcodes in vaguely but not entirely consistent ways
09:06
<&McMartin>
But some of *that* is that you write LD A, X instead of TXA
09:06
<~Vorntastic>
I'm just reminded of reading about MMIX and going "he describes features in ways that suggest they're not common"
09:07
<&McMartin>
And LD A, 47 as LDA #47
09:07
<&McMartin>
But then there are also three opcodes that mean "start over but use this other table of instructions" because they have Too Many Opcode+Hardcoded Operand Combinations
09:08
<&McMartin>
I actually never properly learned MIX nor MMIX, just kind of seat-of-the-pantsed it when I encountered code in it
09:08
<~Vorntastic>
And I thought this couldn't be true because these things are far too sensible
09:09
<~Vorntastic>
And learning about how assembler is in general was a very ...
09:09
<&McMartin>
There's "sensible" and then there's "we can build it with 4,000 transistors"~
09:10
<~Vorntastic>
It was not pleasant
09:11
<&McMartin>
The joy of assembler is largely "this is what you can do with stone tools"
09:11
<&McMartin>
And MMIX ends up looking rather a lot like, well, a low level intermediate language
09:11
<&McMartin>
Hell, MIPS does, even with its bonkers jump delay slots.
09:11
<&McMartin>
(specifically, MIPS looks like three-address code~)
09:11
<&McMartin>
Though once you get a good feel for it, 6502 ends up looking like two-address code.
09:13
<&McMartin>
viz. https://bumbershootsoft.wordpress.com/2017/03/11/getting-a-decent-and-fast-prng-out-of-an-8-bit-chip/ and how that insight kicked me out of my tailspin
09:14
<&McMartin>
Heh
09:14
<&McMartin>
Also re: inconsistent or non-orthogonal instructions
09:14
<&McMartin>
"Then on x86, anything goes, except for 16-bit indexed memory accesses, where of the 63 possible ways you could write an instruction of the form mov [bp+si+3], exactly 17 are legal."
09:24
<~Vorntastic>
What.
09:39
<&McMartin>
The rule for an address in 16-bit x86 is: at most one of [BX, BP] plus at most one of [SI, DI] plus at most one constant, and you can't omit everything
09:39
<&McMartin>
3*3*2-1 = 17
10:10 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
10:50
<@abudhabi>
That feeling when you have one of those camouflage moths sitting on the edge of your laptop screen, but you just let it sit there.
10:50
<&Reiver>
"Hey little dude, I have no beef with you. Chill." ?
11:12
< Emmy>
as long as they don't randomly flap through your cone of vision
11:34 gnolam [quassel@Nightstar-0oc.n80.224.185.IP] has joined #code
11:34 mode/#code [+o gnolam] by ChanServ
12:13
<@abudhabi>
Reiver: Yes.
12:14
<@abudhabi>
https://i.imgur.com/5cpd7CW.jpg
13:17 gnolam [quassel@Nightstar-0oc.n80.224.185.IP] has quit [[NS] Quit: Gone]
13:33 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Connection closed]
13:33 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code
13:33 mode/#code [+ao VirusJTG VirusJTG] by ChanServ
14:13 celticminstrel [celticminst@Nightstar-6an2qt.dsl.bell.ca] has joined #code
14:14 mode/#code [+o celticminstrel] by ChanServ
14:52 Kindamoody[zZz] is now known as Kindamoody
15:05 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Operation timed out]
15:20 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
15:20 mode/#code [+qo Vornicus Vornicus] by ChanServ
15:52 gnolam [lenin@Nightstar-e3tf4i.priv.bahnhof.se] has joined #code
15:52 mode/#code [+o gnolam] by ChanServ
17:03 Kindamoody is now known as Kindamoody|afk
18:18 Vorntastic [uid293981@Nightstar-2dc.p8m.184.192.IP] has quit [[NS] Quit: Connection closed for inactivity]
19:12 Derakon[AFK] is now known as Derakon
19:30
<&McMartin>
Meanwhile, in another channel entirely, out of left field
19:30
<&McMartin>
https://nurpax.github.io/posts/2019-08-18-dirty-tricks-6502-programmers-use.html
19:30
<&McMartin>
These are almost all C64-specific except for some things that have names as standard compiler optimizations
19:30
<&McMartin>
But it was last week and it seems relevant!
19:36
<~Vornicus>
Oh *that* is how they do it
19:37
<~Vornicus>
I always remembered games that would load in and run themselves and that was 1. rude and 2. black fucking magic
19:46
<~Vornicus>
(looking at one of the winners, which made it so loading his prg would land a jmp right inside the basic idle loop)
20:26
<~Vornicus>
10: sizeof(critter_stats)
21:26
<&McMartin>
The basic idle loop technique is the one that's actually reliable
21:28
<&McMartin>
Also you can be less rude by loading into the cassette read buffer and then replicating the (consistent) data from BASIC's runtime up to the warm restart vector
21:28
<&McMartin>
and there is enough room in the cassette read buffer to write a small program to properly load and run some other file, so you can get a bootstrap loader out
21:54 Kindamoody|afk is now known as Kindamoody
22:14 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
22:14 macdjord|slep [macdjord@Nightstar-rslo4b.mc.videotron.ca] has quit [Connection closed]
22:14 Kindamoody [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has quit [Connection closed]
22:14 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
22:14 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:14 KiMo|autorejoin [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has joined #code
22:15 macdjord|slep [macdjord@Nightstar-rslo4b.mc.videotron.ca] has joined #code
22:15 mode/#code [+o macdjord|slep] by ChanServ
22:15 KiMo|autorejoin is now known as Kindamoody
22:53 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
23:06 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
23:28 Kindamoody is now known as Kindamoody[zZz]
23:36 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code
23:36 mode/#code [+ao VirusJTG VirusJTG] by ChanServ
23:48
<&Derakon>
Mental note: in C# at least, float.NaN != float.NaN.
23:48
<&Derakon>
This may be common.
23:48
<&Derakon>
But it means I can't use NaN for "this variable has not yet been initialized".
23:50
<@Reiv>
That is correct and expected behavior
23:50
<@Reiv>
NaN is NULL and the whole point of NULL is 'you don't know'
23:50
<@Reiv>
'we have no data'
23:50
<@Reiv>
"Is this no data the same as that no data?" "How the hell am I supposed to answer that question"
23:50
<&Derakon>
Yeah, I'm used to thinking in terms of Python's None which is its own special type.
23:51
<@Reiv>
Yeah, that's /explicitly/ no data
23:51
<&Derakon>
But that's more like a null pointer, which you couldn't assign to a float.
23:51
<@Reiv>
Right
23:51
<@Reiv>
There is theoretically something equivalent to isnull() in there I am certain
23:51
<@Reiv>
Guess I'm gonna be learning the precise syntax along with you, of course~
--- Log closed Fri Aug 23 00:00:57 2019
code logs -> 2019 -> Thu, 22 Aug 2019< code.20190821.log - code.20190823.log >

[ Latest log file ]