egg

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5b1362c832182e2ffca8f02137afea1abb610abd
parent 72e36bd7995e92b11d14f30d7029b70e17a00987
Author: Gabriel G. de Brito <gabrielgbrito@icloud.com>
Date:   Sun, 25 Feb 2024 00:06:28 -0300

Pumped version to 1.1.0

Diffstat:
MREADME-pt.md | 18+++++++++---------
MREADME.md | 16++++++++--------
Mmain.go | 2+-
Amips-doc-pt.md | 13+++++++++++++
Amips-doc.md | 14++++++++++++++
Mriscv-doc.md | 2+-
6 files changed, 46 insertions(+), 19 deletions(-)

diff --git a/README-pt.md b/README-pt.md @@ -7,15 +7,16 @@ [Documentação para RISC-V](riscv-doc-pt.md) +[Documentação para MIPS](mips-doc-pt.md) + [Contribuindo, bugs, requisição de features](CONTRIBUINDO.md) EGG (Emulador Genérico do Gabriel) é um emulador modular de arquiteturas de processador, criado para fins educacionais. O pacote `egg` provém uma interface para interagir com máquinas, assim provendo -suporte a diferentes backends provendo arquiteturas. No momento, há somente o -pacote `egg/riscv` de backend, implementando uma máquina RISC-V IM de 32 bits. -Um backend de MIPS é planejado para o futuro. +suporte a diferentes backends provendo arquiteturas. No momento, há backends de +RISC-V IM de 32 bits e MIPS32 (experimental). O pacote `egg/assembler` provém uma pequena biblioteca para criação de assemblers e o suporte ao debugger do EGG. @@ -38,14 +39,13 @@ Windows atualmente. Rode o emulador com um arquivo de Assembly para montá-lo e iniciar uma máquina rodando o programa. O backend utilizado por padrão é uma máquina de RISC-V 32 -bits. Use a opção `-a` ou `-arch` para mudar a arquitetura (atualmente há -somente a opção RISC-V. Um backend de MIPS é planejado para o futuro). A opção -`-h` mostra todas as opções de linha de comando e a opção `-l` mostra todas as -arquiteturas suportadas. +bits. Use a opção `-a` ou `-arch` para mudar a arquitetura. A opção `-h` mostra +todas as opções de linha de comando e a opção `-l` mostra todas as arquiteturas +suportadas. A sintaxe de Assembly varia com a arquitetura, porém, como o projeto provém uma -biblioteca para tal, os backends podem usar uma sintaxe bem semelhante (RISC-V -usa). Exemplo: +biblioteca para tal, os backends podem usar uma sintaxe bem semelhante (RISC-V e +MIPS usam). Exemplo: ```asm ; Ponto e vírgula define comentários até o fim da linha. diff --git a/README.md b/README.md @@ -7,6 +7,8 @@ [Documentation for RISC-V](riscv-doc.md) +[Documentation for MIPS](mips-doc.md) + [Contributing, bugs, feature requests](CONTRIBUTING.md) EGG stands for "Emulador Genérico do Gabriel" ("Gabriel's Generic Emulator", in @@ -14,9 +16,8 @@ portuguese). It's a modular emulator for processor architetures, made for educational purpouses. The `egg` package itself provides only an interface for interacting with -machines, thus supporting different architeture backends. Currently, the only -backend implemented is `egg/riscv`, which implements a RISC-V IM 32 bits -machine. A MIPS backend is coming soon. +machines, thus supporting different architeture backends. Currently, there are +RISC-V IM 32 bits and a MIPS32 (experimental) backends implemented. `egg/assembler` also provides a small library for creating assemblers, and the support for EGG's debugger. @@ -39,13 +40,12 @@ machine nowadays. Running the emulator with an Assembly file will assemble it and start a machine to run it on. By default, the machine is a RISC-V IM 32 bits. Use the flag `-a` -or `-arch` to change the architeture (currently only RISC-V is supported, a MIPS -backend is coming soon). Run `egg -h` to see all command line options and `egg --l` to see all supported architetures. +or `-arch` to change the architeture. Run `egg -h` to see all command line +options and `egg -l` to see all supported architetures. The Assembly syntax is architeture-dependent. Though, a library is provided for -creating assembler, so backends may use the same overall syntax (RISC-V uses -it). +creating assembler, so backends may use the same overall syntax (both RISC-V and +MIPS uses it). An example follows: diff --git a/main.go b/main.go @@ -21,7 +21,7 @@ func listArchs() { } func version() { - fmt.Println("EGG - Emulador Genérico do Gabriel - version 1.0.0") + fmt.Println("EGG - Emulador Genérico do Gabriel - version 1.1.0") } func runMachine(m machine.Machine) { diff --git a/mips-doc-pt.md b/mips-doc-pt.md @@ -0,0 +1,13 @@ +[Read this document in English](mips-doc.md) + +# MIPS32 para o EGG + +A implementação de MIPS32 para o EGG usa a sintaxe de Assembly padrão descrita +no [README](README-pt.md). + +Para realizar uma chamada (_environment call_), o número dela é colocado no +registrador `v0` e os argumentos nos registradores `a0` e `a1`. + +Uma instrução `break` realiza a chamada BREAK. + +O programa montado é carregado no endereço `0` e o `pc` é inicializado em `0`. diff --git a/mips-doc.md b/mips-doc.md @@ -0,0 +1,14 @@ +[Ler esse documento em português](mips-doc-pt.md) + +# MIPS32 for EGG + +The MIPS32 implementation for EGG uses the standard Assembly syntax described in +the [README](README.md). + +Environment call numbers are placed in the `v0` register, and arguments are +placed in `a0` and `a1`. + +An `break` instruction will perform a BREAK call. + +The assembled program is loaded at the address `0` on the machine startup, and +the `pc` register is set to `0`. diff --git a/riscv-doc.md b/riscv-doc.md @@ -7,7 +7,7 @@ the [README](README.md). It implements the registers and instructions from the base integer set and the multiplication extension described in [this](riscv/riscv.pdf) document. -Environment call numbers are placed in the `a7` registers, and arguments are +Environment call numbers are placed in the `a7` register, and arguments are placed in `a0` and `a1`. An `ebreak` instruction will perform a BREAK call.