Little Computer 3, or LC-3, is a type of computer educational programming language, an assembly language, which is a type of low-level programming language. It features a relatively simple instruction set, but can be used to write moderately complex assembly programs, and is a viable target for a C compiler. It has a simplified instruction set compared to 'x86', but contains all the main ideas used in modern CPUs.

Related tags

Miscellaneous c
Overview

Little-Computer-3-LC-3

What is LC-3?

Little Computer 3, or LC-3, is a type of computer educational programming language, an assembly language, which is a type of low-level programming language. It features a relatively simple instruction set, but can be used to write moderately complex assembly programs, and is a viable target for a C compiler. It has a simplified instruction set compared to 'x86', but contains all the main ideas used in modern CPUs.

Memory

The LC-3 has 65,536 memory locations (the maximum that is addressable by a 16-bit unsigned integer 2^16), each of which stores a 16-bit value. This means it can store a total of only 128kb, which is a lot smaller than you may be used to! In our program, this memory will be stored in a simple array:

uint16_t memory[UINT16_MAX];

Registers

A register is a slot for storing a single value on the CPU. Registers are like the "workbench" of the CPU. For the CPU to work with a piece of data, it has to be in one of the registers.The LC-3 has 10 total registers, each of which is 16 bits. Most of them are general purpose, but a few have designated roles.

-8 general purpose registers (R0-R7) : The general purpose registers can be used to perform any program calculations -1 program counter (PC) register : The program counter is an unsigned integer which is the address of the next instruction in memory to execute. -1 condition flags (COND) register : The condition flags tell us information about the previous calculation.

Instruction Set

An instruction is a command which tells the CPU to do some fundamental task. Instructions have both an opcode which indicates the kind of task to perform and a set of parameters which provide inputs to the task being performed.

There are just 16 opcodes in LC-3. Everything the computer can calculate is some sequence of these simple instructions. 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.

Execution / Procedure

  • Load one instruction from memory at the address of the PC register.
  • Increment the PC register.
  • Look at the opcode to determine which type of instruction it should perform.
  • Perform the instruction using the parameters in the instruction.
  • Follow the above steps again untill the result is achieved.

Incremental Life Cytcle

Procedural Flow Chart

Virtual Machine Class Diagram

Virtual Machine Life Cycle

System Requirements [Software / Hardware]:

Software Requirements:

  • Operating System: Unix / Linux
  • Programming Language: C
  • Compiler: GCC

Hardware Requirements:

  • Processor: Intel® Core™ i5-9750H Cpu @ 2.5GHz
  • Disk Drive: Hard Disk Drive
  • RAM: 2GB or Higher
You might also like...
Tilck is an educational monolithic x86 kernel designed to be Linux-compatible at binary leve PLP Project Programming Language | Programming for projects and computer science and research on computer and programming.
PLP Project Programming Language | Programming for projects and computer science and research on computer and programming.

PLPv2b PLP Project Programming Language Programming Language for projects and computer science and research on computer and programming. What is PLP L

rdtsc x86 instruction to detect virtual machines
rdtsc x86 instruction to detect virtual machines

rdtsc_detector rdtsc x86 instruction to detect virtual machines What is rdtsc? The Time Stamp Counter (TSC) is a 64-bit register present on all x86 pr

CyberVal is a paste of a internal Valorant Cheat which has been used by several providers like LeagueHell, Enduty and several other pasted chairs.

CyberVal CyberVal is a paste of a internal Valorant Cheat which has been used by several providers like LeagueHell, Enduty and several other pasted ch

Low level library to develop GBA games that can also be built for PC.

Universal GBA Library 1. Introduction This is a library for development of GBA games. It can be used to build actual GBA game ROMs, but it can also ta

Poc to test my little friend features without any sdk

poc.vic-hack POC to test my little friend "vector" features without any sdk Ultimate goal - being able to write own firmware components without propri

Edited and relatively up-to-date xenos injector

Xenos Windows dll injector. Based on Blackbone library - https://github.com/DarthTon/Blackbone Changes from the original repository Up-to-date blackbo

The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-source and can be used with OpenOCD as a general-purpose programmer
The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-source and can be used with OpenOCD as a general-purpose programmer

pico-probe-programmer The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-sou

A port of the Linux x86 IOLI crackme challenges to x86-64

This is a port of the original Linux x86 IOLI crackme binaries to x86-64. The original set of IOLI crackmes can be found here: https://github.com/Maij

Owner
Shreyas Srivastava
Cloud & DevOps Enthusiast | Python | C++ | AWS | Jenkins | REST API | Flask | Boto3 | Elastic Search | Kibana
Shreyas Srivastava
This is the source code for Mirai. The compilation method has been simplified a little and some modifications have been made.

Mirai BotNet to Tashiro(未来砲) Leaked Linux.Mirai Source Code for Research/IoT Development Purposes Uploaded for research purposes and so we can develop

われ 28 Jul 30, 2022
A minimal viable programming language on top of liblgpp

This project aims to implement a minimal viable programming language on top of liblgpp. setup The project requires a C++17 compiler, CMake and liblgpp

Andreas Nilsson 73 Jun 28, 2021
anthemtotheego 402 Dec 26, 2022
AMD K6-2 (CXT) / K6-2+ / K6-3 / K6-3+ Write Allocate / Write Combine / Write Ordering / Frequency Multiplier Initialization driver for MS-DOS

K6INIT What is this? This is a driver for MS-DOS to replace k6dos.sys which is a bit useless and unflexible. It does not support the CXT versions of t

null 10 Sep 11, 2022
RemixDB: A read- and write-optimized concurrent KV store. Fast point and range queries. Extremely low write-amplification.

REMIX and RemixDB The REMIX data structure was introduced in paper "REMIX: Efficient Range Query for LSM-trees", FAST'21. This repository maintains a

Xingbo Wu 81 Dec 3, 2022
TinyDBR is meant for tiny dynamic binary rewriter fox x86 instruction set

TinyDBR What is TinyDBR? TinyDBR is meant for tiny dynamic binary rewriter fox x86 instruction set. This is a port to the TinyInst by Google Project Z

Asuka 40 Dec 22, 2022
High-level interface for low-level programming

Singeli Singeli is now able to compile useful programs to C, but it's very rough around the edges, with poor error reporting. We are beginning to use

Marshall Lochbaum 40 Dec 30, 2022
A water tank level sensor **Built With WisBlock** to detect overflow and low level conditions.

RAK12014 Laser TOF sensor coming soon WisBlock Watertank Level Sensor Watertank Overflow detection using the RAKwireless WisBlock modules. It implemen

Bernd Giesecke 3 Feb 3, 2022
RISCAL is a 32-bit reduced instruction-set computer (RISC) designed for learning and research purposes. It is named after my dog, Rascal.

RISCAL CPU RISCAL is a 32-bit custom instruction set architecture virtual machine. It is intended to be used for learning/research purposes. In a nuts

null 3 Dec 23, 2021
An embedded CAN bus sniffer which is able to monitor any of the vehicle internal CAN bus and perform some action by triggering new CAN messages.

An embedded CAN bus sniffer which is able to monitor any of the vehicle internal CAN bus and perform some action by triggering new CAN messages. In this way certain vehicle functionality can be triggered by responding to custom steering wheel button events, or use the vehicle virtual cockpit to display OBD-PIDs values instead of relying on an external display to present new information to the user

null 18 Dec 28, 2022