llama-16

所属分类:自然语言处理
开发工具:TeX
文件大小:487KB
下载次数:0
上传日期:2023-04-20 13:35:53
上 传 者sh-1993
说明:  具有自定义指令集、汇编程序和仿真器的16位微体系结构。
(16-bit microarchitecture with a custom instruction set, assembler, and emulator.)

文件列表:
LICENSE (1071, 2023-04-20)
Makefile (587, 2023-04-20)
SPEC.txt (4405, 2023-04-20)
asm (0, 2023-04-20)
asm\__init__.py (28, 2023-04-20)
asm\core.py (20823, 2023-04-20)
docs (0, 2023-04-20)
docs\assembler.md (2139, 2023-04-20)
docs\directory.md (3687, 2023-04-20)
docs\emulator.md (1573, 2023-04-20)
docs\isa.md (11679, 2023-04-20)
docs\llama.md (1911, 2023-04-20)
docs\quirks.md (3605, 2023-04-20)
emu (0, 2023-04-20)
emu\__init__.py (27, 2023-04-20)
emu\core.py (1551, 2023-04-20)
emu\cpu.py (17701, 2023-04-20)
emu\mem.py (1100, 2023-04-20)
paper (0, 2023-04-20)
paper\Makefile (186, 2023-04-20)
paper\cites.bib (1686, 2023-04-20)
paper\img (0, 2023-04-20)
paper\img\endianness.png (14908, 2023-04-20)
paper\img\instrformat.png (23228, 2023-04-20)
paper\img\overview.png (181135, 2023-04-20)
paper\paper.pdf (268261, 2023-04-20)
paper\paper.tex (52685, 2023-04-20)
prog (0, 2023-04-20)
prog\count_by_2.asm (862, 2023-04-20)
prog\multiply.asm (440, 2023-04-20)
test (0, 2023-04-20)
test\asm (0, 2023-04-20)
test\asm\add.asm (141, 2023-04-20)
test\asm\and.asm (141, 2023-04-20)
test\asm\call.asm (24, 2023-04-20)
test\asm\cmp.asm (141, 2023-04-20)
test\asm\data.asm (45, 2023-04-20)
... ...

# LLAMA-16 Have you ever cried while trying to implement a recursive Fibonacci calculator in x86_*** assembly? Have you tried to take your exploration of computer science closer to the metal only to learn that abstraction is actually a protector of your mental well being? Have you ever tried programming in LC-3 assembly and begrudgingly learned how to manually implement a stack with arithmetic operators? If you answered yes to any of the previous questions, you might be entitled to compensation from Kernighan and Ritchie. While I am not sure how to get that, I can at least offer you a potentially more enjoyable manner of exploring system level architectures with the LLAMA-16. LLAMA-16 is a 16 bit micro-architecture designed with simplicity in mind. The project consists primarily of an assembler and an emulator. First, you can use the assembler to convert your artisan hand crafted code into a binary format that the machine can read. Then, you can feed your state of the art bug-free programs to the emulator which will execute the program in a virtual environment. ## Design Specifications ([spec](https://github.com/jaydinandrews/llama-16/blob/master/./SPEC.txt)) #### Features * 8 16-bit registers (4 normal, 3 address, 1 flags) * 16-bit address bus (65536 16-bit words = a massive 128 KiB of memory) * 16 instruction RISC architecture * "Memory mapped" I/O for user interaction* \*Since the machine is emulated entirely virtually, the `io` instruction reads and writes data to the memory mapped location and then promptly manipulates it. While the design is to be memory mapped, in the virtual space it's difficult not to shortcut. #### Instruction Set: ``` 0: MV [imm16/reg/mem], [reg/mem] -> [reg/mem] = [imm16/reg/mem] 1: IO [imm16/reg/mem], [IN/OUT] -> [reg/mem] = IN | OUT = [imm16/reg/mem] 2: PUSH [imm16/reg/mem] -> [SP++] = [imm16/reg/mem] 3: POP [reg/mem] -> reg = [--SP] 4: ADD^ [imm16/reg/mem], [reg/mem] -> [reg/mem] = [rem/mem] + [imm16/reg/mem] 5: SUB^ [imm16/reg/mem], [reg/mem] -> [reg/mem] = [reg/mem] - [imm16/reg/mem] 6: INC^ [reg/mem] -> [reg/mem] = [reg/mem]++ 7: DEC^ [reg/mem] -> [reg/mem] = [reg/mem]-- 8: AND^ [imm16/reg/mem], [reg/mem] -> [reg/mem] = [reg/mem] & [imm16/reg/mem] 9: OR^ [imm16/reg/mem], [reg/mem] -> [reg/mem] = [reg/mem] | [imm16/reg/mem] A: NOT^ [imm16/reg/mem], [reg/mem] -> [reg/mem] = ~([imm16/reg/mem]) B: CMP* [imm16/reg/mem], [reg/mem] -> f = compare reg, [imm16/reg/mem] C: CALL [LABEL] -> [SP++] = IP; IP = [mem of LABEL] D: JNZ [LABEL] -> IP = [mem of LABEL/reg/mem] if !f_zero E: RET -> IP = [--SP] F: HLT -> f_halt = true ^These instructions read and load the flags register. *cmp has its own set of flags: greater, equal, and less. In the current state of the project, no other instruction can check these flags so the positive, zero, and negative flags are used instead. ``` #### Registers: ``` 0: A General Purpose Register 1: B General Purpose Register 2: C General Purpose Register 3: D General Purpose Register 4: IP Instruction Pointer Register 5: SP Stack Pointer Register 6: BP Base Pointer Register 7: F Flags Register: 15-7: Unused 8: HALT 7: Unused 6: GREATER 5: EQUAL 4: LESS 3: Unused 2: NEGATIVE 1: ZERO 0: POSITIVE ``` ## Installing #### Requirements LLAMA-16 is written in standard library Python version >=3.6. No additional modules or packages are required. ## The Tool Suite #### Assembler ([asm](https://github.com/jaydinandrews/llama-16/blob/master/./docs/assembler.md)) `./asm/core.py [-h] [-o OUTFILE] [-s] [-d] filename` #### Emulator ([emu](https://github.com/jaydinandrews/llama-16/blob/master/./docs/emulator.md)) `./emu/core.py [-h] [-d] program`

近期下载者

相关文件


收藏者