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

Function fetch_misaligned_halfword

crates/virtual-machine/tests/vm_fetch.rs:25–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 let result = fetch(&mut bus, 0x8000_0000, 0, PrivilegeMode::Machine, 0);
24 assert!(result.is_ok());
25 assert_eq!(
26 result.expect("instruction fetch should succeed"),
27 0x0000_0013
28 );
29}
30
31#[test]
32fn fetch_misaligned_halfword() {
33 let mut bus = SystemBus::new(Vec::new());
34
35 // PC not aligned to 4 bytes
36 let result = fetch(&mut bus, 0x8000_0002, 0, PrivilegeMode::Machine, 0);
37 assert!(matches!(

Callers

nothing calls this directly

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected