forc_debug::names

Function register_name

Source
pub fn register_name(index: usize) -> String
Expand description

Returns the name of a register given its index.

If the index corresponds to a predefined register, the corresponding name from REGISTERS is returned. Otherwise, it returns a formatted name like "reg{index}".

ยงExamples

use forc_debug::names::register_name;
assert_eq!(register_name(0), "zero".to_string());
assert_eq!(register_name(15), "flag".to_string());