Annotate bitwise031

bitwise030: Spelling
This commit is contained in:
Matt Mascarenhas 2018-05-29 22:58:13 +01:00
parent d79b7eab16
commit f148317548
2 changed files with 56 additions and 3 deletions

View File

@ -11,10 +11,10 @@
[15:38][Describe the implementation of anonymous labels][:asm :parsing :research]
[19:43][Review the load immediate and mov pseudo-instructions][:asm :research]
[21:53][Q&A][:speech]
[22:03][@twitchplaysp0ng][Shouldn't 1545 be `lw x3, \[val\]`?][:asm]
[22:03][@twitchplaysp0ng][Shouldn't 1545 be "lw x3, \[val\]"?][:asm]
[23:06][@miotatsu][I like all your changes personally, the only thing I would do different is dropping number labels and using the <# ># syntax for referring to anonymous labels. But it's all bikeshed discussion really][:asm]
[26:35][Macro Expansion][:asm :speech]
[28:07][Macros, Constant and Parameterised][:asm :language :speech]
[28:07][Macros, Constant and Parameterized][:asm :language :speech]
[30:30][Spec'ing out our macros syntax, and considering how to implement it][:asm :language :speech]
[32:50][Dive right in to implementing macro expansion, separating out next_token() into a new scan_token() function][:asm :language :parsing]
[43:07][:Run it to see that it does not work][:asm :language :parsing]
@ -64,6 +64,6 @@
[1:52:17][Make init_scan() 0-initialise the token_list_stack and rename next_unexpanded_token() to next_raw_token()][:asm :language :parsing]
[1:59:32][Undo the buggy asm_test()][:asm :language :parsing]
[1:59:56][:Run it to see that it's fine][:asm :language :parsing]
[2:00:21][Reflect on our macro expansion with a glimpse into the future of parameterised macros and the determination to fix the bug off-stream][:asm :language :parsing :speech]
[2:00:21][Reflect on our macro expansion with a glimpse into the future of parameterized macros and the determination to fix the bug off-stream][:asm :language :parsing :speech]
[2:03:36][That's it for today's stream][:speech]
[/video]

View File

@ -0,0 +1,53 @@
[video member=pervognsen stream_platform=twitch project=bitwise title="Parameterized Macros" vod_platform=youtube id=is6H67viWfs annotator=Miblo]
[0:08][Recap and set the stage for the day with a mention of the bug fix from last stream][:speech]
[0:52][Review our current macro expansion support, including the new '$' macro identifier][:asm :language :speech]
[4:11][Review the removal of anonymous labels][:asm :language :speech]
[5:11][Parameterized macros][:asm :language :speech]
[8:02][The plan for parameterized macros][:asm :language :speech]
[12:02][Implement multi-line macros, introducing cmd_macro() and cmd_endmacro()][:asm :language]
[15:42][Add a multi-line macro test in asm_test() and fix cmd_macro() to skip the closing token][:asm :language]
[16:35][:Run it to see that it works][:asm :language]
[17:04][Setup to implement parameterized macros, similar to Ion][:asm :language :speech]
[18:35][Dive into parameterized macros, augmenting the Assembler with local_syms for get_sym() to use][:asm :language]
[21:10][:Run it to see that nothing broke][:asm :language]
[21:26][Introduce push_sym() to handle our macro parameters][:asm :language]
[26:25][:Run it to make sure it still works][:asm :language]
[26:34][Augment Assembler with a temp_tokens array, and introduce parse_macro_param() to handle our macro parameters][:asm :language :parsing]
[35:08][Enable pop_token_list() to pop our temp_tokens stack][:asm :language :parsing]
[38:53][:Run it and crash in get_sym()][:asm :language :parsing]
[39:07][Make init_assembler() reset the local_syms and temp_tokens][:asm :language :parsing]
[39:28][:Run it to see that it works][:asm :language :parsing]
[39:44][Enable cmd_macro() to handle newlines][:asm :language :parsing]
[43:52][:Run it to see that we didn't break anything][:asm :language :parsing]
[44:24][Add a parameterized macro test in asm_test()][:asm :language :parsing]
[45:08][Step in to next_token() to see how it handles our parameterized macro][:asm :language :parsing :run]
[46:11][Fix next_token() to skip past the '$' token][:asm :language :parsing]
[47:29][:Run it to see that parse_macro_param() correctly parses a parameter][:asm :language :parsing]
[48:14][Step through to the next macro, to see how $reg gets handled][:asm :language :parsing :run]
[49:21][Rename the getchar macro in asm_test() to do_getchar][:asm :language :parsing]
[49:41][:Run it to see that it seems to work][:asm :language :parsing]
[50:04][Torture test macro parameter pre-expansion][:asm :language :parsing]
[50:39][:Run it to see that it does work][:asm :language :parsing]
[50:42][Continue the torture test of macro parameter expansion][:asm :language :parsing]
[52:04][:Run it to see that it works][:asm :language :parsing]
[52:24][Test macro parameter scoping][:asm :language :parsing]
[52:41][:Run it and do not receive the expected error][:asm :language :parsing]
[52:53][Augment the TokenList with saved_local_syms for next_token() to use and prevent parameters from leaking out of macros][:asm :language :parsing]
[54:34][:Run it to see that our scoped parameter was properly destroyed, as evidenced by a "No macro or macro parameter named 'arg1'" error][:asm :language :parsing]
[54:43][Comment out our error-causing macro][:asm :language :parsing]
[54:48][:Run it to see that it works][:asm :language :parsing]
[54:56][Test macro recursion][:asm :language :parsing]
[55:11][:Run it and hit a "Temp tokens stack overflow" error][:asm :language :parsing]
[55:44][A few words on the utility of this infinite macro recursion][:asm :language :parsing :speech]
[56:29][Test macro argument shadowing][:asm :language :parsing]
[57:18][:Run it to see that the arguments were not outputted in the reverse order][:asm :language :parsing]
[59:10][Step in to next_token() to see what it does with our shadowed arguments][:asm :language :parsing :run]
[1:05:12][Fix next_token() to call parse_macro_param() and evaluate the macro parameters before establishing the binding][:asm :language :parsing]
[1:13:16][:Run it to see that it does the right thing][:asm :language :parsing]
[1:13:46][Read back through next_token()][:asm :language :parsing :research]
[1:14:26][Make next_token() set saved_local_syms after all the parse_macro_arg() calls][:asm :language :parsing]
[1:15:13][:Run it to see that it's okay][:asm :language :parsing]
[1:15:39][Q&A][:speech]
[1:16:09][Consider the potential similarity of our assembler to lisp interpreters for symbolic languages][:asm :language :parsing :speech]
[1:17:13][That's pretty much it for parameterized macros, with a glimpse into the future of doing expression evaluation][:asm :language :parsing :speech]
[/video]