Skip to content

Commit

Permalink
Feature: Russian KR1878 8-bit processor
Browse files Browse the repository at this point in the history
Added disassembler support for Angstrem KR1878 processor.
  • Loading branch information
uxmal committed Aug 19, 2024
1 parent 98622f9 commit 683d216
Show file tree
Hide file tree
Showing 14 changed files with 1,175 additions and 69 deletions.
15 changes: 15 additions & 0 deletions src/Arch/Angstrem/Angstrem.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(ProjectDir)../../Drivers/CommonBuildProperties.items"/>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Reko.Arch.Angstrem</RootNamespace>
<AssemblyName>Reko.Arch.Angstrem</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../../Core/Core.csproj" />
</ItemGroup>
</Project>
114 changes: 114 additions & 0 deletions src/Arch/Angstrem/KR1878Architecture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#region License
/*
* Copyright (C) 1999-2024 John Källén.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#endregion

using Reko.Core;
using Reko.Core.Expressions;
using Reko.Core.Machine;
using Reko.Core.Memory;
using Reko.Core.Rtl;
using Reko.Core.Types;
using System.Diagnostics.CodeAnalysis;

namespace Reko.Arch.Angstrem
{
public class KR1878Architecture : ProcessorArchitecture
{
public KR1878Architecture(IServiceProvider services, string archId, Dictionary<string, object> options)
: base(services, archId, options, new(), new())
{
this.Endianness = EndianServices.Little;
this.CarryFlag = null; //$TODO
this.CodeMemoryGranularity = 8;
this.MemoryGranularity = 8;
this.FramePointerType = PrimitiveType.Byte;
this.WordWidth = PrimitiveType.Byte;
}

public override IEnumerable<MachineInstruction> CreateDisassembler(EndianImageReader rdr)
{
return new KR1878Disassembler(this, rdr);
}

public override IEqualityComparer<MachineInstruction>? CreateInstructionComparer(Normalize norm)
{
throw new NotImplementedException();
}

public override IEnumerable<Address> CreatePointerScanner(SegmentMap map, EndianImageReader rdr, IEnumerable<Address> knownAddresses, PointerScannerFlags flags)
{
throw new NotImplementedException();
}

public override ProcessorState CreateProcessorState()
{
throw new NotImplementedException();
}

public override IEnumerable<RtlInstructionCluster> CreateRewriter(EndianImageReader rdr, ProcessorState state, IStorageBinder binder, IRewriterHost host)
{
throw new NotImplementedException();
}

public override FlagGroupStorage? GetFlagGroup(RegisterStorage flagRegister, uint grf)
{
throw new NotImplementedException();
}

public override FlagGroupStorage? GetFlagGroup(string name)
{
throw new NotImplementedException();
}

public override SortedList<string, int> GetMnemonicNames()
{
throw new NotImplementedException();
}

public override int? GetMnemonicNumber(string name)
{
throw new NotImplementedException();
}

public override RegisterStorage[] GetRegisters()
{
throw new NotImplementedException();
}

public override string GrfToString(RegisterStorage flagRegister, string prefix, uint grf)
{
throw new NotImplementedException();
}

public override Address MakeAddressFromConstant(Constant c, bool codeAlign)
{
throw new NotImplementedException();
}

public override Address? ReadCodeAddress(int size, EndianImageReader rdr, ProcessorState? state)
{
throw new NotImplementedException();
}

public override bool TryParseAddress(string? txtAddr, [MaybeNullWhen(false)] out Address addr)
{
throw new NotImplementedException();
}
}
}
Loading

0 comments on commit 683d216

Please sign in to comment.