We are currently in the process of converting the website to the new design. Some pages, like this one, are still broken. We appreciate your patience.
Bitwise»Episode Guide
How To Program Assembly Language
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
0:08Set the stage for the promised stream
0:08Set the stage for the promised stream
0:08Set the stage for the promised stream
1:10Disclaimer: Our handwritten assembly likely won't outperform an optimising compiler; writing assembly gives us a soft-intro to machine code generation
1:10Disclaimer: Our handwritten assembly likely won't outperform an optimising compiler; writing assembly gives us a soft-intro to machine code generation
1:10Disclaimer: Our handwritten assembly likely won't outperform an optimising compiler; writing assembly gives us a soft-intro to machine code generation
5:54The approach we'll be taking, translating C to assembly
5:54The approach we'll be taking, translating C to assembly
5:54The approach we'll be taking, translating C to assembly
7:27Goal: Translate from C to assembly language, with thoughts on variable width operations, and RISC-V as a compare-and-branch language
7:27Goal: Translate from C to assembly language, with thoughts on variable width operations, and RISC-V as a compare-and-branch language
7:27Goal: Translate from C to assembly language, with thoughts on variable width operations, and RISC-V as a compare-and-branch language
11:40Idea: Gradually lower C towards target language
11:40Idea: Gradually lower C towards target language
11:40Idea: Gradually lower C towards target language
13:09Example: Lowering a pointer increment from C to assembly, through a process of language feature dependency removal
13:09Example: Lowering a pointer increment from C to assembly, through a process of language feature dependency removal
13:09Example: Lowering a pointer increment from C to assembly, through a process of language feature dependency removal
21:44Features in C that may not be available in an assembly language
21:44Features in C that may not be available in an assembly language
21:44Features in C that may not be available in an assembly language
32:49elavid More missing operations: modulo, floating point stuff, greater-than-or-equal
🗪
32:49elavid More missing operations: modulo, floating point stuff, greater-than-or-equal
🗪
32:49elavid More missing operations: modulo, floating point stuff, greater-than-or-equal
🗪
32:56More "missing" operations
32:56More "missing" operations
32:56More "missing" operations
36:13Local variables
36:13Local variables
36:13Local variables
47:08Smaller-than-word variables have to live in word-sized registers and use word-sized ops
47:08Smaller-than-word variables have to live in word-sized registers and use word-sized ops
47:08Smaller-than-word variables have to live in word-sized registers and use word-sized ops
53:38Naively lowering an implicitly cast smaller-than-word arithmetic operation from C to assembly
53:38Naively lowering an implicitly cast smaller-than-word arithmetic operation from C to assembly
53:38Naively lowering an implicitly cast smaller-than-word arithmetic operation from C to assembly
1:02:56A note on the pessimism of this conversion
1:02:56A note on the pessimism of this conversion
1:02:56A note on the pessimism of this conversion
1:05:17Eliding zero / sign extension when working in architectures with sub-word store-to-memory operations, such as RISC-V
1:05:17Eliding zero / sign extension when working in architectures with sub-word store-to-memory operations, such as RISC-V
1:05:17Eliding zero / sign extension when working in architectures with sub-word store-to-memory operations, such as RISC-V
1:11:43tomas99batista Do you like assembly, pervognsen?
🗪
1:11:43tomas99batista Do you like assembly, pervognsen?
🗪
1:11:43tomas99batista Do you like assembly, pervognsen?
🗪
1:12:52Operating on larger-than-word-sized data types
1:12:52Operating on larger-than-word-sized data types
1:12:52Operating on larger-than-word-sized data types
1:14:10xanatos387 How does this extend for 64-bit or 128-bit RISC-V variants? I assume you have to treat 32-bit memory operations as sub-word and potentially even 64-bit operations. Trying to think that through. The instruction formats are the same. Is it possible to write "CPU 32 / 64 / 128-bit portable" RISC-V ASM?
🗪
1:14:10xanatos387 How does this extend for 64-bit or 128-bit RISC-V variants? I assume you have to treat 32-bit memory operations as sub-word and potentially even 64-bit operations. Trying to think that through. The instruction formats are the same. Is it possible to write "CPU 32 / 64 / 128-bit portable" RISC-V ASM?
🗪
1:14:10xanatos387 How does this extend for 64-bit or 128-bit RISC-V variants? I assume you have to treat 32-bit memory operations as sub-word and potentially even 64-bit operations. Trying to think that through. The instruction formats are the same. Is it possible to write "CPU 32 / 64 / 128-bit portable" RISC-V ASM?
🗪
1:14:384.2 Integer Computational Instructions1
📖
1:14:384.2 Integer Computational Instructions1
📖
1:14:384.2 Integer Computational Instructions1
📖
1:18:02Architecture-specific larger-than-word-sized arithmetic operations, with and without a carry flag
1:18:02Architecture-specific larger-than-word-sized arithmetic operations, with and without a carry flag
1:18:02Architecture-specific larger-than-word-sized arithmetic operations, with and without a carry flag
1:27:09elavid Section 2.4 of the RISC-V instruction set has code for detecting overflow. Looks like it uses BLTU2
🗪
1:27:09elavid Section 2.4 of the RISC-V instruction set has code for detecting overflow. Looks like it uses BLTU2
🗪
1:27:09elavid Section 2.4 of the RISC-V instruction set has code for detecting overflow. Looks like it uses BLTU2
🗪
1:27:45RISC-V MULH / MULHU multiply instructions
1:27:45RISC-V MULH / MULHU multiply instructions
1:27:45RISC-V MULH / MULHU multiply instructions
1:29:326.2 Division Operations3
📖
1:29:326.2 Division Operations3
📖
1:29:326.2 Division Operations3
📖
1:30:51Summarise the topics covered
1:30:51Summarise the topics covered
1:30:51Summarise the topics covered
1:31:41xanatos387 Kind of unfortunate to not be able to do a double-width arithmetic without a branch, though
🗪
1:31:41xanatos387 Kind of unfortunate to not be able to do a double-width arithmetic without a branch, though
🗪
1:31:41xanatos387 Kind of unfortunate to not be able to do a double-width arithmetic without a branch, though
🗪
1:33:06xanatos387 Since we're building our own, do you get tempted to "add" nonstandard missing operations?4
🗪
1:33:06xanatos387 Since we're building our own, do you get tempted to "add" nonstandard missing operations?4
🗪
1:33:06xanatos387 Since we're building our own, do you get tempted to "add" nonstandard missing operations?4
🗪
1:34:24captainpepperoni Assembly is a lower level language, right?
🗪
1:34:24captainpepperoni Assembly is a lower level language, right?
🗪
1:34:24captainpepperoni Assembly is a lower level language, right?
🗪
1:34:55That's it for today, with a glimpse into the future
1:34:55That's it for today, with a glimpse into the future
1:34:55That's it for today, with a glimpse into the future