(&mut self, name: &str, exported: bool)
| 83 | } |
| 84 | |
| 85 | pub fn start_function(&mut self, name: &str, exported: bool) { |
| 86 | self.switch_section(".text"); |
| 87 | self.lines |
| 88 | .push("\t; ========================================".to_owned()); |
| 89 | self.lines.push(format!("\t; Function: {name}")); |
| 90 | self.lines |
| 91 | .push("\t; ========================================".to_owned()); |
| 92 | if exported { |
| 93 | self.lines.push(format!(".globl {name}")); |
| 94 | } |
| 95 | self.lines.push(format!("{name}:")); |
| 96 | self.tokens |
| 97 | .push(RvInstruction::Comment(format!("Function: {name}"))); |
| 98 | if exported { |
| 99 | self.tokens |
| 100 | .push(RvInstruction::Directive(format!(".globl {name}"))); |
| 101 | } |
| 102 | self.tokens.push(RvInstruction::Label(name.to_owned())); |
| 103 | } |
| 104 | |
| 105 | pub fn end_function(&mut self) { |
| 106 | self.lines.push("\t; End of function".to_owned()); |
no test coverage detected