Encode a single instruction line and return its 32-bit word.
(line: &str)
| 663 | Some(AsmToken::Real(RealInstruction::Csrrs(Csrrs::new( |
| 664 | rd, csr, 0, |
| 665 | )))) |
| 666 | } |
| 667 | |
| 668 | // Parse `csr, rs` for `csrw` (pseudo: csrrw x0, csr, rs). |
| 669 | fn parse_csrw(operands: &str) -> Option<AsmToken> { |
| 670 | let comma = operands.find(',')?; |
| 671 | let csr = parse_csr_name(operands[..comma].trim())?; |
| 672 | let rs = parse_int_reg(operands[comma + 1..].trim())?; |
| 673 | Some(AsmToken::Real(RealInstruction::Csrrw(Csrrw::new( |
| 674 | 0, csr, rs, |
| 675 | )))) |
| 676 | } |