[video member=miotatsu stream_platform=twitch project=riscy title="Studying GNU Assembler Syntax" vod_platform=youtube id=kGDEsTLsbfw annotator=Miblo] [0:06][Set the stage for the day, looking at the GNU Assembler Syntax] [0:35][Begin to learn GCC Inline Assembly[ref site=ericw. page="A Tiny Guide to GCC Inline Assembly" url=http://ericw.ca/notes/a-tiny-guide-to-gcc-inline-assembly.html]][:asm :research] [7:32][Consult write_csr() and continue reading the example code in the guide][:asm :research] [19:29][Come to understand what the read_csr() macro is doing][:research] [20:42][@hossein1387][__temp is what is returned?] [23:42][:Research about the C preprocessor's # and ## replace operators[ref site=cppreference.com page=replace url=http://en.cppreference.com/w/c/preprocessor/replace]] [24:52][Return to read_csr()][:asm :research] [26:54][Sketch out an interpretation of the syntax of read_csr()][:research] [30:29][@hossein1387][What was the %0 doing again?] [31:55][read_csr()][:blackboard] [32:39][@hossein1387][Yeah, I watched them all!] [34:13][Write out a test program using the syntax of read_csr()][:research] [36:28][Build and :run the test program successfully] [37:55][Move on to understanding clear_csr()][:asm :research] [40:37][@hossein1387][You can use the built-in function __builtin_constant_p to determine if a value is known to be constant at compile time and hence that GCC can perform constant-folding on expressions involving that value] [41:15][__builtin_constant_p][:blackboard] [43:23][Continue working towards understanding clear_csr()][:asm :research] [44:15][Consult the Tiny Guide in order to confirm the order of operand references][:asm :research] [45:57][Read about the Clobber List in the Tiny Guide][:asm :research] [48:06][Determine that we know enough about inline assembly for now, and glimpse into the future][:asm] [49:27][Read clear_csr() in conjunction with the documentation on the CSR[ref site=RISC-V page="User-Level ISA Specification v2.1" url=https://riscv.org/specifications]][:asm :hardware :research] [1:01:34][Summarise what clear_csr() is doing][:asm :research] [1:03:47][@hossein1387][Why the < 32?] [1:05:01][Consider the fact that the register we're talking about is 32 bits long] [1:08:40][Determine to study the instruction encoding in the next episode, with a mention of the poll[ref site=Twitter page="Poll: Should I hire an artist to make better thumbnails for my content?" url=https://twitter.com/hmn_riscy/status/833911733752385536]] [/video]