MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / assemble_from_s_file

Function assemble_from_s_file

src/cli/main.rs:388–408  ·  view source on GitHub ↗

Parse a `.s` text file as assembly tokens, link with stdlib, and assemble.

(path: &str, mode: TargetMode)

Source from the content-addressed store, hash-verified

386 Ok(ExitCode::from((code & 0xFF) as u8))
387 }
388 RunKind::KernelBoot => run_kernel_config(&engine, &config, max_steps),
389 RunKind::Freestanding => {
390 let outcome = engine.build_config(&config).map_err(map_session_error)?;
391 let mut vm = VirtualMachine::new(&outcome.artifacts.linked);
392 let result = vm.run(max_steps);
393 print!("{}", result.uart_output);
394 match result.outcome {
395 StepOutcome::Halted(code) => {
396 eprintln!("fsc: program exited with code {code}");
397 Ok(ExitCode::from((code & 0xFF) as u8))
398 }
399 StepOutcome::Continue => Err(CliError::Timeout(max_steps)),
400 }
401 }
402 }
403}
404
405fn run_kernel_config(
406 engine: &SessionEngine<'_>,
407 config: &RunConfig,
408 max_steps: u64,
409) -> Result<ExitCode, CliError> {
410 let boot = engine
411 .boot_kernel_config(config)

Callers 1

cmd_runFunction · 0.85

Calls 9

compile_stdlib_objectsFunction · 0.85
asm_text_to_tokensFunction · 0.85
source_stemFunction · 0.85
set_artifact_stemMethod · 0.80
assemble_namedMethod · 0.80
collectMethod · 0.80
pushMethod · 0.80
make_pipelineFunction · 0.70

Tested by

no test coverage detected