Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/KuldeepSinh/lc3_vm
/ functions
Functions
119 in github.com/KuldeepSinh/lc3_vm
⨍
Functions
119
◇
Types & classes
13
↓ 28 callers
Method
tv_sec
(&self)
src/sys/time.rs:186
↓ 14 callers
Method
get
`get` returns Some(OpCode), when a valid value (between 0 to 15) is passed, otherwise it returns None.
src/hardware/instructions/opcode.rs:57
↓ 14 callers
Method
update
(&mut self, index: u16, value: u16)
src/hardware/register/mod.rs:63
↓ 12 callers
Method
tv_nsec
(&self)
src/sys/time.rs:190
↓ 11 callers
Method
insert
(&mut self, fd: RawFd)
src/sys/select.rs:24
↓ 11 callers
Function
sign_extend
`sign_extend` is used to convert a 5 bit number into an equivalent 16 bit number.
src/hardware/instructions/mod.rs:21
↓ 11 callers
Method
tv_usec
(&self)
src/sys/time.rs:417
↓ 9 callers
Method
num_microseconds
(&self)
src/sys/time.rs:166
↓ 9 callers
Method
num_nanoseconds
(&self)
src/sys/time.rs:170
↓ 7 callers
Function
update_r_cond_register
The R_COND register stores condition flags which provide information about the most recently executed calculation. Any time a value is written to a re
src/hardware/register/condition_flag.rs:37
↓ 6 callers
Method
read
(&mut self, address: u16)
src/hardware/memory/mod.rs:32
↓ 6 callers
Function
restore_terminal_settings
()
src/sys/terminal.rs:21
↓ 4 callers
Method
num_seconds
(&self)
src/sys/time.rs:154
↓ 4 callers
Method
write
(&mut self, address: usize, value: u16)
src/hardware/memory/mod.rs:28
↓ 3 callers
Function
div_mod_floor_64
(this: i64, other: i64)
src/sys/time.rs:497
↓ 3 callers
Function
get_char
`get_char` calls external (C) function getchar using libc.
src/sys/getchar.rs:7
↓ 3 callers
Function
last
()
src/sys/errno.rs:127
↓ 3 callers
Method
remove
(&mut self, fd: RawFd)
src/sys/select.rs:28
↓ 2 callers
Method
cmp
The implementation of cmp is simplified by assuming that the struct is normalized. That is, tv_nsec must always be within [0, 1_000_000_000)
src/sys/time.rs:92
↓ 2 callers
Method
desc
(self)
src/sys/errno.rs:56
↓ 2 callers
Function
errno_location
()
src/sys/errno.rs:10
↓ 2 callers
Function
from_i32
(e: i32)
src/sys/errno.rs:816
↓ 2 callers
Method
get
(&self, index: u16)
src/hardware/register/mod.rs:79
↓ 1 callers
Function
add
- ADD takes two values and stores them in a register. - In register mode, the second value to add is found in a register. - In immediate mode, the sec
src/hardware/instructions/add.rs:15
↓ 1 callers
Function
and
If bit [5] is 0, the second source operand is obtained from SR2. If bit [5] is 1, the second source operand is obtained by sign-extending the imm5 fie
src/hardware/instructions/and.rs:10
↓ 1 callers
Function
br
The condition codes specified by the state of bits [11:9] are tested. If bit [11] is set, N is tested; if bit [11] is clear, N is not tested. If bit [
src/hardware/instructions/br.rs:8
↓ 1 callers
Function
check_key
()
src/hardware/memory/mod.rs:63
↓ 1 callers
Function
clear
Sets the platform-specific errno to no-error
src/sys/errno.rs:42
↓ 1 callers
Method
clear
(&mut self)
src/sys/select.rs:36
↓ 1 callers
Method
clone
(&self)
src/hardware/memory/mod.rs:46
↓ 1 callers
Function
desc
(errno: Errno)
src/sys/errno.rs:131
↓ 1 callers
Function
div_floor_64
(this: i64, other: i64)
src/sys/time.rs:502
↓ 1 callers
Function
div_rem_64
(this: i64, other: i64)
src/sys/time.rs:518
↓ 1 callers
Function
errno
Returns the platform-specific value of errno
src/sys/errno.rs:47
↓ 1 callers
Function
execute_instruction
(instr: u16, mut registers: &mut Registers, mut memory: &mut Memory)
src/hardware/instructions/opcode.rs:80
↓ 1 callers
Function
execute_program
(mem: Memory)
src/hardware/mod.rs:13
↓ 1 callers
Function
extract_op_code
Each instruction is 16 bits long, with the left 4 bits storing the opcode. The rest of the bits are used to store the parameters. To extract left 4 bi
src/hardware/instructions/opcode.rs:107
↓ 1 callers
Function
handle_args
`handle_args` fn processes commandline arguments. If appropriate file path is found in the args, it reads the file into the memory.
src/lib.rs:19
↓ 1 callers
Function
handle_control_c
(sig: i32)
src/sys/terminal.rs:9
↓ 1 callers
Method
highest
Finds the highest file descriptor in the set. Returns `None` if the set is empty. This can be used to calculate the `nfds` parameter of the [`select
src/sys/select.rs:48
↓ 1 callers
Function
jmp
The program unconditionally jumps to the location specified by the contents of the base register. Bits [8:6] identify the base register. `RET` is list
src/hardware/instructions/jmp.rs:7
↓ 1 callers
Function
jsr
First, the incremented PC is saved in R7. This is the linkage back to the calling routine. Then the PC is loaded with the address of the first instruc
src/hardware/instructions/jsr.rs:11
↓ 1 callers
Function
ld
An address is computed by sign-extending bits [8:0] to 16 bits and adding this value to the incremented PC. The contents of memory at this address are
src/hardware/instructions/ld.rs:9
↓ 1 callers
Function
ldi
An address is computed by sign-extending bits [8:0] to 16 bits and adding this value to the incremented PC. What is stored in memory at this address i
src/hardware/instructions/ldi.rs:9
↓ 1 callers
Function
ldr
An address is computed by sign-extending bits [5:0] to 16 bits and adding this value to the contents of the register specified by bits [8:6]. The cont
src/hardware/instructions/ldr.rs:10
↓ 1 callers
Function
lea
An address is computed by sign-extending bits [8:0] to 16 bits and adding this value to the incremented PC. This address is loaded into DR.‡ The condi
src/hardware/instructions/lea.rs:7
↓ 1 callers
Method
micros_mod_sec
(&self)
src/sys/time.rs:405
↓ 1 callers
Function
mod_floor_64
(this: i64, other: i64)
src/sys/time.rs:510
↓ 1 callers
Method
nanos_mod_sec
(&self)
src/sys/time.rs:178
↓ 1 callers
Function
not
The bit-wise complement of the contents of SR is stored in DR. The condi- tion codes are set, based on whether the binary value produced, taken as a 2
src/hardware/instructions/not.rs:7
↓ 1 callers
Function
read_file
`read_file` fn reads a file into the LC-3 Memory. LC-3 programs are big-endian, but most of the modern computers we use are little endian. As a result
src/file.rs:17
↓ 1 callers
Function
read_file_into_lc3_memory
(mut rdr: R)
src/file.rs:23
↓ 1 callers
Function
select
Monitors file descriptors for readiness Returns the total number of ready file descriptors in all sets. The sets are changed so that all file descrip
src/sys/select.rs:83
↓ 1 callers
Function
spawn_control_c_handler
When the program is interrupted (with pressing `Control-C` keys), we want to restore the terminal settings back to normal. `spawn_control_c_handler` f
src/sys/terminal.rs:39
↓ 1 callers
Function
st
The contents of the register specified by SR are stored in the memory location whose address is computed by sign-extending bits [8:0] to 16 bits and a
src/hardware/instructions/st.rs:7
↓ 1 callers
Function
sti
The contents of the register specified by SR are stored in the memory location whose address is obtained as follows: Bits [8:0] are sign-extended to 1
src/hardware/instructions/sti.rs:8
↓ 1 callers
Function
str
The contents of the register specified by SR are stored in the memory location whose address is computed by sign-extending bits [5:0] to 16 bits and a
src/hardware/instructions/str.rs:8
↓ 1 callers
Function
trap
`trap` fn allows interacting with I/O devices First R7 is loaded with the incremented PC. (This enables a return to the instruction physically followi
src/hardware/instructions/trap.rs:37
↓ 1 callers
Function
turn_off_canonical_and_echo_modes
()
src/sys/terminal.rs:28
Method
add
(self, rhs: TimeSpec)
src/sys/time.rs:206
Method
as_errno
Convert this `Error` to an [`Errno`](enum.Errno.html).
src/sys/mod.rs:38
Method
as_ref
(&self)
src/sys/time.rs:65
Method
clear
()
src/sys/errno.rs:64
Method
contains
(&mut self, fd: RawFd)
src/sys/select.rs:32
Method
description
(&self)
src/sys/mod.rs:75
Method
description
(&self)
src/sys/errno.rs:110
Method
div
(self, rhs: i32)
src/sys/time.rs:235
Method
eq
The implementation of cmp is simplified by assuming that the struct is normalized. That is, tv_nsec must always be within [0, 1_000_000_000)
src/sys/time.rs:82
Function
extract_test
()
src/hardware/instructions/opcode.rs:115
Function
fdset_clear
()
src/sys/select.rs:166
Function
fdset_highest
()
src/sys/select.rs:180
Function
fdset_insert
()
src/sys/select.rs:137
Function
fdset_remove
()
src/sys/select.rs:150
Method
fmt
(&self, f: &mut fmt::Formatter)
src/sys/mod.rs:86
Method
fmt
(&self, fmt: &mut fmt::Formatter)
src/sys/time.rs:71
Method
fmt
(&self, f: &mut fmt::Formatter)
src/sys/errno.rs:116
Method
from
(errno: Errno)
src/sys/mod.rs:63
Method
from
(err: Errno)
src/sys/errno.rs:122
Method
from_errno
Create a nix Error from a given errno
src/sys/mod.rs:47
Method
from_i32
(err: i32)
src/sys/errno.rs:60
Method
get_flag_value
`get_flag_value` function returns `u8` value for the `ConditionFlag` passed to its argument. - `ConditionFlag::FlPos` = 1, Positive - `ConditionFlag::
src/hardware/register/condition_flag.rs:25
Method
hours
(hours: i64)
src/sys/time.rs:12
Method
invalid_argument
Create a new invalid argument error (`EINVAL`)
src/sys/mod.rs:57
Method
last
Get the current errno and convert it to a nix Error
src/sys/mod.rs:52
Method
last
()
src/sys/errno.rs:52
Function
main
()
src/main.rs:9
Function
memory_size
()
src/hardware/memory/mod.rs:81
Function
memory_size_constant
()
src/hardware/memory/mod.rs:87
Method
microseconds
(microseconds: i64)
src/sys/time.rs:132
Method
milliseconds
(milliseconds: i64)
src/sys/time.rs:122
Method
minutes
(minutes: i64)
src/sys/time.rs:20
Method
mul
(self, rhs: i32)
src/sys/time.rs:222
Method
nanoseconds
(nanoseconds: i64)
src/sys/time.rs:142
Method
neg
(self)
src/sys/time.rs:198
Method
new
()
src/sys/select.rs:18
Method
new
()
src/hardware/memory/mod.rs:23
Method
new
`new()` is an associated method of `Registers`. It is used to initialize all the registers to zero, except `r_pc`, which represents the program counte
src/hardware/register/mod.rs:48
Method
num_hours
(&self)
src/sys/time.rs:33
Method
num_milliseconds
(&self)
src/sys/time.rs:162
Method
num_minutes
(&self)
src/sys/time.rs:38
next →
1–100 of 119, ranked by callers