Annotate bitwise038

This commit is contained in:
Matt Mascarenhas 2018-06-18 00:12:23 +01:00
parent 1b0a3de3cb
commit 8decf7f334
2 changed files with 107 additions and 0 deletions

View File

@ -0,0 +1,104 @@
[video member=pervognsen stream_platform=twitch project=bitwise title="Forth Implementation, Part 4" vod_platform=youtube id=asW2hkGnsyM annotator=Miblo]
[0:08][Recap and set the stage for the day][:speech]
[1:48][Review the addition of "key" word and renaming of "xt" to ">cfa"][:asm :research]
[5:42][:Run it to demo the FORTH program execution][:asm]
[6:39][Modes in FORTH: immediate vs compilation][:asm :speech]
[11:43][Mode-agnostic immediate words][:asm :speech]
[12:52][Dive into implementing modes][:asm]
[13:36][Introduce a _push_latest word that initialises variables][:asm]
[15:19][Introduce mode and cp labels, and "cp" word, establishing the convention that all constants are upper case][:asm]
[20:01][Dive into implementing the ability to dynamically define dictionary entries, introducing "here" and "allot" words, and "c\@" and "c!" for byte-wise loads and stores][:asm]
[25:54][Spec out our dynamic dictionary entry definition implementation][:asm]
[27:48][The "," helper word][:asm :speech]
[28:49][Continue to spec out our dynamic dictionary entry definition implementation][:asm]
[35:15][Introduce "swap" word][:asm]
[36:10][Spec out a "cmove" word, as if we have all the facilities for it][:asm :memory]
[43:11][Introduce "rot" and "-rot" words][:asm]
[45:17][Expand our cmove spec to FORTH][:asm]
[49:38][Introduce branch][:asm]
[49:57][@sci4me][Uh, that doesn't duplicate the top two elements, that duplicates the top element twice]
[50:01][Introduce "over" word][:asm]
[51:12][Expand "2dup"][:asm]
[51:50][@rygorous][@pervognsen I'm gonna go out on a limb here and say you should write a small bootstrapping tool that converts those basic definitions into assembly, because transcribing that is gonna get old fast][:asm]
[52:23][Fix 2dup][:asm]
[52:57][Expand "branch"][:asm]
[54:21][Introduce "mux" for "branch" to use][:asm]
[59:11][@rygorous][@pervognsen x ^ ((y ^ x) & mask)]
[59:49][Move our newly defined words into the FORTH implementation][:asm]
[1:04:35][Test mux][:asm]
[1:05:45][:Run it to see that the mux test fails][:asm]
[1:06:04][Remove the mux from our input_buf][:asm]
[1:06:08][:Run it to see 0 as expected][:asm]
[1:06:16][Reinsert mux into our input_buf, and endeavour to fix its definition, introducing a "neg" word][:asm]
[1:07:44][:Run it to see that it never prints anything][:asm]
[1:09:18][Fix the definitions of our new words as words, rather than codes][:asm]
[1:09:32][:Run it to see that it prints "0"][:asm]
[1:09:38][Re-enable some of the "mux" definition][:asm]
[1:09:44][:Run it to see that it prints "0"][:asm]
[1:09:53][Change our mux test to use 1][:asm]
[1:09:56][:Run it to see that it prints "/" in lieu of a -1][:asm]
[1:10:21][Change our mux test to use 4][:asm]
[1:10:25][:Run it to see that it prints "/" in lieu of a 4][:asm]
[1:10:32][Re-enable our entire "mux" definition][:asm]
[1:10:48][:Run it to see that it prints "0"][:asm]
[1:11:10][Flesh out of "mux" word spec, introducing "xor" and "not" words][:asm]
[1:13:43][:Run it to see that it prints "."][:asm]
[1:13:52][Scrutinise our "mux" definition, and consider the need for better debugging functionality][:asm :research]
[1:16:25][Fix "xor"][:asm]
[1:16:32][Continue to scrutinise the words called by "mux"]
[1:17:33][Break down our mux test][:asm]
[1:18:25][Introduce "show" word, and enable cmd_loop() in the assembler to quit when "q" is pressed][:asm :"input handling"]
[1:21:57][:Run it, crash in step() and investigate why][:asm]
[1:27:28][Fix the uintptr_t definition in Ion]
[1:28:01][:Run it, successfully hit our breakpoint and inspect the workings of "mux"][:asm]
[1:29:36][Inline our mux definition][:asm]
[1:30:47][Step through our FORTH program to find that the "<>0" didn't work][:asm :run]
[1:32:47][Fix "<>0" to "0<>" in our input stream][:asm]
[1:32:57][Step through our FORTH program to find that the rotation is incorrect][:asm :run]
[1:34:34][Fix our "-rot" definition][:asm]
[1:34:39][Step through our FORTH program to find that the entire routine works][:asm :run]
[1:36:30][Implement "branch"][:asm]
[1:37:26][Test "branch" out on a toggle program][:asm]
[1:41:18][:Run it to see how it works][:asm]
[1:41:39][Make the program echo the input before doing the branch][:asm]
[1:41:54][:Run it to determine that the branching may be busted, and investigate why][:asm]
[1:42:30][Test to find that the infinite loop is indeed working][:asm :programming :run]
[1:42:50][Scrutinise our "branch" definition][:asm :research]
[1:45:32][Make the program call "show" before and after branching][:asm]
[1:45:48][Step in to our program and crash in bus_load_word()][:asm :run]
[1:46:39][Try a variant of "branch" that should unconditionally fall through][:asm]
[1:47:04][:Run it to find that it is unconditionally falling through][:asm]
[1:47:23][Try a variant of "branch" testing that the offset is correct][:asm]
[1:47:31][:Run it to confirm that the branch offset is correct][:asm]
[1:48:00][Fix "branch" to swap between add and load][:asm]
[1:49:10][:Run it to find that it works now][:asm]
[1:50:07][Implement "cmove" from our spec][:asm :memory]
[1:55:16][Determine to test our "cmove"][:asm :speech]
[1:55:53][@sci4me][That's not quite right. You're storing to the wrong location, I think]
[1:56:11][Scrutinise our "cmove" spec][:asm :research]
[1:57:24][Loft out some of "cmove" into a "cmove1" word, introducing "1+" and "1-"][:asm]
[2:01:48][Conjugation][:speech]
[2:04:19][@miotatsu][My introduction to conjugation as well as commutators was Rubik's cubes, fun stuff]
[2:05:48][Implement "create" from our spec][:asm]
[2:08:30][Spec out "aligned" and "align"][:asm]
[2:09:59][Implement "aligned" from our spec, and "2" and "3" literals][:asm]
[2:11:20][Test "aligned" (also implementing "align" from our spec)][:asm]
[2:12:36][:Run it to see that it looks good][:asm]
[2:13:33][Break][:admin]
[2:13:54][:afk]
[2:14:43][Return and enable "create" to set the cfa field, introducing "docol"][:asm]
[2:16:53][Introduce "'" word][:asm]
[2:18:44][Test "create" on an "8" word, based on 4 × 2][:asm]
[2:22:34][Step in to our program to see that the "create" has worked][:asm :run]
[2:25:41][Test "create" on a "twice" word][:asm]
[2:26:54][:Run it to find that it's not working, and investigate why][:asm]
[2:29:57][Assert that there is space on the stack for a new dictionary entry][:asm :memory]
[2:33:14][Investigate the stack effects of "create"][:asm :memory :research]
[2:35:23][Make "cmove" drop its arguments, introducing "2drop" and "3drop"][:asm :memory]
[2:36:39][Step through it until we crash in bus_load_word()][:asm :memory :run]
[2:37:25][Verify that multi-character definitions do not work][:asm :programming :memory :run]
[2:37:53][Try creating a 3-character dictionary entry][:asm :memory]
[2:38:29][:Run it to determine that it could be an alignment or length issue][:asm :memory]
[2:40:11][Scrutinise "cmove1", "cmove" and "create"][:asm :memory :research]
[2:41:56][Cut off the stream][:speech]
[/video]

View File

@ -0,0 +1,3 @@
[video member=pervognsen stream_platform=twitch project=bitwise title="Forth Implementation, Part 4 (Extra)" vod_platform=youtube id=ceTRcHsXRzQ annotator=Miblo]
[0:00][\[Entire stream, not annotated\]][:asm]
[/video]