/* Original register/RAM/branch lesson on Breadpad's declared teaching map.
 * Only GPIO0 drives. GPIO1 comes from the accepted physical input voltage.
 * RAM stores 2 * (input_bit + 7); only the value16 takes the HIGH branch.
 */
    .option norvc
    .option norelax
    .section .text.start,"ax",@progbits
    .globl _start
    .type _start,@function
_start:
    lui x5, 0x40000
    lui x7, 0x20000
    addi x6, zero, 1
    sw x6, 8(x5)
loop:
    lw x10, 0(x5)
    srli x10, x10, 1
    andi x10, x10, 1
    addi x11, x10, 7
    slli x12, x11, 1
    sw x12, 0(x7)
    lw x13, 0(x7)
    addi x14, zero, 16
    beq x13, x14, high
    addi x15, zero, 0
    jal zero, write_output
high:
    addi x15, zero, 1
write_output:
    sw x15, 4(x5)
    jal zero, loop
    .size _start, .-_start
    .section .note.GNU-stack,"",@progbits
