Git Product home page Git Product logo

8085's Issues

create a issue templates

create issue templates for "add tests for ..." and "implement ... instructions" issues.

it would save me a lot of time.

Make instruction functions private

currently all the functions of class emu::cpu are publicly visible, ideally these functions should be private and only be used by emu::cpu::execute () to execute the proper instruction.

Doing so would make the program much less error prone and avoid any accidental function calls by users.

MOV instruction not working perfectly

tested program

#include "cpu.h"
#include <iostream>

int main() {
  emu::Memory mem;
  emu::CPU cpu;
  cpu.reset(mem);
  mem[0] = emu::CPU::LDA;
  mem[1] = 0x0;
  mem[2] = 0x0;
  mem[3] = emu::CPU::MOV_BA;
  int cycles = 4;
  cpu.execute(cycles, mem);
  std::cout << (int)cpu.getBRegister() << " < B\n";
  std::cout << (int)cpu.getARegister() << " < A\n";
  std::cout << (int)cpu.getProgramCounter () << " <pc\n";
  return 0;
}

Create a CONTRIBUTING.md

The project requires a document file containing the contribution guidelines and instructions especially for new contributors those are looking forward to contribute to this repository.

Add a "How to use" section in README.md

The readme still doesn't include a proper API documentation and even if it did, having a small "how to use" section would help new users to directly use this library without much of a hassle.

Add tests for MOV instructions

one test for testing each of the following instructions.

      MOV_AA = 0x7F,
      MOV_AB = 0x78, MOV_AC = 0x79, MOV_AD = 0x7A, MOV_AE = 0x7B, MOV_AH = 0x7C,
      MOV_AL = 0x7D, MOV_AM = 0x7E,

      MOV_BA = 0x47, MOV_BB = 0x40, MOV_BC = 0x41, MOV_BD = 0x42, MOV_BE = 0x43,
      MOV_BH = 0x44, MOV_BL = 0x45, MOV_BM = 0x46,

      MOV_CA = 0x4F, MOV_CB = 0x48, MOV_CC = 0x49, MOV_CD = 0x4A, MOV_CE = 0x4B,
      MOV_CH = 0x4C, MOV_CL = 0x4D, MOV_CM = 0x4E,

      MOV_DA = 0x57, MOV_DB = 0x50, MOV_DC = 0x51, MOV_DD = 0x52, MOV_DE = 0x53,
      MOV_DH = 0x54, MOV_DL = 0x55, MOV_DM = 0x56,

      MOV_EA = 0x5F, MOV_EB = 0x58, MOV_EC = 0x59, MOV_ED = 0x5A, MOV_EE = 0x5B,
      MOV_EH = 0x5C, MOV_EL = 0x5D, MOV_EM = 0x5E,

      MOV_HA = 0x67, MOV_HB = 0x60, MOV_HC = 0x61, MOV_HD = 0x62, MOV_HE = 0x63,
      MOV_HH = 0x64, MOV_HL = 0x65, MOV_HM = 0x66,

      MOV_LA = 0x6F, MOV_LB = 0x68, MOV_LC = 0x69, MOV_LD = 0x6A, MOV_LE = 0x6B,
      MOV_LH = 0x6C, MOV_LL = 0x6D, MOV_LM = 0x6E,

      MOV_MA = 0x77, MOV_MB = 0x70, MOV_MC = 0x71, MOV_MD = 0x72, MOV_ME = 0x73,
      MOV_MH = 0x74, MOV_ML = 0x75,

implement data transfer instuctions

opcodes

      MOV_AA = 0x7F,
      MOV_AB = 0x78, MOV_AC = 0x79, MOV_AD = 0x7A, MOV_AE = 0x7B, MOV_AH = 0x7C,
      MOV_AL = 0x7D, MOV_AM = 0x7E,

      MOV_BA = 0x47, MOV_BB = 0x40, MOV_BC = 0x41, MOV_BD = 0x42, MOV_BE = 0x43,
      MOV_BH = 0x44, MOV_BL = 0x45, MOV_BM = 0x46,

      MOV_CA = 0x4F, MOV_CB = 0x48, MOV_CC = 0x49, MOV_CD = 0x4A, MOV_CE = 0x4B,
      MOV_CH = 0x4C, MOV_CL = 0x4D, MOV_CM = 0x4E,

      MOV_DA = 0x57, MOV_DB = 0x50, MOV_DC = 0x51, MOV_DD = 0x52, MOV_DE = 0x53,
      MOV_DH = 0x54, MOV_DL = 0x55, MOV_DM = 0x56,

      MOV_EA = 0x5F, MOV_EB = 0x58, MOV_EC = 0x59, MOV_ED = 0x5A, MOV_EE = 0x5B,
      MOV_EH = 0x5C, MOV_EL = 0x5D, MOV_EM = 0x5E,

      MOV_HA = 0x67, MOV_HB = 0x60, MOV_HC = 0x61, MOV_HD = 0x62, MOV_HE = 0x63,
      MOV_HH = 0x64, MOV_HL = 0x65, MOV_HM = 0x66,

      MOV_LA = 0x6F, MOV_LB = 0x68, MOV_LC = 0x69, MOV_LD = 0x6A, MOV_LE = 0x6B,
      MOV_LH = 0x6C, MOV_LL = 0x6D, MOV_LM = 0x6E,

      MOV_MA = 0x77, MOV_MB = 0x70, MOV_MC = 0x71, MOV_MD = 0x72, MOV_ME = 0x73,
      MOV_MH = 0x74, MOV_ML = 0x75,

      // Move immediate
      MVI_A = 0x3E, MVI_B = 0x06, MVI_C = 0x0E, MVI_D = 0x16, MVI_E = 0x1E,
      MVI_H = 0x26, MVI_L = 0x2E, MVI_M = 0x36,

      // load immediate (reg pair)
      LXI_B = 0x01, LXI_D = 0x11, LXI_H = 0x21, LXI_SP = 0x31,

      // load/store A direct ( from register pair )
      LDAX_B = 0x0A, LDAX_D = 0x1A, STAX_B = 0x02, STAX_D = 0x12,

      // load/store A direct ( from memory )
      LDA = 0x3A, STA = 0x32,

      // load/store HL direct
      LHLD = 0x2A, SHLD = 0x22,
    
      // exchange HL and DE
      XCHNG = 0xEB;

ar: cpu.o: file format not recognized

without the cmake
it seems doesn't recognize the object file(cpu.o) both in windows and linux
ar: cpu.o: file format not recognized

with cmake
I only tested this at your CMakeLists at /src directory. main.cpp is not recognized when generating the project
removing that from CMakeLists it generates and builds successfully.
but it creates libcpu.a instead lib8080.a (judging by the last parameter of ar command)

both of the cases were tested on linux and windows with GCC and clang

create LICENSE

add an open source license to the project to make it accessible for other developers to use.

Add tests for MVI instructions

move immediate instructions

containing the following opcodes

    MVI_A = 0x3E, MVI_B = 0x06, MVI_C = 0x0E, MVI_D = 0x16, MVI_E = 0x1E,
    MVI_H = 0x26, MVI_L = 0x2E, MVI_M = 0x36,

Add tests for LXI instructions

instructions to implement loading register pair with immediate addressing mode

LXI_B = 0x01, LXI_D = 0x11, LXI_H = 0x21, LXI_SP = 0x31,

Add some graphic elements to README.md

the readme is just a giant text wall right now and needs a bit of tweeking to be more appealing to user's eyes.

These include a banner on top and some emojis in the text.

Add .clang-format file to the project

Add .clang-format file to the project with the formatting standards followed by the project ( the project currently uses LLVM coding standards ).

fill all the necessary information in README.md

current readme doesn't provide any information about using the project or even building it.
of course this would not be the final product but would prove to be a strong foundation to make the project public and then work on it publicly with other possible contributors online.

  • Add installation instructions to the README.md
  • Add contribution guidelines to the README.md
  • Complete the feedback section of the README.md
  • Fill the license section of the README.md

Add links to download page/install guides for dependencies

Though most of the dependencies are pretty straightforward and would most probably be present in almost any C++ developer's arsenal, README.md should not make any presumption and at least provide some basic hyperlinks to the download page or the product's official installation instructions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.