Basic program operations [PICProgramm.cs]
This commit is contained in:
parent
fd747d6c87
commit
65864ecd4e
698
.gitignore
vendored
698
.gitignore
vendored
@ -1,349 +1,349 @@
|
|||||||
# ---> C Sharp
|
# ---> C Sharp
|
||||||
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
|
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
|
||||||
[Bb]in/
|
[Bb]in/
|
||||||
[Oo]bj/
|
[Oo]bj/
|
||||||
|
|
||||||
# mstest test results
|
# mstest test results
|
||||||
TestResults
|
TestResults
|
||||||
|
|
||||||
## Ignore Visual Studio temporary files, build results, and
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
## files generated by popular Visual Studio add-ons.
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
|
||||||
# Build results
|
# Build results
|
||||||
[Dd]ebug/
|
[Dd]ebug/
|
||||||
[Rr]elease/
|
[Rr]elease/
|
||||||
x64/
|
x64/
|
||||||
*_i.c
|
*_i.c
|
||||||
*_p.c
|
*_p.c
|
||||||
*.ilk
|
*.ilk
|
||||||
*.meta
|
*.meta
|
||||||
*.obj
|
*.obj
|
||||||
*.pch
|
*.pch
|
||||||
*.pdb
|
*.pdb
|
||||||
*.pgc
|
*.pgc
|
||||||
*.pgd
|
*.pgd
|
||||||
*.rsp
|
*.rsp
|
||||||
*.sbr
|
*.sbr
|
||||||
*.tlb
|
*.tlb
|
||||||
*.tli
|
*.tli
|
||||||
*.tlh
|
*.tlh
|
||||||
*.tmp
|
*.tmp
|
||||||
*.log
|
*.log
|
||||||
*.vspscc
|
*.vspscc
|
||||||
*.vssscc
|
*.vssscc
|
||||||
.builds
|
.builds
|
||||||
|
|
||||||
# Visual C++ cache files
|
# Visual C++ cache files
|
||||||
ipch/
|
ipch/
|
||||||
*.aps
|
*.aps
|
||||||
*.ncb
|
*.ncb
|
||||||
*.opensdf
|
*.opensdf
|
||||||
*.sdf
|
*.sdf
|
||||||
|
|
||||||
# Visual Studio profiler
|
# Visual Studio profiler
|
||||||
*.psess
|
*.psess
|
||||||
*.vsp
|
*.vsp
|
||||||
*.vspx
|
*.vspx
|
||||||
|
|
||||||
# Guidance Automation Toolkit
|
# Guidance Automation Toolkit
|
||||||
*.gpState
|
*.gpState
|
||||||
|
|
||||||
# ReSharper is a .NET coding add-in
|
# ReSharper is a .NET coding add-in
|
||||||
_ReSharper*
|
_ReSharper*
|
||||||
|
|
||||||
# NCrunch
|
# NCrunch
|
||||||
*.ncrunch*
|
*.ncrunch*
|
||||||
.*crunch*.local.xml
|
.*crunch*.local.xml
|
||||||
|
|
||||||
# Installshield output folder
|
# Installshield output folder
|
||||||
[Ee]xpress
|
[Ee]xpress
|
||||||
|
|
||||||
# DocProject is a documentation generator add-in
|
# DocProject is a documentation generator add-in
|
||||||
DocProject/buildhelp/
|
DocProject/buildhelp/
|
||||||
DocProject/Help/*.HxT
|
DocProject/Help/*.HxT
|
||||||
DocProject/Help/*.HxC
|
DocProject/Help/*.HxC
|
||||||
DocProject/Help/*.hhc
|
DocProject/Help/*.hhc
|
||||||
DocProject/Help/*.hhk
|
DocProject/Help/*.hhk
|
||||||
DocProject/Help/*.hhp
|
DocProject/Help/*.hhp
|
||||||
DocProject/Help/Html2
|
DocProject/Help/Html2
|
||||||
DocProject/Help/html
|
DocProject/Help/html
|
||||||
|
|
||||||
# Click-Once directory
|
# Click-Once directory
|
||||||
publish
|
publish
|
||||||
|
|
||||||
# Publish Web Output
|
# Publish Web Output
|
||||||
*.Publish.xml
|
*.Publish.xml
|
||||||
|
|
||||||
# NuGet Packages Directory
|
# NuGet Packages Directory
|
||||||
packages
|
packages
|
||||||
|
|
||||||
# Windows Azure Build Output
|
# Windows Azure Build Output
|
||||||
csx
|
csx
|
||||||
*.build.csdef
|
*.build.csdef
|
||||||
|
|
||||||
# Windows Store app package directory
|
# Windows Store app package directory
|
||||||
AppPackages/
|
AppPackages/
|
||||||
|
|
||||||
# Others
|
# Others
|
||||||
[Bb]in
|
[Bb]in
|
||||||
[Oo]bj
|
[Oo]bj
|
||||||
sql
|
sql
|
||||||
TestResults
|
TestResults
|
||||||
[Tt]est[Rr]esult*
|
[Tt]est[Rr]esult*
|
||||||
*.Cache
|
*.Cache
|
||||||
ClientBin
|
ClientBin
|
||||||
[Ss]tyle[Cc]op.*
|
[Ss]tyle[Cc]op.*
|
||||||
~$*
|
~$*
|
||||||
*.dbmdl
|
*.dbmdl
|
||||||
Generated_Code #added for RIA/Silverlight projects
|
Generated_Code #added for RIA/Silverlight projects
|
||||||
|
|
||||||
# Backup & report files from converting an old project file to a newer
|
# Backup & report files from converting an old project file to a newer
|
||||||
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||||
_UpgradeReport_Files/
|
_UpgradeReport_Files/
|
||||||
Backup*/
|
Backup*/
|
||||||
UpgradeLog*.XML
|
UpgradeLog*.XML
|
||||||
|
|
||||||
# ---> VisualStudio
|
# ---> VisualStudio
|
||||||
## Ignore Visual Studio temporary files, build results, and
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
## files generated by popular Visual Studio add-ons.
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
*.userosscache
|
*.userosscache
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
*.userprefs
|
*.userprefs
|
||||||
|
|
||||||
# Build results
|
# Build results
|
||||||
[Dd]ebug/
|
[Dd]ebug/
|
||||||
[Dd]ebugPublic/
|
[Dd]ebugPublic/
|
||||||
[Rr]elease/
|
[Rr]elease/
|
||||||
[Rr]eleases/
|
[Rr]eleases/
|
||||||
x64/
|
x64/
|
||||||
x86/
|
x86/
|
||||||
build/
|
build/
|
||||||
bld/
|
bld/
|
||||||
[Bb]in/
|
[Bb]in/
|
||||||
[Oo]bj/
|
[Oo]bj/
|
||||||
|
|
||||||
# Visual Studio 2015 cache/options directory
|
# Visual Studio 2015 cache/options directory
|
||||||
.vs/
|
.vs/
|
||||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
#wwwroot/
|
#wwwroot/
|
||||||
|
|
||||||
# MSTest test Results
|
# MSTest test Results
|
||||||
[Tt]est[Rr]esult*/
|
[Tt]est[Rr]esult*/
|
||||||
[Bb]uild[Ll]og.*
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
# NUNIT
|
# NUNIT
|
||||||
*.VisualState.xml
|
*.VisualState.xml
|
||||||
TestResult.xml
|
TestResult.xml
|
||||||
|
|
||||||
# Build Results of an ATL Project
|
# Build Results of an ATL Project
|
||||||
[Dd]ebugPS/
|
[Dd]ebugPS/
|
||||||
[Rr]eleasePS/
|
[Rr]eleasePS/
|
||||||
dlldata.c
|
dlldata.c
|
||||||
|
|
||||||
# DNX
|
# DNX
|
||||||
project.lock.json
|
project.lock.json
|
||||||
artifacts/
|
artifacts/
|
||||||
|
|
||||||
*_i.c
|
*_i.c
|
||||||
*_p.c
|
*_p.c
|
||||||
*_i.h
|
*_i.h
|
||||||
*.ilk
|
*.ilk
|
||||||
*.meta
|
*.meta
|
||||||
*.obj
|
*.obj
|
||||||
*.pch
|
*.pch
|
||||||
*.pdb
|
*.pdb
|
||||||
*.pgc
|
*.pgc
|
||||||
*.pgd
|
*.pgd
|
||||||
*.rsp
|
*.rsp
|
||||||
*.sbr
|
*.sbr
|
||||||
*.tlb
|
*.tlb
|
||||||
*.tli
|
*.tli
|
||||||
*.tlh
|
*.tlh
|
||||||
*.tmp
|
*.tmp
|
||||||
*.tmp_proj
|
*.tmp_proj
|
||||||
*.log
|
*.log
|
||||||
*.vspscc
|
*.vspscc
|
||||||
*.vssscc
|
*.vssscc
|
||||||
.builds
|
.builds
|
||||||
*.pidb
|
*.pidb
|
||||||
*.svclog
|
*.svclog
|
||||||
*.scc
|
*.scc
|
||||||
|
|
||||||
# Chutzpah Test files
|
# Chutzpah Test files
|
||||||
_Chutzpah*
|
_Chutzpah*
|
||||||
|
|
||||||
# Visual C++ cache files
|
# Visual C++ cache files
|
||||||
ipch/
|
ipch/
|
||||||
*.aps
|
*.aps
|
||||||
*.ncb
|
*.ncb
|
||||||
*.opensdf
|
*.opensdf
|
||||||
*.sdf
|
*.sdf
|
||||||
*.cachefile
|
*.cachefile
|
||||||
|
|
||||||
# Visual Studio profiler
|
# Visual Studio profiler
|
||||||
*.psess
|
*.psess
|
||||||
*.vsp
|
*.vsp
|
||||||
*.vspx
|
*.vspx
|
||||||
*.sap
|
*.sap
|
||||||
|
|
||||||
# TFS 2012 Local Workspace
|
# TFS 2012 Local Workspace
|
||||||
$tf/
|
$tf/
|
||||||
|
|
||||||
# Guidance Automation Toolkit
|
# Guidance Automation Toolkit
|
||||||
*.gpState
|
*.gpState
|
||||||
|
|
||||||
# ReSharper is a .NET coding add-in
|
# ReSharper is a .NET coding add-in
|
||||||
_ReSharper*/
|
_ReSharper*/
|
||||||
*.[Rr]e[Ss]harper
|
*.[Rr]e[Ss]harper
|
||||||
*.DotSettings.user
|
*.DotSettings.user
|
||||||
|
|
||||||
# JustCode is a .NET coding add-in
|
# JustCode is a .NET coding add-in
|
||||||
.JustCode
|
.JustCode
|
||||||
|
|
||||||
# TeamCity is a build add-in
|
# TeamCity is a build add-in
|
||||||
_TeamCity*
|
_TeamCity*
|
||||||
|
|
||||||
# DotCover is a Code Coverage Tool
|
# DotCover is a Code Coverage Tool
|
||||||
*.dotCover
|
*.dotCover
|
||||||
|
|
||||||
# NCrunch
|
# NCrunch
|
||||||
_NCrunch_*
|
_NCrunch_*
|
||||||
.*crunch*.local.xml
|
.*crunch*.local.xml
|
||||||
nCrunchTemp_*
|
nCrunchTemp_*
|
||||||
|
|
||||||
# MightyMoose
|
# MightyMoose
|
||||||
*.mm.*
|
*.mm.*
|
||||||
AutoTest.Net/
|
AutoTest.Net/
|
||||||
|
|
||||||
# Web workbench (sass)
|
# Web workbench (sass)
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
|
|
||||||
# Installshield output folder
|
# Installshield output folder
|
||||||
[Ee]xpress/
|
[Ee]xpress/
|
||||||
|
|
||||||
# DocProject is a documentation generator add-in
|
# DocProject is a documentation generator add-in
|
||||||
DocProject/buildhelp/
|
DocProject/buildhelp/
|
||||||
DocProject/Help/*.HxT
|
DocProject/Help/*.HxT
|
||||||
DocProject/Help/*.HxC
|
DocProject/Help/*.HxC
|
||||||
DocProject/Help/*.hhc
|
DocProject/Help/*.hhc
|
||||||
DocProject/Help/*.hhk
|
DocProject/Help/*.hhk
|
||||||
DocProject/Help/*.hhp
|
DocProject/Help/*.hhp
|
||||||
DocProject/Help/Html2
|
DocProject/Help/Html2
|
||||||
DocProject/Help/html
|
DocProject/Help/html
|
||||||
|
|
||||||
# Click-Once directory
|
# Click-Once directory
|
||||||
publish/
|
publish/
|
||||||
|
|
||||||
# Publish Web Output
|
# Publish Web Output
|
||||||
*.[Pp]ublish.xml
|
*.[Pp]ublish.xml
|
||||||
*.azurePubxml
|
*.azurePubxml
|
||||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||||
# but database connection strings (with potential passwords) will be unencrypted
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
*.pubxml
|
*.pubxml
|
||||||
*.publishproj
|
*.publishproj
|
||||||
|
|
||||||
# NuGet Packages
|
# NuGet Packages
|
||||||
*.nupkg
|
*.nupkg
|
||||||
# The packages folder can be ignored because of Package Restore
|
# The packages folder can be ignored because of Package Restore
|
||||||
**/packages/*
|
**/packages/*
|
||||||
# except build/, which is used as an MSBuild target.
|
# except build/, which is used as an MSBuild target.
|
||||||
!**/packages/build/
|
!**/packages/build/
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
#!**/packages/repositories.config
|
#!**/packages/repositories.config
|
||||||
|
|
||||||
# Windows Azure Build Output
|
# Windows Azure Build Output
|
||||||
csx/
|
csx/
|
||||||
*.build.csdef
|
*.build.csdef
|
||||||
|
|
||||||
# Windows Store app package directory
|
# Windows Store app package directory
|
||||||
AppPackages/
|
AppPackages/
|
||||||
|
|
||||||
# Visual Studio cache files
|
# Visual Studio cache files
|
||||||
# files ending in .cache can be ignored
|
# files ending in .cache can be ignored
|
||||||
*.[Cc]ache
|
*.[Cc]ache
|
||||||
# but keep track of directories ending in .cache
|
# but keep track of directories ending in .cache
|
||||||
!*.[Cc]ache/
|
!*.[Cc]ache/
|
||||||
|
|
||||||
# Others
|
# Others
|
||||||
ClientBin/
|
ClientBin/
|
||||||
[Ss]tyle[Cc]op.*
|
[Ss]tyle[Cc]op.*
|
||||||
~$*
|
~$*
|
||||||
*~
|
*~
|
||||||
*.dbmdl
|
*.dbmdl
|
||||||
*.dbproj.schemaview
|
*.dbproj.schemaview
|
||||||
*.pfx
|
*.pfx
|
||||||
*.publishsettings
|
*.publishsettings
|
||||||
node_modules/
|
node_modules/
|
||||||
orleans.codegen.cs
|
orleans.codegen.cs
|
||||||
|
|
||||||
# RIA/Silverlight projects
|
# RIA/Silverlight projects
|
||||||
Generated_Code/
|
Generated_Code/
|
||||||
|
|
||||||
# Backup & report files from converting an old project file
|
# Backup & report files from converting an old project file
|
||||||
# to a newer Visual Studio version. Backup files are not needed,
|
# to a newer Visual Studio version. Backup files are not needed,
|
||||||
# because we have git ;-)
|
# because we have git ;-)
|
||||||
_UpgradeReport_Files/
|
_UpgradeReport_Files/
|
||||||
Backup*/
|
Backup*/
|
||||||
UpgradeLog*.XML
|
UpgradeLog*.XML
|
||||||
UpgradeLog*.htm
|
UpgradeLog*.htm
|
||||||
|
|
||||||
# SQL Server files
|
# SQL Server files
|
||||||
*.mdf
|
*.mdf
|
||||||
*.ldf
|
*.ldf
|
||||||
|
|
||||||
# Business Intelligence projects
|
# Business Intelligence projects
|
||||||
*.rdl.data
|
*.rdl.data
|
||||||
*.bim.layout
|
*.bim.layout
|
||||||
*.bim_*.settings
|
*.bim_*.settings
|
||||||
|
|
||||||
# Microsoft Fakes
|
# Microsoft Fakes
|
||||||
FakesAssemblies/
|
FakesAssemblies/
|
||||||
|
|
||||||
# Node.js Tools for Visual Studio
|
# Node.js Tools for Visual Studio
|
||||||
.ntvs_analysis.dat
|
.ntvs_analysis.dat
|
||||||
|
|
||||||
# Visual Studio 6 build log
|
# Visual Studio 6 build log
|
||||||
*.plg
|
*.plg
|
||||||
|
|
||||||
# Visual Studio 6 workspace options file
|
# Visual Studio 6 workspace options file
|
||||||
*.opt
|
*.opt
|
||||||
|
|
||||||
# Visual Studio LightSwitch build output
|
# Visual Studio LightSwitch build output
|
||||||
**/*.HTMLClient/GeneratedArtifacts
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
**/*.DesktopClient/GeneratedArtifacts
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
**/*.DesktopClient/ModelManifest.xml
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
**/*.Server/GeneratedArtifacts
|
**/*.Server/GeneratedArtifacts
|
||||||
**/*.Server/ModelManifest.xml
|
**/*.Server/ModelManifest.xml
|
||||||
_Pvt_Extensions
|
_Pvt_Extensions
|
||||||
|
|
||||||
# ---> Windows
|
# ---> Windows
|
||||||
# Windows image file caches
|
# Windows image file caches
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
ehthumbs.db
|
ehthumbs.db
|
||||||
|
|
||||||
# Folder config file
|
# Folder config file
|
||||||
Desktop.ini
|
Desktop.ini
|
||||||
|
|
||||||
# Recycle Bin used on file shares
|
# Recycle Bin used on file shares
|
||||||
$RECYCLE.BIN/
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
# Windows Installer files
|
# Windows Installer files
|
||||||
*.cab
|
*.cab
|
||||||
*.msi
|
*.msi
|
||||||
*.msm
|
*.msm
|
||||||
*.msp
|
*.msp
|
||||||
|
|
||||||
# Windows shortcuts
|
# Windows shortcuts
|
||||||
*.lnk
|
*.lnk
|
||||||
|
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.26228.12
|
VisualStudioVersion = 15.0.26228.12
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PIC_Simulator", "PIC_Simulator\PIC_Simulator.csproj", "{61AE0011-89B1-46B3-B2EA-E0949BD27605}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PIC_Simulator", "PIC_Simulator\PIC_Simulator.csproj", "{61AE0011-89B1-46B3-B2EA-E0949BD27605}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{61AE0011-89B1-46B3-B2EA-E0949BD27605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{61AE0011-89B1-46B3-B2EA-E0949BD27605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{61AE0011-89B1-46B3-B2EA-E0949BD27605}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{61AE0011-89B1-46B3-B2EA-E0949BD27605}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{61AE0011-89B1-46B3-B2EA-E0949BD27605}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{61AE0011-89B1-46B3-B2EA-E0949BD27605}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{61AE0011-89B1-46B3-B2EA-E0949BD27605}.Release|Any CPU.Build.0 = Release|Any CPU
|
{61AE0011-89B1-46B3-B2EA-E0949BD27605}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||||
</startup>
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PIC_Simulator
|
|
||||||
{
|
|
||||||
class Befehlssatz
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace PIC_Simulator
|
|
||||||
{
|
|
||||||
|
|
||||||
public class Einlesen
|
|
||||||
{
|
|
||||||
//Globale Variablen der Klasse:
|
|
||||||
public int LengthArray = 0;
|
|
||||||
public string[] result;
|
|
||||||
|
|
||||||
public int writeToArray(StreamReader sr)
|
|
||||||
{
|
|
||||||
|
|
||||||
// StreamReader jede Zeile in Listenelement schreiben
|
|
||||||
var list = new List<string>();
|
|
||||||
string line;
|
|
||||||
while ((line = sr.ReadLine()) != null)
|
|
||||||
{ if (!line.StartsWith(" ") )
|
|
||||||
{
|
|
||||||
list.Add(line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Schreiben der Listenelemente in String Array
|
|
||||||
result = list.ToArray();
|
|
||||||
LengthArray = result.Length -1; //-1 Wegen Start des Arrays bei Index 0!
|
|
||||||
// MessageBox.Show("Zeilen des Programms:" + LengthArray );
|
|
||||||
|
|
||||||
//PCount Variable von Form1 holen und für readExec als Param nutzen
|
|
||||||
Form1 instForm1 = new Form1();
|
|
||||||
readExecCode(instForm1.PCounter);
|
|
||||||
return LengthArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Ausführbarer Maschinencode aus Zeile des Arrays herausschneiden
|
|
||||||
public void readExecCode(int index) {
|
|
||||||
try
|
|
||||||
{
|
|
||||||
result[index] = result[index].Substring(5, 4);
|
|
||||||
// MessageBox.Show(result[index]);
|
|
||||||
execCode(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
catch { }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string execCode(int index) {
|
|
||||||
// MessageBox.Show("Index der Row welche ausgeführt werden soll" + index);
|
|
||||||
MessageBox.Show("Code der ausgeführt werden soll" + result[index]);
|
|
||||||
|
|
||||||
Register Ausführen = new Register();
|
|
||||||
Ausführen.findOrder(result[index].ToString());
|
|
||||||
return result[index];
|
|
||||||
|
|
||||||
// Hier ist der Start für die Befehlsausführung des PIC bzw. Übergabe an Befehlssatz
|
|
||||||
// Return übergibt Auszuführenden Code!!
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
737
PIC_Simulator/Form1.Designer.cs
generated
737
PIC_Simulator/Form1.Designer.cs
generated
@ -1,372 +1,365 @@
|
|||||||
namespace PIC_Simulator
|
namespace PIC_Simulator
|
||||||
{
|
{
|
||||||
partial class Form1
|
partial class Form1
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Erforderliche Designervariable.
|
/// Erforderliche Designervariable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private System.ComponentModel.IContainer components = null;
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Verwendete Ressourcen bereinigen.
|
/// Verwendete Ressourcen bereinigen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing && (components != null))
|
if (disposing && (components != null))
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
}
|
}
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Vom Windows Form-Designer generierter Code
|
#region Vom Windows Form-Designer generierter Code
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Erforderliche Methode für die Designerunterstützung.
|
/// Erforderliche Methode für die Designerunterstützung.
|
||||||
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("INDF");
|
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("INDF");
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.label2 = new System.Windows.Forms.Label();
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
this.box_CodeView = new System.Windows.Forms.RichTextBox();
|
this.box_CodeView = new System.Windows.Forms.RichTextBox();
|
||||||
this.lbl_path = new System.Windows.Forms.Label();
|
this.lbl_path = new System.Windows.Forms.Label();
|
||||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||||
this.cmd_Start = new System.Windows.Forms.Button();
|
this.cmd_Start = new System.Windows.Forms.Button();
|
||||||
this.cmd_next = new System.Windows.Forms.Button();
|
this.cmd_next = new System.Windows.Forms.Button();
|
||||||
this.cmd_reset = new System.Windows.Forms.Button();
|
this.cmd_reset = new System.Windows.Forms.Button();
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||||
this.cmdOpenFile = new System.Windows.Forms.ToolStripMenuItem();
|
this.cmdOpenFile = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.programmÖffnenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.programmÖffnenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.beendenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.beendenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.hilfeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.hilfeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.cmdOpenDoc = new System.Windows.Forms.ToolStripMenuItem();
|
this.cmdOpenDoc = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.label4 = new System.Windows.Forms.Label();
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
this.cmdSetClock = new System.Windows.Forms.Button();
|
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
this.listView1 = new System.Windows.Forms.ListView();
|
||||||
this.listView1 = new System.Windows.Forms.ListView();
|
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.cmd_Stop = new System.Windows.Forms.Button();
|
||||||
this.cmd_Stop = new System.Windows.Forms.Button();
|
this.lbl_Timer = new System.Windows.Forms.Label();
|
||||||
this.lbl_Timer = new System.Windows.Forms.Label();
|
this.insertTime = new System.Windows.Forms.TextBox();
|
||||||
this.insertTime = new System.Windows.Forms.TextBox();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.SuspendLayout();
|
||||||
this.SuspendLayout();
|
//
|
||||||
//
|
// label1
|
||||||
// label1
|
//
|
||||||
//
|
this.label1.AutoSize = true;
|
||||||
this.label1.AutoSize = true;
|
this.label1.BackColor = System.Drawing.SystemColors.Control;
|
||||||
this.label1.BackColor = System.Drawing.SystemColors.Control;
|
this.label1.Location = new System.Drawing.Point(29, 78);
|
||||||
this.label1.Location = new System.Drawing.Point(39, 96);
|
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
this.label1.Name = "label1";
|
this.label1.Name = "label1";
|
||||||
this.label1.Size = new System.Drawing.Size(0, 17);
|
this.label1.Size = new System.Drawing.Size(0, 13);
|
||||||
this.label1.TabIndex = 1;
|
this.label1.TabIndex = 1;
|
||||||
this.label1.Click += new System.EventHandler(this.label1_Click);
|
//
|
||||||
//
|
// label2
|
||||||
// label2
|
//
|
||||||
//
|
this.label2.AutoSize = true;
|
||||||
this.label2.AutoSize = true;
|
this.label2.Location = new System.Drawing.Point(8, 469);
|
||||||
this.label2.Location = new System.Drawing.Point(11, 577);
|
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
this.label2.Name = "label2";
|
this.label2.Name = "label2";
|
||||||
this.label2.Size = new System.Drawing.Size(105, 17);
|
this.label2.Size = new System.Drawing.Size(78, 13);
|
||||||
this.label2.TabIndex = 2;
|
this.label2.TabIndex = 2;
|
||||||
this.label2.Text = "Programmpfad:";
|
this.label2.Text = "Programmpfad:";
|
||||||
//
|
//
|
||||||
// box_CodeView
|
// box_CodeView
|
||||||
//
|
//
|
||||||
this.box_CodeView.Location = new System.Drawing.Point(11, 95);
|
this.box_CodeView.Location = new System.Drawing.Point(8, 77);
|
||||||
this.box_CodeView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
this.box_CodeView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.box_CodeView.Name = "box_CodeView";
|
this.box_CodeView.Name = "box_CodeView";
|
||||||
this.box_CodeView.Size = new System.Drawing.Size(833, 462);
|
this.box_CodeView.ReadOnly = true;
|
||||||
this.box_CodeView.TabIndex = 3;
|
this.box_CodeView.Size = new System.Drawing.Size(626, 376);
|
||||||
this.box_CodeView.Text = "";
|
this.box_CodeView.TabIndex = 3;
|
||||||
this.box_CodeView.WordWrap = false;
|
this.box_CodeView.Text = "";
|
||||||
//
|
this.box_CodeView.WordWrap = false;
|
||||||
// lbl_path
|
//
|
||||||
//
|
// lbl_path
|
||||||
this.lbl_path.AutoSize = true;
|
//
|
||||||
this.lbl_path.Location = new System.Drawing.Point(116, 577);
|
this.lbl_path.AutoSize = true;
|
||||||
this.lbl_path.Name = "lbl_path";
|
this.lbl_path.Location = new System.Drawing.Point(87, 469);
|
||||||
this.lbl_path.Size = new System.Drawing.Size(0, 17);
|
this.lbl_path.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
this.lbl_path.TabIndex = 4;
|
this.lbl_path.Name = "lbl_path";
|
||||||
//
|
this.lbl_path.Size = new System.Drawing.Size(0, 13);
|
||||||
// openFileDialog1
|
this.lbl_path.TabIndex = 4;
|
||||||
//
|
//
|
||||||
this.openFileDialog1.FileName = "openFileDialog1";
|
// openFileDialog1
|
||||||
//
|
//
|
||||||
// cmd_Start
|
this.openFileDialog1.FileName = "openFileDialog1";
|
||||||
//
|
//
|
||||||
this.cmd_Start.Location = new System.Drawing.Point(15, 36);
|
// cmd_Start
|
||||||
this.cmd_Start.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
//
|
||||||
this.cmd_Start.Name = "cmd_Start";
|
this.cmd_Start.Location = new System.Drawing.Point(11, 29);
|
||||||
this.cmd_Start.Size = new System.Drawing.Size(67, 28);
|
this.cmd_Start.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.cmd_Start.TabIndex = 5;
|
this.cmd_Start.Name = "cmd_Start";
|
||||||
this.cmd_Start.Text = "Start";
|
this.cmd_Start.Size = new System.Drawing.Size(50, 23);
|
||||||
this.cmd_Start.UseVisualStyleBackColor = true;
|
this.cmd_Start.TabIndex = 5;
|
||||||
this.cmd_Start.Click += new System.EventHandler(this.cmd_Start_Click);
|
this.cmd_Start.Text = "Start";
|
||||||
//
|
this.cmd_Start.UseVisualStyleBackColor = true;
|
||||||
// cmd_next
|
this.cmd_Start.Click += new System.EventHandler(this.cmd_Start_Click);
|
||||||
//
|
//
|
||||||
this.cmd_next.Location = new System.Drawing.Point(168, 38);
|
// cmd_next
|
||||||
this.cmd_next.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
//
|
||||||
this.cmd_next.Name = "cmd_next";
|
this.cmd_next.Location = new System.Drawing.Point(126, 31);
|
||||||
this.cmd_next.Size = new System.Drawing.Size(67, 26);
|
this.cmd_next.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.cmd_next.TabIndex = 6;
|
this.cmd_next.Name = "cmd_next";
|
||||||
this.cmd_next.Text = "Schritt";
|
this.cmd_next.Size = new System.Drawing.Size(50, 21);
|
||||||
this.cmd_next.UseVisualStyleBackColor = true;
|
this.cmd_next.TabIndex = 6;
|
||||||
this.cmd_next.Click += new System.EventHandler(this.cmd_next_Click);
|
this.cmd_next.Text = "Schritt";
|
||||||
//
|
this.cmd_next.UseVisualStyleBackColor = true;
|
||||||
// cmd_reset
|
this.cmd_next.Click += new System.EventHandler(this.cmd_next_Click);
|
||||||
//
|
//
|
||||||
this.cmd_reset.Location = new System.Drawing.Point(253, 38);
|
// cmd_reset
|
||||||
this.cmd_reset.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
//
|
||||||
this.cmd_reset.Name = "cmd_reset";
|
this.cmd_reset.Location = new System.Drawing.Point(190, 31);
|
||||||
this.cmd_reset.Size = new System.Drawing.Size(67, 26);
|
this.cmd_reset.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.cmd_reset.TabIndex = 7;
|
this.cmd_reset.Name = "cmd_reset";
|
||||||
this.cmd_reset.Text = "Reset";
|
this.cmd_reset.Size = new System.Drawing.Size(50, 21);
|
||||||
this.cmd_reset.UseVisualStyleBackColor = true;
|
this.cmd_reset.TabIndex = 7;
|
||||||
this.cmd_reset.Click += new System.EventHandler(this.cmd_reset_Click);
|
this.cmd_reset.Text = "Reset";
|
||||||
//
|
this.cmd_reset.UseVisualStyleBackColor = true;
|
||||||
// label3
|
this.cmd_reset.Click += new System.EventHandler(this.cmd_reset_Click);
|
||||||
//
|
//
|
||||||
this.label3.AutoSize = true;
|
// label3
|
||||||
this.label3.Location = new System.Drawing.Point(331, 42);
|
//
|
||||||
this.label3.Name = "label3";
|
this.label3.AutoSize = true;
|
||||||
this.label3.Size = new System.Drawing.Size(112, 17);
|
this.label3.Location = new System.Drawing.Point(248, 34);
|
||||||
this.label3.TabIndex = 8;
|
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
this.label3.Text = "Programmzähler";
|
this.label3.Name = "label3";
|
||||||
//
|
this.label3.Size = new System.Drawing.Size(82, 13);
|
||||||
// menuStrip1
|
this.label3.TabIndex = 8;
|
||||||
//
|
this.label3.Text = "Programmzähler";
|
||||||
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
|
//
|
||||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
// menuStrip1
|
||||||
this.cmdOpenFile,
|
//
|
||||||
this.hilfeToolStripMenuItem});
|
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.menuStrip1.Name = "menuStrip1";
|
this.cmdOpenFile,
|
||||||
this.menuStrip1.Padding = new System.Windows.Forms.Padding(5, 2, 0, 2);
|
this.hilfeToolStripMenuItem});
|
||||||
this.menuStrip1.Size = new System.Drawing.Size(1397, 28);
|
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||||
this.menuStrip1.TabIndex = 9;
|
this.menuStrip1.Name = "menuStrip1";
|
||||||
this.menuStrip1.Text = "menuStrip1";
|
this.menuStrip1.Padding = new System.Windows.Forms.Padding(4, 2, 0, 2);
|
||||||
//
|
this.menuStrip1.Size = new System.Drawing.Size(1048, 24);
|
||||||
// cmdOpenFile
|
this.menuStrip1.TabIndex = 9;
|
||||||
//
|
this.menuStrip1.Text = "menuStrip1";
|
||||||
this.cmdOpenFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
//
|
||||||
this.programmÖffnenToolStripMenuItem,
|
// cmdOpenFile
|
||||||
this.beendenToolStripMenuItem});
|
//
|
||||||
this.cmdOpenFile.Name = "cmdOpenFile";
|
this.cmdOpenFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.cmdOpenFile.Size = new System.Drawing.Size(57, 24);
|
this.programmÖffnenToolStripMenuItem,
|
||||||
this.cmdOpenFile.Text = "Datei";
|
this.beendenToolStripMenuItem});
|
||||||
//
|
this.cmdOpenFile.Name = "cmdOpenFile";
|
||||||
// programmÖffnenToolStripMenuItem
|
this.cmdOpenFile.Size = new System.Drawing.Size(46, 20);
|
||||||
//
|
this.cmdOpenFile.Text = "Datei";
|
||||||
this.programmÖffnenToolStripMenuItem.Name = "programmÖffnenToolStripMenuItem";
|
//
|
||||||
this.programmÖffnenToolStripMenuItem.Size = new System.Drawing.Size(201, 26);
|
// programmÖffnenToolStripMenuItem
|
||||||
this.programmÖffnenToolStripMenuItem.Text = "Programm öffnen";
|
//
|
||||||
this.programmÖffnenToolStripMenuItem.Click += new System.EventHandler(this.programmÖffnenToolStripMenuItem_Click);
|
this.programmÖffnenToolStripMenuItem.Name = "programmÖffnenToolStripMenuItem";
|
||||||
//
|
this.programmÖffnenToolStripMenuItem.Size = new System.Drawing.Size(169, 22);
|
||||||
// beendenToolStripMenuItem
|
this.programmÖffnenToolStripMenuItem.Text = "Programm öffnen";
|
||||||
//
|
this.programmÖffnenToolStripMenuItem.Click += new System.EventHandler(this.programmÖffnenToolStripMenuItem_Click);
|
||||||
this.beendenToolStripMenuItem.Name = "beendenToolStripMenuItem";
|
//
|
||||||
this.beendenToolStripMenuItem.Size = new System.Drawing.Size(201, 26);
|
// beendenToolStripMenuItem
|
||||||
this.beendenToolStripMenuItem.Text = "Beenden";
|
//
|
||||||
this.beendenToolStripMenuItem.Click += new System.EventHandler(this.beendenToolStripMenuItem_Click);
|
this.beendenToolStripMenuItem.Name = "beendenToolStripMenuItem";
|
||||||
//
|
this.beendenToolStripMenuItem.Size = new System.Drawing.Size(169, 22);
|
||||||
// hilfeToolStripMenuItem
|
this.beendenToolStripMenuItem.Text = "Beenden";
|
||||||
//
|
this.beendenToolStripMenuItem.Click += new System.EventHandler(this.beendenToolStripMenuItem_Click);
|
||||||
this.hilfeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
//
|
||||||
this.cmdOpenDoc});
|
// hilfeToolStripMenuItem
|
||||||
this.hilfeToolStripMenuItem.Name = "hilfeToolStripMenuItem";
|
//
|
||||||
this.hilfeToolStripMenuItem.Size = new System.Drawing.Size(53, 24);
|
this.hilfeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.hilfeToolStripMenuItem.Text = "Hilfe";
|
this.cmdOpenDoc});
|
||||||
//
|
this.hilfeToolStripMenuItem.Name = "hilfeToolStripMenuItem";
|
||||||
// cmdOpenDoc
|
this.hilfeToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||||
//
|
this.hilfeToolStripMenuItem.Text = "Hilfe";
|
||||||
this.cmdOpenDoc.Name = "cmdOpenDoc";
|
//
|
||||||
this.cmdOpenDoc.Size = new System.Drawing.Size(234, 26);
|
// cmdOpenDoc
|
||||||
this.cmdOpenDoc.Text = "Dokumentation öffnen";
|
//
|
||||||
this.cmdOpenDoc.Click += new System.EventHandler(this.cmdOpenDoc_Click);
|
this.cmdOpenDoc.Name = "cmdOpenDoc";
|
||||||
//
|
this.cmdOpenDoc.Size = new System.Drawing.Size(195, 22);
|
||||||
// label4
|
this.cmdOpenDoc.Text = "Dokumentation öffnen";
|
||||||
//
|
this.cmdOpenDoc.Click += new System.EventHandler(this.cmdOpenDoc_Click);
|
||||||
this.label4.AutoSize = true;
|
//
|
||||||
this.label4.Location = new System.Drawing.Point(1038, 36);
|
// label4
|
||||||
this.label4.Name = "label4";
|
//
|
||||||
this.label4.Size = new System.Drawing.Size(129, 17);
|
this.label4.AutoSize = true;
|
||||||
this.label4.TabIndex = 10;
|
this.label4.Location = new System.Drawing.Point(778, 29);
|
||||||
this.label4.Text = "Quarzfrequenz in s";
|
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
//
|
this.label4.Name = "label4";
|
||||||
// cmdSetClock
|
this.label4.Size = new System.Drawing.Size(95, 13);
|
||||||
//
|
this.label4.TabIndex = 10;
|
||||||
this.cmdSetClock.Location = new System.Drawing.Point(1273, 34);
|
this.label4.Text = "Quarzfrequenz in s";
|
||||||
this.cmdSetClock.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
//
|
||||||
this.cmdSetClock.Name = "cmdSetClock";
|
// timer1
|
||||||
this.cmdSetClock.Size = new System.Drawing.Size(67, 24);
|
//
|
||||||
this.cmdSetClock.TabIndex = 11;
|
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||||
this.cmdSetClock.Text = "setzen";
|
//
|
||||||
this.cmdSetClock.UseVisualStyleBackColor = true;
|
// listView1
|
||||||
this.cmdSetClock.Click += new System.EventHandler(this.cmdSetClock_Click);
|
//
|
||||||
//
|
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||||
// timer1
|
this.columnHeader1,
|
||||||
//
|
this.columnHeader2,
|
||||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
this.columnHeader3,
|
||||||
//
|
this.columnHeader4,
|
||||||
// listView1
|
this.columnHeader5,
|
||||||
//
|
this.columnHeader6,
|
||||||
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
this.columnHeader7,
|
||||||
this.columnHeader1,
|
this.columnHeader8});
|
||||||
this.columnHeader2,
|
this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
|
||||||
this.columnHeader3,
|
listViewItem2});
|
||||||
this.columnHeader4,
|
this.listView1.Location = new System.Drawing.Point(680, 77);
|
||||||
this.columnHeader5,
|
this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.columnHeader6,
|
this.listView1.Name = "listView1";
|
||||||
this.columnHeader7,
|
this.listView1.Size = new System.Drawing.Size(326, 285);
|
||||||
this.columnHeader8});
|
this.listView1.TabIndex = 14;
|
||||||
this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
|
this.listView1.UseCompatibleStateImageBehavior = false;
|
||||||
listViewItem2});
|
this.listView1.View = System.Windows.Forms.View.Details;
|
||||||
this.listView1.Location = new System.Drawing.Point(906, 95);
|
//
|
||||||
this.listView1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
// columnHeader1
|
||||||
this.listView1.Name = "listView1";
|
//
|
||||||
this.listView1.Size = new System.Drawing.Size(434, 350);
|
this.columnHeader1.Text = "0";
|
||||||
this.listView1.TabIndex = 14;
|
//
|
||||||
this.listView1.UseCompatibleStateImageBehavior = false;
|
// columnHeader2
|
||||||
this.listView1.View = System.Windows.Forms.View.Details;
|
//
|
||||||
//
|
this.columnHeader2.Text = "1";
|
||||||
// columnHeader1
|
//
|
||||||
//
|
// columnHeader3
|
||||||
this.columnHeader1.Text = "0";
|
//
|
||||||
//
|
this.columnHeader3.Text = "2";
|
||||||
// columnHeader2
|
//
|
||||||
//
|
// columnHeader4
|
||||||
this.columnHeader2.Text = "1";
|
//
|
||||||
//
|
this.columnHeader4.Text = "3";
|
||||||
// columnHeader3
|
//
|
||||||
//
|
// columnHeader5
|
||||||
this.columnHeader3.Text = "2";
|
//
|
||||||
//
|
this.columnHeader5.Text = "4";
|
||||||
// columnHeader4
|
//
|
||||||
//
|
// columnHeader6
|
||||||
this.columnHeader4.Text = "3";
|
//
|
||||||
//
|
this.columnHeader6.Text = "5";
|
||||||
// columnHeader5
|
this.columnHeader6.Width = 62;
|
||||||
//
|
//
|
||||||
this.columnHeader5.Text = "4";
|
// columnHeader7
|
||||||
//
|
//
|
||||||
// columnHeader6
|
this.columnHeader7.Text = "6";
|
||||||
//
|
//
|
||||||
this.columnHeader6.Text = "5";
|
// columnHeader8
|
||||||
this.columnHeader6.Width = 62;
|
//
|
||||||
//
|
this.columnHeader8.Text = "7";
|
||||||
// columnHeader7
|
//
|
||||||
//
|
// cmd_Stop
|
||||||
this.columnHeader7.Text = "6";
|
//
|
||||||
//
|
this.cmd_Stop.Location = new System.Drawing.Point(64, 30);
|
||||||
// columnHeader8
|
this.cmd_Stop.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
//
|
this.cmd_Stop.Name = "cmd_Stop";
|
||||||
this.columnHeader8.Text = "7";
|
this.cmd_Stop.Size = new System.Drawing.Size(50, 22);
|
||||||
//
|
this.cmd_Stop.TabIndex = 15;
|
||||||
// cmd_Stop
|
this.cmd_Stop.Text = "Stop";
|
||||||
//
|
this.cmd_Stop.UseVisualStyleBackColor = true;
|
||||||
this.cmd_Stop.Location = new System.Drawing.Point(85, 37);
|
this.cmd_Stop.Click += new System.EventHandler(this.cmd_Stop_Click);
|
||||||
this.cmd_Stop.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
//
|
||||||
this.cmd_Stop.Name = "cmd_Stop";
|
// lbl_Timer
|
||||||
this.cmd_Stop.Size = new System.Drawing.Size(67, 27);
|
//
|
||||||
this.cmd_Stop.TabIndex = 15;
|
this.lbl_Timer.AutoSize = true;
|
||||||
this.cmd_Stop.Text = "Stop";
|
this.lbl_Timer.Location = new System.Drawing.Point(705, 28);
|
||||||
this.cmd_Stop.UseVisualStyleBackColor = true;
|
this.lbl_Timer.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
this.cmd_Stop.Click += new System.EventHandler(this.cmd_Stop_Click);
|
this.lbl_Timer.Name = "lbl_Timer";
|
||||||
//
|
this.lbl_Timer.Size = new System.Drawing.Size(33, 13);
|
||||||
// lbl_Timer
|
this.lbl_Timer.TabIndex = 16;
|
||||||
//
|
this.lbl_Timer.Text = "Timer";
|
||||||
this.lbl_Timer.AutoSize = true;
|
//
|
||||||
this.lbl_Timer.Location = new System.Drawing.Point(940, 34);
|
// insertTime
|
||||||
this.lbl_Timer.Name = "lbl_Timer";
|
//
|
||||||
this.lbl_Timer.Size = new System.Drawing.Size(44, 17);
|
this.insertTime.Location = new System.Drawing.Point(894, 31);
|
||||||
this.lbl_Timer.TabIndex = 16;
|
this.insertTime.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.lbl_Timer.Text = "Timer";
|
this.insertTime.Name = "insertTime";
|
||||||
//
|
this.insertTime.Size = new System.Drawing.Size(47, 20);
|
||||||
// insertTime
|
this.insertTime.TabIndex = 17;
|
||||||
//
|
this.insertTime.Text = "100";
|
||||||
this.insertTime.Location = new System.Drawing.Point(1192, 38);
|
//
|
||||||
this.insertTime.Name = "insertTime";
|
// Form1
|
||||||
this.insertTime.Size = new System.Drawing.Size(61, 22);
|
//
|
||||||
this.insertTime.TabIndex = 17;
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.insertTime.Text = "100";
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
//
|
this.ClientSize = new System.Drawing.Size(1048, 488);
|
||||||
// Form1
|
this.Controls.Add(this.insertTime);
|
||||||
//
|
this.Controls.Add(this.lbl_Timer);
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
this.Controls.Add(this.cmd_Stop);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.Controls.Add(this.listView1);
|
||||||
this.ClientSize = new System.Drawing.Size(1397, 600);
|
this.Controls.Add(this.label4);
|
||||||
this.Controls.Add(this.insertTime);
|
this.Controls.Add(this.label3);
|
||||||
this.Controls.Add(this.lbl_Timer);
|
this.Controls.Add(this.cmd_reset);
|
||||||
this.Controls.Add(this.cmd_Stop);
|
this.Controls.Add(this.cmd_next);
|
||||||
this.Controls.Add(this.listView1);
|
this.Controls.Add(this.cmd_Start);
|
||||||
this.Controls.Add(this.cmdSetClock);
|
this.Controls.Add(this.lbl_path);
|
||||||
this.Controls.Add(this.label4);
|
this.Controls.Add(this.box_CodeView);
|
||||||
this.Controls.Add(this.label3);
|
this.Controls.Add(this.label2);
|
||||||
this.Controls.Add(this.cmd_reset);
|
this.Controls.Add(this.label1);
|
||||||
this.Controls.Add(this.cmd_next);
|
this.Controls.Add(this.menuStrip1);
|
||||||
this.Controls.Add(this.cmd_Start);
|
this.MainMenuStrip = this.menuStrip1;
|
||||||
this.Controls.Add(this.lbl_path);
|
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.Controls.Add(this.box_CodeView);
|
this.Name = "Form1";
|
||||||
this.Controls.Add(this.label2);
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
this.Controls.Add(this.label1);
|
this.Text = "PIC Simulator";
|
||||||
this.Controls.Add(this.menuStrip1);
|
this.Load += new System.EventHandler(this.Form1_Load);
|
||||||
this.MainMenuStrip = this.menuStrip1;
|
this.menuStrip1.ResumeLayout(false);
|
||||||
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
this.menuStrip1.PerformLayout();
|
||||||
this.Name = "Form1";
|
this.ResumeLayout(false);
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
this.PerformLayout();
|
||||||
this.Text = "PIC Simulator";
|
|
||||||
this.Load += new System.EventHandler(this.Form1_Load);
|
}
|
||||||
this.menuStrip1.ResumeLayout(false);
|
|
||||||
this.menuStrip1.PerformLayout();
|
#endregion
|
||||||
this.ResumeLayout(false);
|
private System.Windows.Forms.Label label1;
|
||||||
this.PerformLayout();
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.RichTextBox box_CodeView;
|
||||||
}
|
private System.Windows.Forms.Label lbl_path;
|
||||||
|
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
||||||
#endregion
|
private System.Windows.Forms.Button cmd_Start;
|
||||||
private System.Windows.Forms.Label label1;
|
private System.Windows.Forms.Button cmd_next;
|
||||||
private System.Windows.Forms.Label label2;
|
private System.Windows.Forms.Button cmd_reset;
|
||||||
private System.Windows.Forms.RichTextBox box_CodeView;
|
private System.Windows.Forms.Label label3;
|
||||||
private System.Windows.Forms.Label lbl_path;
|
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||||
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
private System.Windows.Forms.ToolStripMenuItem cmdOpenFile;
|
||||||
private System.Windows.Forms.Button cmd_Start;
|
private System.Windows.Forms.ToolStripMenuItem programmÖffnenToolStripMenuItem;
|
||||||
private System.Windows.Forms.Button cmd_next;
|
private System.Windows.Forms.ToolStripMenuItem hilfeToolStripMenuItem;
|
||||||
private System.Windows.Forms.Button cmd_reset;
|
private System.Windows.Forms.ToolStripMenuItem cmdOpenDoc;
|
||||||
private System.Windows.Forms.Label label3;
|
private System.Windows.Forms.Label label4;
|
||||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
private System.Windows.Forms.Timer timer1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem cmdOpenFile;
|
private System.Windows.Forms.ListView listView1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem programmÖffnenToolStripMenuItem;
|
private System.Windows.Forms.ColumnHeader columnHeader1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem hilfeToolStripMenuItem;
|
private System.Windows.Forms.ColumnHeader columnHeader2;
|
||||||
private System.Windows.Forms.ToolStripMenuItem cmdOpenDoc;
|
private System.Windows.Forms.ColumnHeader columnHeader3;
|
||||||
private System.Windows.Forms.Label label4;
|
private System.Windows.Forms.ColumnHeader columnHeader4;
|
||||||
private System.Windows.Forms.Button cmdSetClock;
|
private System.Windows.Forms.ColumnHeader columnHeader5;
|
||||||
private System.Windows.Forms.Timer timer1;
|
private System.Windows.Forms.ColumnHeader columnHeader6;
|
||||||
private System.Windows.Forms.ListView listView1;
|
private System.Windows.Forms.ColumnHeader columnHeader7;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader1;
|
private System.Windows.Forms.ColumnHeader columnHeader8;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader2;
|
private System.Windows.Forms.ToolStripMenuItem beendenToolStripMenuItem;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader3;
|
private System.Windows.Forms.Button cmd_Stop;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader4;
|
private System.Windows.Forms.Label lbl_Timer;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader5;
|
private System.Windows.Forms.TextBox insertTime;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader6;
|
}
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader7;
|
}
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader8;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem beendenToolStripMenuItem;
|
|
||||||
private System.Windows.Forms.Button cmd_Stop;
|
|
||||||
private System.Windows.Forms.Label lbl_Timer;
|
|
||||||
private System.Windows.Forms.TextBox insertTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -1,173 +1,111 @@
|
|||||||
using System;
|
using PIC_Simulator.PIC;
|
||||||
using System.Collections.Generic;
|
using PIC_Simulator.Properties;
|
||||||
using System.ComponentModel;
|
using System;
|
||||||
using System.Data;
|
using System.Drawing;
|
||||||
using System.Drawing;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Windows.Forms;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
namespace PIC_Simulator
|
||||||
using System.Windows.Forms;
|
{
|
||||||
using System.IO;
|
public partial class Form1 : Form
|
||||||
using PIC_Simulator;
|
{
|
||||||
|
private PICProgramm programm;
|
||||||
|
|
||||||
|
private Timer quartztimer = new Timer();
|
||||||
namespace PIC_Simulator
|
|
||||||
{
|
public Form1()
|
||||||
public partial class Form1 : Form
|
{
|
||||||
{
|
InitializeComponent();
|
||||||
|
|
||||||
public Form1()
|
}
|
||||||
{
|
|
||||||
InitializeComponent();
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
}
|
box_CodeView.Font = new Font("Consolas", 8);
|
||||||
// Globale Variablen
|
|
||||||
public int ArrayLaenge =0;
|
box_CodeView.Text = Resources.TPicSim1;
|
||||||
public int PCounter = -1;
|
|
||||||
public int time;
|
programm = new PICProgramm();
|
||||||
public int timeIntervall;
|
programm.Laden(Resources.TPicSim1);
|
||||||
Einlesen instEinlesen = new Einlesen();
|
}
|
||||||
|
|
||||||
|
private void cmd_Start_Click(object sender, EventArgs e)
|
||||||
private void label1_Click(object sender, EventArgs e)
|
{
|
||||||
{
|
quartztimer.Stop();
|
||||||
|
quartztimer.Interval = int.Parse(insertTime.Text);
|
||||||
}
|
quartztimer.Start();
|
||||||
|
}
|
||||||
private void Form1_Load(object sender, EventArgs e)
|
|
||||||
{
|
private void cmd_next_Click(object sender, EventArgs e)
|
||||||
box_CodeView.Font = new Font("Consolas", 8);
|
{
|
||||||
timeIntervall = 1000;
|
StepProgramm();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cmd_Start_Click(object sender, EventArgs e)
|
private void programmÖffnenToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
timer1.Interval = timeIntervall; // 1 Sekunde
|
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||||
timer1.Enabled = true;
|
{
|
||||||
}
|
string datei = File.ReadAllText(openFileDialog1.FileName);
|
||||||
|
|
||||||
private void cmd_next_Click(object sender, EventArgs e)
|
box_CodeView.Text = datei;
|
||||||
|
|
||||||
{
|
programm = new PICProgramm();
|
||||||
// MessageBox.Show("Array laenge übergeben:" + ArrayLaenge);
|
programm.Laden(datei);
|
||||||
if (PCounter == ArrayLaenge) { MessageBox.Show("Programm ist komplett durchlaufen!"); }
|
}
|
||||||
else {
|
}
|
||||||
PCounter = PCounter + 1;
|
|
||||||
try
|
private void cmdOpenDoc_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//Zeilenmarkierung aufheben
|
string path = Path.GetTempFileName() + ".pdf";
|
||||||
highLightALine(box_CodeView, PCounter - 1, Color.White);
|
File.WriteAllBytes(path, Resources.DataSheet);
|
||||||
}
|
System.Diagnostics.Process.Start(path);
|
||||||
catch { }
|
}
|
||||||
//Counter im Label inkrementieren
|
|
||||||
int shownCounter = PCounter;
|
//Funktion um Zeile aktuell ausgeführte Zeile zu markieren
|
||||||
shownCounter++;
|
void Highlight(int line)
|
||||||
label3.Text = shownCounter.ToString();
|
{
|
||||||
}
|
int i1 = box_CodeView.GetFirstCharIndexFromLine(line);
|
||||||
//Aktuelle Zeile markieren
|
int i2 = box_CodeView.GetFirstCharIndexFromLine(line + 1);
|
||||||
highLightALine(box_CodeView, PCounter, Color.Green);
|
if (i2 < 0 || i1 < 0)
|
||||||
|
{
|
||||||
instEinlesen.readExecCode(PCounter);
|
box_CodeView.SelectionColor = Color.Transparent;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
private int getPCounter() {
|
{
|
||||||
return PCounter;
|
box_CodeView.SelectionStart = i1;
|
||||||
}
|
box_CodeView.SelectionLength = i2 - i1;
|
||||||
|
box_CodeView.SelectionBackColor = Color.SteelBlue;
|
||||||
private void programmÖffnenToolStripMenuItem_Click(object sender, EventArgs e)
|
}
|
||||||
{
|
}
|
||||||
// Datei über openFileDialog1 Auswählen und in Anzeige öffnen
|
|
||||||
FileStream fs;
|
private void cmd_reset_Click(object sender, EventArgs e)
|
||||||
StreamReader sr;
|
{
|
||||||
string zeile;
|
//TODO
|
||||||
|
}
|
||||||
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
|
||||||
{
|
private void beendenToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
sr = new
|
{
|
||||||
StreamReader(openFileDialog1.FileName);
|
this.Close();
|
||||||
DialogResult = MessageBox.Show(sr.ReadToEnd(), "Programm Vorschau", MessageBoxButtons.OKCancel);
|
}
|
||||||
sr.Close();
|
|
||||||
// Abfrage von Ergebnis des Dialogs, wenn ja Datei laden
|
private void timer1_Tick(object sender, EventArgs e)
|
||||||
if (DialogResult == DialogResult.OK)
|
{
|
||||||
{
|
StepProgramm();
|
||||||
fs = new FileStream(openFileDialog1.FileName, FileMode.Open);
|
}
|
||||||
sr = new StreamReader(fs);
|
|
||||||
|
private void cmd_Stop_Click(object sender, EventArgs e)
|
||||||
while (sr.Peek() != -1)
|
{
|
||||||
{
|
quartztimer.Stop();
|
||||||
zeile = sr.ReadLine();
|
}
|
||||||
box_CodeView.Text += zeile + "\n";
|
|
||||||
}
|
private void StepProgramm()
|
||||||
sr.Close();
|
{
|
||||||
lbl_path.Text = openFileDialog1.FileName;
|
bool finished = programm.Step();
|
||||||
|
|
||||||
// StreamReader jede Zeile in Listenelement schreiben über Funktionsaufruf in der Klasse Einlesen
|
if (finished) { quartztimer.Stop(); return; }
|
||||||
|
|
||||||
ArrayLaenge = instEinlesen.writeToArray(sr = new StreamReader(openFileDialog1.FileName));
|
Highlight(programm.befehle[programm.PCCounter].zeilennummer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void cmdOpenDoc_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string path = Application.StartupPath;
|
|
||||||
MessageBox.Show( path);
|
|
||||||
System.Diagnostics.Process.Start(@"C:\Users\nicol\Desktop\Projekte\PIC_Simulator\Projektinformationen\DataSheet.pdf");
|
|
||||||
}
|
|
||||||
|
|
||||||
//Funktion um Zeile aktuell ausgeführte Zeile zu markieren
|
|
||||||
void highLightALine(RichTextBox rtb, int line, Color hiLight)
|
|
||||||
{
|
|
||||||
int i1 = rtb.GetFirstCharIndexFromLine(line);
|
|
||||||
int i2 = rtb.GetFirstCharIndexFromLine(line + 1);
|
|
||||||
if (i2 < 0) i2 = rtb.Text.Length;
|
|
||||||
|
|
||||||
rtb.SelectionStart = i1;
|
|
||||||
rtb.SelectionLength = i2 - i1;
|
|
||||||
rtb.SelectionBackColor = hiLight;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cmdSetClock_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
timeIntervall = Convert.ToInt32(insertTime.Text);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cmd_reset_Click(object sender, EventArgs e)
|
|
||||||
{ //######################### Muss ergänzt und getestet werden !!!
|
|
||||||
// Hier müssen alle Werte wieder auf den Standard gesetzt werden!
|
|
||||||
highLightALine(box_CodeView, PCounter, Color.White);
|
|
||||||
PCounter = -1;
|
|
||||||
label3.Text = PCounter.ToString();
|
|
||||||
//######################### Muss ergänzt und getestet werden !!!
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void buildtbl_Register() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void beendenToolStripMenuItem_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void timer1_Tick(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Einlesen QuarzExec = new Einlesen();
|
|
||||||
|
|
||||||
PCounter = PCounter + 1;
|
|
||||||
label3.Text = PCounter.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cmd_Stop_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
timer1.Enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -1,132 +1,132 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:choice maxOccurs="unbounded">
|
<xsd:choice maxOccurs="unbounded">
|
||||||
<xsd:element name="metadata">
|
<xsd:element name="metadata">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="assembly">
|
<xsd:element name="assembly">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="data">
|
<xsd:element name="data">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="resheader">
|
<xsd:element name="resheader">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:choice>
|
</xsd:choice>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:schema>
|
</xsd:schema>
|
||||||
<resheader name="resmimetype">
|
<resheader name="resmimetype">
|
||||||
<value>text/microsoft-resx</value>
|
<value>text/microsoft-resx</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="version">
|
<resheader name="version">
|
||||||
<value>2.0</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<resheader name="reader">
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<metadata name="box_CodeView.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="box_CodeView.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>211, 17</value>
|
<value>211, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>367, 17</value>
|
<value>367, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
</root>
|
</root>
|
646
PIC_Simulator/PIC/PICProgramm.cs
Normal file
646
PIC_Simulator/PIC/PICProgramm.cs
Normal file
@ -0,0 +1,646 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace PIC_Simulator.PIC
|
||||||
|
{
|
||||||
|
class PICBefehl
|
||||||
|
{
|
||||||
|
public string befehl;
|
||||||
|
public uint parameter_d;
|
||||||
|
public uint parameter_f;
|
||||||
|
public uint parameter_x;
|
||||||
|
public uint parameter_k;
|
||||||
|
public uint parameter_b;
|
||||||
|
|
||||||
|
public int zeilennummer;
|
||||||
|
}
|
||||||
|
|
||||||
|
class PICProgramm
|
||||||
|
{
|
||||||
|
public const uint ADDR_INDF = 0x00;
|
||||||
|
public const uint ADDR_TMR0 = 0x01;
|
||||||
|
public const uint ADDR_PCL = 0x02;
|
||||||
|
public const uint ADDR_STATUS = 0x03;
|
||||||
|
public const uint ADDR_FSR = 0x04;
|
||||||
|
public const uint ADDR_PORT_A = 0x05;
|
||||||
|
public const uint ADDR_PORT_B = 0x06;
|
||||||
|
public const uint ADDR_UNIMPL_A = 0x07;
|
||||||
|
public const uint ADDR_PCLATH = 0x0A;
|
||||||
|
public const uint ADDR_INTCON = 0x0B;
|
||||||
|
|
||||||
|
public const uint ADDR_OPTION = 0x81;
|
||||||
|
public const uint ADDR_TRIS_A = 0x85;
|
||||||
|
public const uint ADDR_TRIS_B = 0x86;
|
||||||
|
public const uint ADDR_UNIMPL_B = 0x87;
|
||||||
|
public const uint ADDR_EECON1 = 0x88;
|
||||||
|
public const uint ADDR_EECON2 = 0x89;
|
||||||
|
|
||||||
|
public const uint STATUS_BIT_IRP = 7; // Unused in PIC16C84
|
||||||
|
public const uint STATUS_BIT_RP1 = 6; // Register Bank Selection Bit [1] (Unused in PIC16C84)
|
||||||
|
public const uint STATUS_BIT_RP0 = 5; // Register Bank Selection Bit [0]
|
||||||
|
public const uint STATUS_BIT_TO = 4; // Time Out Bit
|
||||||
|
public const uint STATUS_BIT_PD = 3; // Power Down Bit
|
||||||
|
public const uint STATUS_BIT_Z = 2; // Zero Bit
|
||||||
|
public const uint STATUS_BIT_DC = 1; // Digit Carry Bit
|
||||||
|
public const uint STATUS_BIT_C = 0; // Carry Bit
|
||||||
|
|
||||||
|
public const uint OPTION_BIT_RBPU = 7; // PORT-B Pull-Up Enable Bit
|
||||||
|
public const uint OPTION_BIT_INTEDG = 6; // Interrupt Edge Select Bit
|
||||||
|
public const uint OPTION_BIT_T0CS = 5; // TMR0 Clock Source Select Bit
|
||||||
|
public const uint OPTION_BIT_T0SE = 4; // TMR0 Source Edge Select Bit
|
||||||
|
public const uint OPTION_BIT_PSA = 3; // Prescaler Alignment Bit
|
||||||
|
public const uint OPTION_BIT_PS2 = 2; // Prescaler Rate Select Bit [2]
|
||||||
|
public const uint OPTION_BIT_PS1 = 1; // Prescaler Rate Select Bit [1]
|
||||||
|
public const uint OPTION_BIT_PS0 = 0; // Prescaler Rate Select Bit [0]
|
||||||
|
|
||||||
|
public const uint INTCON_BIT_GIE = 7; // Global Interrupt Enable Bit
|
||||||
|
public const uint INTCON_BIT_EEIE = 6; // EE Write Complete Interrupt Enable Bit
|
||||||
|
public const uint INTCON_BIT_T0IE = 5; // TMR0 Overflow Interrupt Enable Bit
|
||||||
|
public const uint INTCON_BIT_INTE = 4; // RB0/INT Interrupt Bit
|
||||||
|
public const uint INTCON_BIT_RBIE = 3; // RB Port Change Interrupt Enable Bit
|
||||||
|
public const uint INTCON_BIT_T0IF = 2; // TMR0 Overflow Interrupt Flag Bit
|
||||||
|
public const uint INTCON_BIT_INTF = 1; // RB0/INT Interrupt Flag Bit
|
||||||
|
public const uint INTCON_BIT_RBIF = 0; // RB Port Change Interrupt Flag Bit
|
||||||
|
|
||||||
|
|
||||||
|
public const string ADDWF = "000111dfffffff";
|
||||||
|
public const string ANDWF = "000101dfffffff";
|
||||||
|
public const string CLRF = "0000011fffffff";
|
||||||
|
public const string CLRW = "0000010xxxxxxx";
|
||||||
|
public const string COMF = "001001dfffffff";
|
||||||
|
public const string DECF = "000011dfffffff";
|
||||||
|
public const string DECFSZ = "001011dfffffff";
|
||||||
|
public const string INCF = "001010dfffffff";
|
||||||
|
public const string INCFSZ = "001111dfffffff";
|
||||||
|
public const string IORWF = "000100dfffffff";
|
||||||
|
public const string MOVF = "001000dfffffff";
|
||||||
|
public const string MOVWF = "0000001fffffff";
|
||||||
|
public const string NOP = "0000000xx00000";
|
||||||
|
public const string RLF = "001101dfffffff";
|
||||||
|
public const string RRF = "001100dfffffff";
|
||||||
|
public const string SUBWF = "000010dfffffff";
|
||||||
|
public const string SWAPF = "001110dfffffff";
|
||||||
|
public const string XORWF = "000110dfffffff";
|
||||||
|
|
||||||
|
public const string BCF = "0100bbbfffffff";
|
||||||
|
public const string BSF = "0101bbbfffffff";
|
||||||
|
public const string BTFSC = "0110bbbfffffff";
|
||||||
|
public const string BTFSS = "0111bbbfffffff";
|
||||||
|
|
||||||
|
public const string ADDLW = "11111xkkkkkkkk";
|
||||||
|
public const string ANDLW = "111001kkkkkkkk";
|
||||||
|
public const string CALL = "100kkkkkkkkkkk";
|
||||||
|
public const string CLRWDT = "00000001100100";
|
||||||
|
public const string GOTO = "101kkkkkkkkkkk";
|
||||||
|
public const string IORLW = "111000kkkkkkkk";
|
||||||
|
public const string MOVLW = "1100xxkkkkkkkk";
|
||||||
|
public const string RETFIE = "00000000001001";
|
||||||
|
public const string RETLW = "1101xxkkkkkkkk";
|
||||||
|
public const string RETURN = "00000000001000";
|
||||||
|
public const string SLEEP = "00000001100011";
|
||||||
|
public const string SUBLW = "11110xkkkkkkkk";
|
||||||
|
public const string XORLW = "111010kkkkkkkk";
|
||||||
|
|
||||||
|
public string[] ALL_COMMANDS = {ADDWF, ANDWF, CLRF, CLRW, COMF, DECF, DECFSZ, INCF, INCFSZ, IORWF, MOVF, MOVWF, NOP, RLF, RRF, SUBWF, SWAPF, XORWF, BCF, BSF, BTFSC, BTFSS, ADDLW, ANDLW, CALL, CLRWDT, GOTO, IORLW, MOVLW, RETFIE, RETLW, RETURN, SLEEP, SUBLW, XORLW };
|
||||||
|
|
||||||
|
public List<PICBefehl> befehle;
|
||||||
|
|
||||||
|
public int PCCounter = 0; // -> nächster befehl
|
||||||
|
public uint Register_W = 0;
|
||||||
|
public uint[] Register = new uint[0x100];
|
||||||
|
|
||||||
|
|
||||||
|
public PICProgramm()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Laden(string code)
|
||||||
|
{
|
||||||
|
befehle = new List<PICBefehl>();
|
||||||
|
|
||||||
|
int zn = 0;
|
||||||
|
foreach (var zeile in Regex.Split(code, @"\r?\n"))
|
||||||
|
{
|
||||||
|
zn++;
|
||||||
|
|
||||||
|
if (zeile.StartsWith(" ")) continue;
|
||||||
|
if (zeile.Length < 10) continue;
|
||||||
|
|
||||||
|
befehle.Add(FindeBefehl(zeile, zn));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private PICBefehl FindeBefehl(string zeile, int zeilennummer)
|
||||||
|
{
|
||||||
|
foreach (var cmd in ALL_COMMANDS)
|
||||||
|
{
|
||||||
|
string bin = hex2binary(zeile.Substring(5, 4));
|
||||||
|
|
||||||
|
uint p_d = 0;
|
||||||
|
uint p_f = 0;
|
||||||
|
uint p_x = 0;
|
||||||
|
uint p_k = 0;
|
||||||
|
uint p_b = 0;
|
||||||
|
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
for (int i = 0; i < 14; i++)
|
||||||
|
{
|
||||||
|
if (cmd[i] == '0' && bin[i] == '0') continue;
|
||||||
|
if (cmd[i] == '1' && bin[i] == '1') continue;
|
||||||
|
if (cmd[i] == 'd' && bin[i] == '0') { p_d <<= 1; p_d |= 0; continue; }
|
||||||
|
if (cmd[i] == 'd' && bin[i] == '1') { p_d <<= 1; p_d |= 1; continue; }
|
||||||
|
if (cmd[i] == 'f' && bin[i] == '0') { p_f <<= 1; p_f |= 0; continue; }
|
||||||
|
if (cmd[i] == 'f' && bin[i] == '1') { p_f <<= 1; p_f |= 1; continue; }
|
||||||
|
if (cmd[i] == 'x' && bin[i] == '0') { p_x <<= 1; p_x |= 0; continue; }
|
||||||
|
if (cmd[i] == 'x' && bin[i] == '1') { p_x <<= 1; p_x |= 1; continue; }
|
||||||
|
if (cmd[i] == 'k' && bin[i] == '0') { p_k <<= 1; p_k |= 0; continue; }
|
||||||
|
if (cmd[i] == 'k' && bin[i] == '1') { p_k <<= 1; p_k |= 1; continue; }
|
||||||
|
if (cmd[i] == 'b' && bin[i] == '0') { p_b <<= 1; p_b |= 0; continue; }
|
||||||
|
if (cmd[i] == 'b' && bin[i] == '1') { p_b <<= 1; p_b |= 1; continue; }
|
||||||
|
if (cmd[i] == '0' && bin[i] == '1') { ok = false; break; }
|
||||||
|
if (cmd[i] == '1' && bin[i] == '0') { ok = false; continue; }
|
||||||
|
|
||||||
|
throw new Exception("Falscher wert in cmd");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
PICBefehl b = new PICBefehl();
|
||||||
|
b.befehl = cmd;
|
||||||
|
b.parameter_d = p_d;
|
||||||
|
b.parameter_f = p_f;
|
||||||
|
b.parameter_k = p_k;
|
||||||
|
b.parameter_x = p_x;
|
||||||
|
b.parameter_b = p_b;
|
||||||
|
b.zeilennummer = zeilennummer;
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Exception("konnte befehl nicht finden: " + zeile);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string hex2binary(string hexvalue)
|
||||||
|
{
|
||||||
|
string binaryval = "";
|
||||||
|
binaryval = Convert.ToString(Convert.ToInt32(hexvalue, 16), 2).PadLeft(14, '0');
|
||||||
|
return binaryval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Step()
|
||||||
|
{
|
||||||
|
if (PCCounter >= befehle.Count) return true;
|
||||||
|
|
||||||
|
PICBefehl aktueller_befehl = befehle[PCCounter];
|
||||||
|
|
||||||
|
if (aktueller_befehl.befehl == ADDWF)
|
||||||
|
{
|
||||||
|
uint a = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
uint b = Register_W;
|
||||||
|
|
||||||
|
uint Result = a + b;
|
||||||
|
bool dc = AdditionDigitCarry(a, b);
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, (Result % 0x100) == 0);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_DC, dc);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_C, Result > 0xFF);
|
||||||
|
|
||||||
|
Result %= 0x100;
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == ANDWF)
|
||||||
|
{
|
||||||
|
uint Result = Register_W & GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == CLRF)
|
||||||
|
{
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, 0x00);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, true);
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == CLRW)
|
||||||
|
{
|
||||||
|
Register_W = 0;
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, true);
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == COMF)
|
||||||
|
{
|
||||||
|
uint Result = ~GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == DECF)
|
||||||
|
{
|
||||||
|
uint Result = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
if (Result == 0)
|
||||||
|
Result = 0xFF;
|
||||||
|
else
|
||||||
|
Result -= 1;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == DECFSZ)
|
||||||
|
{
|
||||||
|
bool Cond = GetRegister(aktueller_befehl.parameter_f) == 1;
|
||||||
|
|
||||||
|
uint Result = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
if (Result == 0)
|
||||||
|
Result = 0xFF;
|
||||||
|
else
|
||||||
|
Result -= 1;
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
|
||||||
|
if (Cond)
|
||||||
|
{
|
||||||
|
PCCounter++; // skip next
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == INCF)
|
||||||
|
{
|
||||||
|
uint Result = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
Result += 1;
|
||||||
|
|
||||||
|
Result %= 0x100;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == INCFSZ)
|
||||||
|
{
|
||||||
|
bool Cond = GetRegister(aktueller_befehl.parameter_f) == 0xFF;
|
||||||
|
|
||||||
|
uint Result = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
Result += 1;
|
||||||
|
|
||||||
|
Result %= 0x100;
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
|
||||||
|
if (Cond)
|
||||||
|
{
|
||||||
|
PCCounter++; // skip next
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == IORWF)
|
||||||
|
{
|
||||||
|
uint Result = Register_W | GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == MOVF)
|
||||||
|
{
|
||||||
|
uint Result = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == MOVWF)
|
||||||
|
{
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Register_W);
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == NOP)
|
||||||
|
{
|
||||||
|
// ~~~~~
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == RLF)
|
||||||
|
{
|
||||||
|
uint Result = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
uint Carry_Old = GetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_C) ? 1u : 0u;
|
||||||
|
uint Carry_New = (Result & 0x80) >> 7;
|
||||||
|
|
||||||
|
Result = Result << 1;
|
||||||
|
Result &= 0xFF;
|
||||||
|
|
||||||
|
Result |= Carry_Old;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_C, Carry_New != 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == RRF)
|
||||||
|
{
|
||||||
|
uint Result = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
uint Carry_Old = GetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_C) ? 0x80u : 0x00u;
|
||||||
|
uint Carry_New = Result & 0x01;
|
||||||
|
|
||||||
|
Result = Result >> 1;
|
||||||
|
Result &= 0xFF;
|
||||||
|
|
||||||
|
Result |= Carry_Old;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_C, Carry_New != 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == SUBWF)
|
||||||
|
{
|
||||||
|
uint a = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
uint b = Register_W;
|
||||||
|
|
||||||
|
bool carry;
|
||||||
|
|
||||||
|
bool dc = SubtractionDigitCarry(a, b);
|
||||||
|
|
||||||
|
if (carry = a < b)
|
||||||
|
{
|
||||||
|
a += 0x100;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint Result = a - b;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, (Result % 0x100) == 0);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_DC, dc);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_C, !carry);
|
||||||
|
|
||||||
|
Result %= 0x100;
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == SWAPF)
|
||||||
|
{
|
||||||
|
uint Result = GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
uint Low = Result & 0x0F;
|
||||||
|
uint High = Result & 0xF0;
|
||||||
|
|
||||||
|
Result = (Low << 4) | (High >> 4);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == XORWF)
|
||||||
|
{
|
||||||
|
uint Result = Register_W ^ GetRegister(aktueller_befehl.parameter_f);
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
if (aktueller_befehl.parameter_d != 0)
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, Result);
|
||||||
|
else
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == BCF)
|
||||||
|
{
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, aktueller_befehl.parameter_b, false);
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == BSF)
|
||||||
|
{
|
||||||
|
SetRegister(aktueller_befehl.parameter_f, aktueller_befehl.parameter_b, true);
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == BTFSC)
|
||||||
|
{
|
||||||
|
if (!GetBit(GetRegister(aktueller_befehl.parameter_f), aktueller_befehl.parameter_b))
|
||||||
|
{
|
||||||
|
PCCounter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == BTFSS)
|
||||||
|
{
|
||||||
|
if (GetBit(GetRegister(aktueller_befehl.parameter_f), aktueller_befehl.parameter_b))
|
||||||
|
{
|
||||||
|
PCCounter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == ADDLW)
|
||||||
|
{
|
||||||
|
uint a = Register_W;
|
||||||
|
uint b = aktueller_befehl.parameter_k;
|
||||||
|
|
||||||
|
uint Result = a + b;
|
||||||
|
bool dc = AdditionDigitCarry(a, b);
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, (Result % 0x100) == 0);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_DC, dc);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_C, Result > 0xFF);
|
||||||
|
|
||||||
|
Result %= 0x100;
|
||||||
|
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == ANDLW)
|
||||||
|
{
|
||||||
|
uint Result = Register_W & aktueller_befehl.parameter_k;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == CALL)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == CLRWDT)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == GOTO)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == IORLW)
|
||||||
|
{
|
||||||
|
uint Result = Register_W | aktueller_befehl.parameter_k;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == MOVLW)
|
||||||
|
{
|
||||||
|
Register_W = aktueller_befehl.parameter_k;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == RETFIE)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == RETLW)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == RETURN)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == SLEEP)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == SUBLW)
|
||||||
|
{
|
||||||
|
uint a = aktueller_befehl.parameter_k;
|
||||||
|
uint b = Register_W;
|
||||||
|
|
||||||
|
bool carry;
|
||||||
|
|
||||||
|
bool dc = SubtractionDigitCarry(a, b);
|
||||||
|
|
||||||
|
if (carry = a < b)
|
||||||
|
{
|
||||||
|
a += 0x100;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint Result = a - b;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, (Result % 0x100) == 0);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_DC, dc);
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_C, !carry);
|
||||||
|
|
||||||
|
Result %= 0x100;
|
||||||
|
|
||||||
|
Register_W = Result;
|
||||||
|
}
|
||||||
|
else if (aktueller_befehl.befehl == XORLW)
|
||||||
|
{
|
||||||
|
uint Result = Register_W ^ aktueller_befehl.parameter_k;
|
||||||
|
|
||||||
|
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_Z, Result == 0);
|
||||||
|
|
||||||
|
Register_W = Result; ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private uint GetRegister(uint index)
|
||||||
|
{
|
||||||
|
if ((Register[ADDR_STATUS] & STATUS_BIT_RP0) == STATUS_BIT_RP0)
|
||||||
|
{
|
||||||
|
return Register[0x80 + index];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Register[index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetRegister(uint index, uint wert)
|
||||||
|
{
|
||||||
|
if ((Register[ADDR_STATUS] & STATUS_BIT_RP0) == STATUS_BIT_RP0)
|
||||||
|
{
|
||||||
|
Register[0x80 + index] = wert;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Register[index] = wert;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetRegister(uint index, uint bit, bool wert)
|
||||||
|
{
|
||||||
|
if ((Register[ADDR_STATUS] & STATUS_BIT_RP0) == STATUS_BIT_RP0)
|
||||||
|
{
|
||||||
|
Register[0x80 + index] = SetBit(Register[index], bit, wert);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Register[index] = SetBit(Register[index], bit, wert);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetRegisterOhneBank(uint index, uint bit, bool wert)
|
||||||
|
{
|
||||||
|
Register[index] = SetBit(Register[index], bit, wert);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool GetRegisterOhneBank(uint index, uint bit)
|
||||||
|
{
|
||||||
|
return GetBit(Register[index], bit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool AdditionDigitCarry(uint a, uint b)
|
||||||
|
{
|
||||||
|
a &= 0x0F;
|
||||||
|
b &= 0x0F;
|
||||||
|
|
||||||
|
return (a + b) > 0x0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool SubtractionDigitCarry(uint a, uint b)
|
||||||
|
{
|
||||||
|
b = (~b) + 1;
|
||||||
|
|
||||||
|
return AdditionDigitCarry(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool GetBit(uint val, uint pos)
|
||||||
|
{
|
||||||
|
return (val & SHL(1, pos)) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint SHL(uint val, uint steps)
|
||||||
|
{
|
||||||
|
return (uint)((val) << ((int)steps));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint SHR(uint val, uint steps)
|
||||||
|
{
|
||||||
|
return (uint)((val) >> ((int)steps));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint SetBit(uint val, uint pos, bool bit)
|
||||||
|
{
|
||||||
|
return bit ? (val | SHL(1, pos)) : (val & ~SHL(1, pos));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,85 +1,89 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{61AE0011-89B1-46B3-B2EA-E0949BD27605}</ProjectGuid>
|
<ProjectGuid>{61AE0011-89B1-46B3-B2EA-E0949BD27605}</ProjectGuid>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<RootNamespace>PIC_Simulator</RootNamespace>
|
<RootNamespace>PIC_Simulator</RootNamespace>
|
||||||
<AssemblyName>PIC_Simulator</AssemblyName>
|
<AssemblyName>PIC_Simulator</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Deployment" />
|
<Reference Include="System.Deployment" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Befehlssatz.cs" />
|
<Compile Include="Form1.cs">
|
||||||
<Compile Include="Einlesen.cs" />
|
<SubType>Form</SubType>
|
||||||
<Compile Include="Form1.cs">
|
</Compile>
|
||||||
<SubType>Form</SubType>
|
<Compile Include="Form1.Designer.cs">
|
||||||
</Compile>
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
<Compile Include="Form1.Designer.cs">
|
</Compile>
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
<Compile Include="PIC\PICProgramm.cs" />
|
||||||
</Compile>
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<EmbeddedResource Include="Form1.resx">
|
||||||
<Compile Include="Register.cs" />
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
<EmbeddedResource Include="Form1.resx">
|
</EmbeddedResource>
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
</EmbeddedResource>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<SubType>Designer</SubType>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
</EmbeddedResource>
|
||||||
<SubType>Designer</SubType>
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
</EmbeddedResource>
|
<AutoGen>True</AutoGen>
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<AutoGen>True</AutoGen>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
</Compile>
|
||||||
</Compile>
|
<None Include="Properties\Settings.settings">
|
||||||
<None Include="Properties\Settings.settings">
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
</None>
|
||||||
</None>
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
<AutoGen>True</AutoGen>
|
||||||
<AutoGen>True</AutoGen>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
</Compile>
|
||||||
</Compile>
|
<None Include="Resources\DataSheet.pdf" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<ItemGroup>
|
||||||
|
<None Include="Resources\TPicSim1.LST" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
@ -1,27 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Windows.Forms;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
namespace PIC_Simulator
|
||||||
using System.Windows.Forms;
|
{
|
||||||
using System.IO;
|
static class Program
|
||||||
|
{
|
||||||
namespace PIC_Simulator
|
[STAThread]
|
||||||
{
|
static void Main()
|
||||||
static class Program
|
{
|
||||||
{
|
Application.EnableVisualStyles();
|
||||||
/// <summary>
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
Application.Run(new Form1());
|
||||||
/// </summary>
|
}
|
||||||
[STAThread]
|
}
|
||||||
static void Main()
|
}
|
||||||
{
|
|
||||||
Application.EnableVisualStyles();
|
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
|
||||||
Application.Run(new Form1());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||||
// die einer Assembly zugeordnet sind.
|
// die einer Assembly zugeordnet sind.
|
||||||
[assembly: AssemblyTitle("PIC_Simulator")]
|
[assembly: AssemblyTitle("PIC_Simulator")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("PIC_Simulator")]
|
[assembly: AssemblyProduct("PIC_Simulator")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||||
[assembly: Guid("61ae0011-89b1-46b3-b2ea-e0949bd27605")]
|
[assembly: Guid("61ae0011-89b1-46b3-b2ea-e0949bd27605")]
|
||||||
|
|
||||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||||
//
|
//
|
||||||
// Hauptversion
|
// Hauptversion
|
||||||
// Nebenversion
|
// Nebenversion
|
||||||
// Buildnummer
|
// Buildnummer
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||||
// übernehmen, indem Sie "*" eingeben:
|
// übernehmen, indem Sie "*" eingeben:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
161
PIC_Simulator/Properties/Resources.Designer.cs
generated
161
PIC_Simulator/Properties/Resources.Designer.cs
generated
@ -1,71 +1,90 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// Dieser Code wurde von einem Tool generiert.
|
// This code was generated by a tool.
|
||||||
// Laufzeitversion: 4.0.30319.42000
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// der Code neu generiert wird.
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace PIC_Simulator.Properties
|
namespace PIC_Simulator.Properties {
|
||||||
{
|
using System;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
// über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources
|
internal class Resources {
|
||||||
{
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
internal Resources() {
|
||||||
internal Resources()
|
}
|
||||||
{
|
|
||||||
}
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
/// </summary>
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
get {
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
{
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PIC_Simulator.Properties.Resources", typeof(Resources).Assembly);
|
||||||
get
|
resourceMan = temp;
|
||||||
{
|
}
|
||||||
if ((resourceMan == null))
|
return resourceMan;
|
||||||
{
|
}
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PIC_Simulator.Properties.Resources", typeof(Resources).Assembly);
|
}
|
||||||
resourceMan = temp;
|
|
||||||
}
|
/// <summary>
|
||||||
return resourceMan;
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
}
|
/// resource lookups using this strongly typed resource class.
|
||||||
}
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
/// <summary>
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
get {
|
||||||
/// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
|
return resourceCulture;
|
||||||
/// </summary>
|
}
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
set {
|
||||||
internal static global::System.Globalization.CultureInfo Culture
|
resourceCulture = value;
|
||||||
{
|
}
|
||||||
get
|
}
|
||||||
{
|
|
||||||
return resourceCulture;
|
/// <summary>
|
||||||
}
|
/// Looks up a localized resource of type System.Byte[].
|
||||||
set
|
/// </summary>
|
||||||
{
|
internal static byte[] DataSheet {
|
||||||
resourceCulture = value;
|
get {
|
||||||
}
|
object obj = ResourceManager.GetObject("DataSheet", resourceCulture);
|
||||||
}
|
return ((byte[])(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to 00001 ;TPicSim1
|
||||||
|
/// 00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
|
/// 00003 ;Es werden alle Literal-Befehle geprüft
|
||||||
|
/// 00004 ;(c) St. Lehmann
|
||||||
|
/// 00005 ;Ersterstellung: 23.03.2016
|
||||||
|
/// 00006 ;
|
||||||
|
/// 00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
|
/// 00008
|
||||||
|
/// [rest of string was truncated]";.
|
||||||
|
/// </summary>
|
||||||
|
internal static string TPicSim1 {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TPicSim1", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,117 +1,127 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:complexType>
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:choice maxOccurs="unbounded">
|
<xsd:complexType>
|
||||||
<xsd:element name="metadata">
|
<xsd:choice maxOccurs="unbounded">
|
||||||
<xsd:complexType>
|
<xsd:element name="metadata">
|
||||||
<xsd:sequence>
|
<xsd:complexType>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
<xsd:sequence>
|
||||||
</xsd:sequence>
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
</xsd:sequence>
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
</xsd:complexType>
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
</xsd:element>
|
<xsd:attribute ref="xml:space" />
|
||||||
<xsd:element name="assembly">
|
</xsd:complexType>
|
||||||
<xsd:complexType>
|
</xsd:element>
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
<xsd:element name="assembly">
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
<xsd:complexType>
|
||||||
</xsd:complexType>
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
</xsd:element>
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
<xsd:element name="data">
|
</xsd:complexType>
|
||||||
<xsd:complexType>
|
</xsd:element>
|
||||||
<xsd:sequence>
|
<xsd:element name="data">
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:complexType>
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
<xsd:sequence>
|
||||||
</xsd:sequence>
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
</xsd:sequence>
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
</xsd:complexType>
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
</xsd:element>
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
<xsd:element name="resheader">
|
<xsd:attribute ref="xml:space" />
|
||||||
<xsd:complexType>
|
</xsd:complexType>
|
||||||
<xsd:sequence>
|
</xsd:element>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="resheader">
|
||||||
</xsd:sequence>
|
<xsd:complexType>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
<xsd:sequence>
|
||||||
</xsd:complexType>
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
</xsd:element>
|
</xsd:sequence>
|
||||||
</xsd:choice>
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:schema>
|
</xsd:choice>
|
||||||
<resheader name="resmimetype">
|
</xsd:complexType>
|
||||||
<value>text/microsoft-resx</value>
|
</xsd:element>
|
||||||
</resheader>
|
</xsd:schema>
|
||||||
<resheader name="version">
|
<resheader name="resmimetype">
|
||||||
<value>2.0</value>
|
<value>text/microsoft-resx</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<resheader name="version">
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="writer">
|
<resheader name="reader">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="DataSheet" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\DataSheet.pdf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name="TPicSim1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\TPicSim1.LST;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
60
PIC_Simulator/Properties/Settings.Designer.cs
generated
60
PIC_Simulator/Properties/Settings.Designer.cs
generated
@ -1,30 +1,30 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.42000
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace PIC_Simulator.Properties
|
namespace PIC_Simulator.Properties
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
{
|
{
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
public static Settings Default
|
public static Settings Default
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
<Profiles>
|
<Profiles>
|
||||||
<Profile Name="(Default)" />
|
<Profile Name="(Default)" />
|
||||||
</Profiles>
|
</Profiles>
|
||||||
<Settings />
|
<Settings />
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
|
@ -1,357 +0,0 @@
|
|||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace PIC_Simulator
|
|
||||||
{
|
|
||||||
class Register
|
|
||||||
{
|
|
||||||
// Speicherarray anlegen:
|
|
||||||
List<int[]> arrMemList = new List<int[]>();
|
|
||||||
|
|
||||||
// BANK 0 definieren
|
|
||||||
byte BANK0_INDF = 0x0; //0000 0000
|
|
||||||
byte BANK0_TMR0 = 0x0; //0000 0000
|
|
||||||
byte BANK0_PCL = 0x0; //0000 0000
|
|
||||||
byte BANK0_STATUS = 0x18; //0001 1000
|
|
||||||
byte BANK0_FSR = 0x0; //0000 0000
|
|
||||||
byte BANK0_PORTA = 0x0; //0000 0000
|
|
||||||
byte BANK0_PORTB = 0x0; //0000 0000
|
|
||||||
byte BANK0_EEDATA = 0x0; //0000 0000
|
|
||||||
byte BANK0_EEADR = 0x0; //0000 0000
|
|
||||||
|
|
||||||
|
|
||||||
// BANK 1 definieren
|
|
||||||
byte BANK1_INDF = 0x0; //0000 0000
|
|
||||||
byte BANK1_OPTION_REG = 0xFF; //1111 1111
|
|
||||||
byte BANK1_PCL = 0x0; //0000 0000
|
|
||||||
byte BANK1_STATUS = 0x18; //0001 1000
|
|
||||||
byte BANK1_FSR = 0x0; //0000 0000
|
|
||||||
byte BANK1_TRISA = 0x1F; //0001 1111
|
|
||||||
byte BANK1_TRISB = 0xFF; //1111 1111
|
|
||||||
byte BANK1_EECON1 = 0x0; //0000 0000
|
|
||||||
byte BANK1_EECON2 = 0x0; //0000 0000
|
|
||||||
|
|
||||||
// Gemeinsam genutzte Register
|
|
||||||
byte BANK_PCLATH = 0x0; //0000 0000
|
|
||||||
byte BANK_INTCON = 0x0; //0000 0000
|
|
||||||
|
|
||||||
|
|
||||||
//############## PIC COMMANDS BINARY #############################
|
|
||||||
// --- Bit-Oriented File Register Operations ---
|
|
||||||
public string BCF = "0100"; // 4 Stellen zum Vergleichen
|
|
||||||
public string BSF = "0101";
|
|
||||||
public string BTFSC = "0110";
|
|
||||||
public string BTFSS = "0111";
|
|
||||||
|
|
||||||
//--- Byte-Oriented File Register Operations ---
|
|
||||||
public string ADDWF = "000111"; //6 Stellen zum Vergleichen
|
|
||||||
public string ANDWF = "000101"; //6
|
|
||||||
public string COMF = "001001"; //6
|
|
||||||
public string DECF = "000011"; //6
|
|
||||||
public string DECFSZ = "001011"; //6
|
|
||||||
public string INCF = "001010"; //6
|
|
||||||
public string INCFSZ = "001111"; //6
|
|
||||||
public string IORWF = "000100"; //6
|
|
||||||
public string MOVF = "001000"; //6
|
|
||||||
public string RLF = "001101"; //6
|
|
||||||
public string RRF = "001100"; //6
|
|
||||||
public string SUBWF = "000010"; //6
|
|
||||||
public string SWAPF = "001110"; //6
|
|
||||||
public string XORWF = "000110"; //6
|
|
||||||
|
|
||||||
public string CLRF = "0000011"; //7 Stellen zum Vergleichen
|
|
||||||
public string CLRW = "0000010"; //7
|
|
||||||
public string MOVWF = "0000001"; //7
|
|
||||||
|
|
||||||
public string NOP1 = "00000000000000"; //14 Stellen zum Vergleichen
|
|
||||||
public string NOP2 = "00000000100000"; //14
|
|
||||||
public string NOP3 = "00000001000000"; //14
|
|
||||||
public string NOP4 = "00000001100000"; //14
|
|
||||||
|
|
||||||
// --- Literal and Control Operations ---
|
|
||||||
public string CALL = "100"; //3 Stellen zum Vergleichen
|
|
||||||
public string GOTO = "101"; //3
|
|
||||||
|
|
||||||
public string MOVLW = "1100"; //4 Stellen zum Vergleichen
|
|
||||||
public string RETLW = "1101"; //4
|
|
||||||
|
|
||||||
public string SUBLW = "11110"; //5 Stellen zum Vergleichen
|
|
||||||
public string ADDLW = "11111"; //5
|
|
||||||
|
|
||||||
public string ANDLW = "111001"; //6 Stellen zum Vergleichen
|
|
||||||
public string IORLW = "111000"; //6
|
|
||||||
public string XORLW = "111010"; //6
|
|
||||||
|
|
||||||
public string CLRWDT = "00000001100100"; //14
|
|
||||||
public string RETFIE = "00000000001001"; //14
|
|
||||||
public string RETURN = "00000000001000"; //14
|
|
||||||
public string SLEEP = "00000001100011"; //14
|
|
||||||
//############## PIC COMMANDS BINARY #############################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Findet den auszuführenden Befehl
|
|
||||||
public void findOrder(string Order)
|
|
||||||
|
|
||||||
{
|
|
||||||
string OrderBinary;
|
|
||||||
string Reduced;
|
|
||||||
// Hex to Int Umrechnung Funktionsaufruf
|
|
||||||
OrderBinary = hex2binary(Order);
|
|
||||||
|
|
||||||
|
|
||||||
// 14 Zeichen
|
|
||||||
|
|
||||||
Reduced = OrderBinary;
|
|
||||||
if (Reduced.Equals(NOP1))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich NOP1" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(NOP2))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich NOP2" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(NOP3))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich NOP3" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(NOP4))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich NOP4" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(CLRWDT))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich CLRWDT" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(RETFIE))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich RETFIE" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(RETURN))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich RETURN" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(SLEEP))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich SLEEP" + Reduced);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{ // Reduzieren und Vergleich mit 7 Zeichen
|
|
||||||
Reduced = OrderBinary.Substring(0, 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
//7 Zeichen
|
|
||||||
if (Reduced.Equals(CLRF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich CLRF" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(CLRW))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich CLRW" + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(MOVWF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich MOVWF" + Reduced);
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
// Reduzieren und Vergleich mit 6 Zeichen
|
|
||||||
Reduced = OrderBinary.Substring(0, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 6 Zeichen
|
|
||||||
|
|
||||||
if (Reduced.Equals(ANDWF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich ANDWF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(COMF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich COMF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(DECF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich DECF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(DECFSZ))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich DECFSZ " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(INCF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich INCF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(INCFSZ))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich INCFSZ " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(IORWF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich IORWF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(MOVF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich MOVF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(RLF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich RLF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(RRF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich RRF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(SUBWF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich SUBWF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(SWAPF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich SWAPF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(XORWF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich XORWF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(ANDLW))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich ANDLW " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(IORLW))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich IORLW " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(XORLW))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich XORLW " + Reduced);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // Reduzieren und Vergleich mit 5 Zeichen
|
|
||||||
Reduced = OrderBinary.Substring(0, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 5 Zeichen
|
|
||||||
|
|
||||||
if (Reduced.Equals(SUBLW))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich SUBLW " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(ADDLW))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich ADDLW " + Reduced);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{ // Reduzieren und Vergleich mit 4 Zeichen
|
|
||||||
Reduced = OrderBinary.Substring(0, 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//4 Zeichen
|
|
||||||
|
|
||||||
if (Reduced.Equals(BCF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich BCF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(BSF))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich BSF " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(BTFSC))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich DBTFSC " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(BTFSS))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich BTFSS " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(MOVLW))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich MOVLW " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(RETLW))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich RETLW " + Reduced);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{// Reduzieren und Vergleich mit 3 Zeichen
|
|
||||||
Reduced = OrderBinary.Substring(0, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (Reduced.Equals(CALL))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich CALL " + Reduced);
|
|
||||||
}
|
|
||||||
else if (Reduced.Equals(GOTO))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Erfolgreich GOTO " + Reduced);
|
|
||||||
}
|
|
||||||
|
|
||||||
else { }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private string hex2binary(string hexvalue)
|
|
||||||
{
|
|
||||||
string binaryval = "";
|
|
||||||
binaryval = Convert.ToString(Convert.ToInt32(hexvalue, 16), 2).PadLeft(14,'0');
|
|
||||||
return binaryval;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void fillpicmemory()
|
|
||||||
{
|
|
||||||
int[] line1 = new int[8];
|
|
||||||
int[] line2 = new int[8];
|
|
||||||
int[] line3 = new int[8];
|
|
||||||
int[] line4 = new int[8];
|
|
||||||
int[] line5 = new int[8];
|
|
||||||
int[] line6 = new int[8];
|
|
||||||
int[] line7 = new int[8];
|
|
||||||
int[] line8 = new int[8];
|
|
||||||
int[] line9 = new int[8];
|
|
||||||
int[] line10 = new int[8];
|
|
||||||
int[] line11 = new int[8];
|
|
||||||
int[] line12 = new int[8];
|
|
||||||
int[] line13 = new int[8];
|
|
||||||
int[] line14 = new int[8];
|
|
||||||
int[] line15 = new int[8];
|
|
||||||
int[] line16 = new int[8];
|
|
||||||
int[] line17 = new int[8];
|
|
||||||
int[] line18 = new int[8];
|
|
||||||
int[] line19 = new int[8];
|
|
||||||
int[] line20 = new int[8];
|
|
||||||
int[] line21 = new int[8];
|
|
||||||
int[] line22 = new int[8];
|
|
||||||
int[] line23 = new int[8];
|
|
||||||
int[] line24 = new int[8];
|
|
||||||
int[] line25 = new int[8];
|
|
||||||
int[] line26 = new int[8];
|
|
||||||
int[] line27 = new int[8];
|
|
||||||
int[] line28 = new int[8];
|
|
||||||
int[] line29 = new int[8];
|
|
||||||
int[] line30 = new int[8];
|
|
||||||
int[] line31 = new int[8];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
BIN
PIC_Simulator/Resources/DataSheet.pdf
Normal file
BIN
PIC_Simulator/Resources/DataSheet.pdf
Normal file
Binary file not shown.
35
PIC_Simulator/Resources/TPicSim1.LST
Normal file
35
PIC_Simulator/Resources/TPicSim1.LST
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
00001 ;TPicSim1
|
||||||
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
|
00003 ;Es werden alle Literal-Befehle geprüft
|
||||||
|
00004 ;(c) St. Lehmann
|
||||||
|
00005 ;Ersterstellung: 23.03.2016
|
||||||
|
00006 ;
|
||||||
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
|
00008
|
||||||
|
00009 ;Definition einiger Symbole
|
||||||
|
00010 ;zuerst Hardware-Register
|
||||||
|
00011 status equ 03h
|
||||||
|
00012 ra equ 05h
|
||||||
|
00013 rb equ 06h
|
||||||
|
00014
|
||||||
|
00015 ;für den Benutzer frei verwendbare Register
|
||||||
|
00016 count equ 0ch
|
||||||
|
00017
|
||||||
|
00018 ;Definition des Prozessors
|
||||||
|
00019 device 16F84
|
||||||
|
00020
|
||||||
|
00021 ;Festlegen des Codebeginns
|
||||||
|
00022 org 0
|
||||||
|
00023 start
|
||||||
|
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unverändert
|
||||||
|
0001 3930 00025 andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
||||||
|
0002 380D 00026 iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
||||||
|
0003 3C3D 00027 sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
||||||
|
0004 3A20 00028 xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
||||||
|
0005 3E25 00029 addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
||||||
|
00030
|
||||||
|
00031
|
||||||
|
00032 ende
|
||||||
|
0006 2806 00033 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
|
00034
|
||||||
|
00035
|
@ -1,43 +1,42 @@
|
|||||||
--- Byte-Oriented File Register Operations ---
|
|
||||||
ADDWF | 6 | 00 0111 dfff ffff
|
public string ADDWF = "000111dfffffff";
|
||||||
ANDWF | 6 | 00 0101 dfff ffff
|
public string ANDWF = "000101dfffffff";
|
||||||
CLRF | 7 | 00 0001 1fff ffff
|
public string CLRF = "0000011fffffff";
|
||||||
CLRW | 7 | 00 0001 0xxx xxxx
|
public string CLRW = "0000010xxxxxxx";
|
||||||
COMF | 6 | 00 1001 dfff ffff
|
public string COMF = "001001dfffffff";
|
||||||
DECF | 6 | 00 0011 dfff ffff
|
public string DECF = "000011dfffffff";
|
||||||
DECFSZ | 6 | 00 1011 dfff ffff
|
public string DECFSZ = "001011dfffffff";
|
||||||
INCF | 6 | 00 1010 dfff ffff
|
public string INCF = "001010dfffffff";
|
||||||
INCFSZ | 6 | 00 1111 dfff ffff
|
public string INCFSZ = "001111dfffffff";
|
||||||
IORWF | 6 | 00 0100 dfff ffff
|
public string IORWF = "000100dfffffff";
|
||||||
MOVF | 6 | 00 1000 dfff ffff
|
public string MOVF = "001000dfffffff";
|
||||||
MOVWF | 7 | 00 0000 1fff ffff
|
public string MOVWF = "0000001fffffff";
|
||||||
NOP1 | 14 | 00 0000 0000 0000
|
public string NOP1 = "00000000000000";
|
||||||
NOP2 | 14 | 00 0000 0010 0000
|
public string NOP2 = "00000000100000";
|
||||||
NOP3 | 14 | 00 0000 0100 0000
|
public string NOP3 = "00000001000000";
|
||||||
NOP4 | 14 | 00 0000 0110 0000
|
public string NOP4 = "00000001100000";
|
||||||
RLF | 6 | 00 1101 dfff ffff
|
public string RLF = "001101dfffffff";
|
||||||
RRF | 6 | 00 1100 dfff ffff
|
public string RRF = "001100dfffffff";
|
||||||
SUBWF | 6 | 00 0010 dfff ffff
|
public string SUBWF = "000010dfffffff";
|
||||||
SWAPF | 6 | 00 1110 dfff ffff
|
public string SWAPF = "001110dfffffff";
|
||||||
XORWF | 6 | 00 0110 dfff ffff
|
public string XORWF = "000110dfffffff";
|
||||||
|
|
||||||
--- Bit-Oriented File Register Operations ---
|
public string BCF = "0100bbbfffffff";
|
||||||
BCF | 4 | 01 00bb bfff ffff
|
public string BSF = "0101bbbfffffff";
|
||||||
BSF | 4 | 01 01bb bfff ffff
|
public string BTFSC = "0110bbbfffffff";
|
||||||
BTFSC | 4 | 01 10bb bfff ffff
|
public string BTFSS = "0111bbbfffffff";
|
||||||
BTFSS | 4 | 01 11bb bfff ffff
|
|
||||||
|
public string ADDLW = "11111xkkkkkkkk";
|
||||||
--- Literal and Control Operations ---
|
public string ANDLW = "111001kkkkkkkk";
|
||||||
ADDLW | 5 | 11 111x kkkk kkkk
|
public string CALL = "100kkkkkkkkkkk";
|
||||||
ANDLW | 6 | 11 1001 kkkk kkkk
|
public string CLRWDT = "00000001100100";
|
||||||
CALL | 3 | 10 0kkk kkkk kkkk
|
public string GOTO = "101kkkkkkkkkkk";
|
||||||
CLRWDT | 14 | 00 0000 0110 0100
|
public string IORLW = "111000kkkkkkkk";
|
||||||
GOTO | 3 | 10 1kkk kkkk kkkk
|
public string MOVLW = "1100xxkkkkkkkk";
|
||||||
IORLW | 6 | 11 1000 kkkk kkkk
|
public string RETFIE = "00000000001001";
|
||||||
MOVLW | 4 | 11 00xx kkkk kkkk
|
public string RETLW = "1101xxkkkkkkkk";
|
||||||
RETFIE | 14 | 00 0000 0000 1001
|
public string RETURN = "00000000001000";
|
||||||
RETLW | 4 | 11 01xx kkkk kkkk
|
public string SLEEP = "00000001100011";
|
||||||
RETURN | 14 | 00 0000 0000 1000
|
public string SUBLW = "11110xkkkkkkkk";
|
||||||
SLEEP | 14 | 00 0000 0110 0011
|
public string XORLW = "111010kkkkkkkk";
|
||||||
SUBLW | 5 | 11 110x kkkk kkkk
|
|
||||||
XORLW | 6 | 11 1010 kkkk kkkk
|
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
00001 ;TPicSim1
|
00001 ;TPicSim1
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es werden alle Literal-Befehle geprüft
|
00003 ;Es werden alle Literal-Befehle geprüft
|
||||||
00004 ;(c) St. Lehmann
|
00004 ;(c) St. Lehmann
|
||||||
00005 ;Ersterstellung: 23.03.2016
|
00005 ;Ersterstellung: 23.03.2016
|
||||||
00006 ;
|
00006 ;
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 ;Definition einiger Symbole
|
00009 ;Definition einiger Symbole
|
||||||
00010 ;zuerst Hardware-Register
|
00010 ;zuerst Hardware-Register
|
||||||
00011 status equ 03h
|
00011 status equ 03h
|
||||||
00012 ra equ 05h
|
00012 ra equ 05h
|
||||||
00013 rb equ 06h
|
00013 rb equ 06h
|
||||||
00014
|
00014
|
||||||
00015 ;für den Benutzer frei verwendbare Register
|
00015 ;für den Benutzer frei verwendbare Register
|
||||||
00016 count equ 0ch
|
00016 count equ 0ch
|
||||||
00017
|
00017
|
||||||
00018 ;Definition des Prozessors
|
00018 ;Definition des Prozessors
|
||||||
00019 device 16F84
|
00019 device 16F84
|
||||||
00020
|
00020
|
||||||
00021 ;Festlegen des Codebeginns
|
00021 ;Festlegen des Codebeginns
|
||||||
00022 org 0
|
00022 org 0
|
||||||
00023 start
|
00023 start
|
||||||
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unverändert
|
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unverändert
|
||||||
0001 3930 00025 andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
0001 3930 00025 andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
||||||
0002 380D 00026 iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
0002 380D 00026 iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
||||||
0003 3C3D 00027 sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
0003 3C3D 00027 sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
||||||
0004 3A20 00028 xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
0004 3A20 00028 xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
||||||
0005 3E25 00029 addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
0005 3E25 00029 addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
||||||
00030
|
00030
|
||||||
00031
|
00031
|
||||||
00032 ende
|
00032 ende
|
||||||
0006 2806 00033 goto ende ;Endlosschleife, verhindert Nirwana
|
0006 2806 00033 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00034
|
00034
|
||||||
00035
|
00035
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
;TPicSim1
|
;TPicSim1
|
||||||
;Programm zum Test des 16F84-Simulators.
|
;Programm zum Test des 16F84-Simulators.
|
||||||
;Es werden alle Literal-Befehle gepr?ft
|
;Es werden alle Literal-Befehle gepr?ft
|
||||||
;(c) St. Lehmann
|
;(c) St. Lehmann
|
||||||
;Ersterstellung: 23.03.2016
|
;Ersterstellung: 23.03.2016
|
||||||
;
|
;
|
||||||
|
|
||||||
;Definition einiger Symbole
|
;Definition einiger Symbole
|
||||||
;zuerst Hardware-Register
|
;zuerst Hardware-Register
|
||||||
status equ 03h
|
status equ 03h
|
||||||
ra equ 05h
|
ra equ 05h
|
||||||
rb equ 06h
|
rb equ 06h
|
||||||
|
|
||||||
;f?r den Benutzer frei verwendbare Register
|
;f?r den Benutzer frei verwendbare Register
|
||||||
count equ 0ch
|
count equ 0ch
|
||||||
|
|
||||||
;Definition des Prozessors
|
;Definition des Prozessors
|
||||||
device 16F84
|
device 16F84
|
||||||
|
|
||||||
;Festlegen des Codebeginns
|
;Festlegen des Codebeginns
|
||||||
org 0
|
org 0
|
||||||
start
|
start
|
||||||
movlw 11h ;in W steht nun 11h, Statusreg. unver?ndert
|
movlw 11h ;in W steht nun 11h, Statusreg. unver?ndert
|
||||||
andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
||||||
iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
||||||
sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
||||||
xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
||||||
addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
||||||
|
|
||||||
|
|
||||||
ende
|
ende
|
||||||
goto ende ;Endlosschleife, verhindert Nirwana
|
goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
|
|
||||||
|
@ -1,314 +1,314 @@
|
|||||||
00001 ;TPicSim10
|
00001 ;TPicSim10
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es wird die richtige Funktionsweise von PCL und PCLATH am Beispiel
|
00003 ;Es wird die richtige Funktionsweise von PCL und PCLATH am Beispiel
|
||||||
00004 ;eines Tabellenzugriffs getestet
|
00004 ;eines Tabellenzugriffs getestet
|
||||||
00005 ;(c) St. Lehmann
|
00005 ;(c) St. Lehmann
|
||||||
00006 ;19.04.2014
|
00006 ;19.04.2014
|
||||||
00007
|
00007
|
||||||
00008 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00008 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00009
|
00009
|
||||||
00010 ;Definition einiger Symbole
|
00010 ;Definition einiger Symbole
|
||||||
00011 indirect equ 0
|
00011 indirect equ 0
|
||||||
00012 pcl equ 02h
|
00012 pcl equ 02h
|
||||||
00013 status equ 03h
|
00013 status equ 03h
|
||||||
00014 fsr equ 04h
|
00014 fsr equ 04h
|
||||||
00015 ra equ 05h
|
00015 ra equ 05h
|
||||||
00016 rb equ 06h
|
00016 rb equ 06h
|
||||||
00017 pclath equ 0ah
|
00017 pclath equ 0ah
|
||||||
00018 intcon equ 0bh
|
00018 intcon equ 0bh
|
||||||
00019
|
00019
|
||||||
00020 ;Definition des Prozessors
|
00020 ;Definition des Prozessors
|
||||||
00021 device 16F84
|
00021 device 16F84
|
||||||
00022 ;Festlegen des Codebeginns
|
00022 ;Festlegen des Codebeginns
|
||||||
00023 org 0
|
00023 org 0
|
||||||
00024 start
|
00024 start
|
||||||
0000 3000 00025 movlw 0 ;Index für Tabellenzugriff in 0FH
|
0000 3000 00025 movlw 0 ;Index für Tabellenzugriff in 0FH
|
||||||
0001 008F 00026 movwf 0fh
|
0001 008F 00026 movwf 0fh
|
||||||
0002 3005 00027 movlw 5 ;insgesamt 5 Tabellenzugriffe
|
0002 3005 00027 movlw 5 ;insgesamt 5 Tabellenzugriffe
|
||||||
0003 008E 00028 movwf 0eh
|
0003 008E 00028 movwf 0eh
|
||||||
0004 3010 00029 movlw 10h ;Ergebnis wird ab 10H abgespeichert
|
0004 3010 00029 movlw 10h ;Ergebnis wird ab 10H abgespeichert
|
||||||
0005 0084 00030 movwf fsr
|
0005 0084 00030 movwf fsr
|
||||||
00031 loop
|
00031 loop
|
||||||
0006 3001 00032 movlw 1 ;PCLATH setzen, damit auf den Bereich 256-511 zugegriffen werden kann
|
0006 3001 00032 movlw 1 ;PCLATH setzen, damit auf den Bereich 256-511 zugegriffen werden kann
|
||||||
0007 008A 00033 movwf pclath
|
0007 008A 00033 movwf pclath
|
||||||
0008 080F 00034 movf 0fh,w
|
0008 080F 00034 movf 0fh,w
|
||||||
0009 2109 00035 call tabelle
|
0009 2109 00035 call tabelle
|
||||||
000A 0080 00036 movwf indirect
|
000A 0080 00036 movwf indirect
|
||||||
000B 0A84 00037 incf fsr
|
000B 0A84 00037 incf fsr
|
||||||
000C 0A8F 00038 incf 0fh
|
000C 0A8F 00038 incf 0fh
|
||||||
000D 0B8E 00039 decfsz 0eh
|
000D 0B8E 00039 decfsz 0eh
|
||||||
000E 2806 00040 goto loop
|
000E 2806 00040 goto loop
|
||||||
000F 018A 00041 clrf pclath
|
000F 018A 00041 clrf pclath
|
||||||
0010 080F 00042 movf 0fh,w
|
0010 080F 00042 movf 0fh,w
|
||||||
0011 2109 00043 call tabelle ;Fehler, der ADDWF PCL kommt nicht in die Tabelle. Grund: in W steht 5
|
0011 2109 00043 call tabelle ;Fehler, der ADDWF PCL kommt nicht in die Tabelle. Grund: in W steht 5
|
||||||
00044 ;im PC 109 bzw. nach dem Fetch 10A. Zu diesem Wert wird 5 addiert und
|
00044 ;im PC 109 bzw. nach dem Fetch 10A. Zu diesem Wert wird 5 addiert und
|
||||||
00045 ;die oberen Bits auf 0 gesetzt (PCLATH=0). Damit steht im PC der Wert
|
00045 ;die oberen Bits auf 0 gesetzt (PCLATH=0). Damit steht im PC der Wert
|
||||||
00046 ;0Fh. Dorthin springt der PIC durch den ADDWF-Befehl. Hier verweilt
|
00046 ;0Fh. Dorthin springt der PIC durch den ADDWF-Befehl. Hier verweilt
|
||||||
00047 ;das Programm während der Stack immer weiter wächst.
|
00047 ;das Programm während der Stack immer weiter wächst.
|
||||||
00048
|
00048
|
||||||
00049
|
00049
|
||||||
00050 ende
|
00050 ende
|
||||||
0012 2812 00051 goto ende ;Endlosschleife, verhindert Nirwana
|
0012 2812 00051 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00052
|
00052
|
||||||
0013 0000 00053 nop
|
0013 0000 00053 nop
|
||||||
0014 0000 00054 nop
|
0014 0000 00054 nop
|
||||||
0015 0000 00055 nop
|
0015 0000 00055 nop
|
||||||
0016 0000 00056 nop
|
0016 0000 00056 nop
|
||||||
0017 0000 00057 nop
|
0017 0000 00057 nop
|
||||||
0018 0000 00058 nop
|
0018 0000 00058 nop
|
||||||
0019 0000 00059 nop
|
0019 0000 00059 nop
|
||||||
001A 0000 00060 nop
|
001A 0000 00060 nop
|
||||||
001B 0000 00061 nop
|
001B 0000 00061 nop
|
||||||
001C 0000 00062 nop
|
001C 0000 00062 nop
|
||||||
001D 0000 00063 nop
|
001D 0000 00063 nop
|
||||||
001E 0000 00064 nop
|
001E 0000 00064 nop
|
||||||
001F 0000 00065 nop
|
001F 0000 00065 nop
|
||||||
0020 0000 00066 nop
|
0020 0000 00066 nop
|
||||||
0021 0000 00067 nop
|
0021 0000 00067 nop
|
||||||
0022 0000 00068 nop
|
0022 0000 00068 nop
|
||||||
0023 0000 00069 nop
|
0023 0000 00069 nop
|
||||||
0024 0000 00070 nop
|
0024 0000 00070 nop
|
||||||
0025 0000 00071 nop
|
0025 0000 00071 nop
|
||||||
0026 0000 00072 nop
|
0026 0000 00072 nop
|
||||||
0027 0000 00073 nop
|
0027 0000 00073 nop
|
||||||
0028 0000 00074 nop
|
0028 0000 00074 nop
|
||||||
0029 0000 00075 nop
|
0029 0000 00075 nop
|
||||||
002A 0000 00076 nop
|
002A 0000 00076 nop
|
||||||
002B 0000 00077 nop
|
002B 0000 00077 nop
|
||||||
002C 0000 00078 nop
|
002C 0000 00078 nop
|
||||||
002D 0000 00079 nop
|
002D 0000 00079 nop
|
||||||
002E 0000 00080 nop
|
002E 0000 00080 nop
|
||||||
002F 0000 00081 nop
|
002F 0000 00081 nop
|
||||||
0030 0000 00082 nop
|
0030 0000 00082 nop
|
||||||
0031 0000 00083 nop
|
0031 0000 00083 nop
|
||||||
0032 0000 00084 nop
|
0032 0000 00084 nop
|
||||||
0033 0000 00085 nop
|
0033 0000 00085 nop
|
||||||
0034 0000 00086 nop
|
0034 0000 00086 nop
|
||||||
0035 0000 00087 nop
|
0035 0000 00087 nop
|
||||||
0036 0000 00088 nop
|
0036 0000 00088 nop
|
||||||
0037 0000 00089 nop
|
0037 0000 00089 nop
|
||||||
0038 0000 00090 nop
|
0038 0000 00090 nop
|
||||||
0039 0000 00091 nop
|
0039 0000 00091 nop
|
||||||
003A 0000 00092 nop
|
003A 0000 00092 nop
|
||||||
003B 0000 00093 nop
|
003B 0000 00093 nop
|
||||||
003C 0000 00094 nop
|
003C 0000 00094 nop
|
||||||
003D 0000 00095 nop
|
003D 0000 00095 nop
|
||||||
003E 0000 00096 nop
|
003E 0000 00096 nop
|
||||||
003F 0000 00097 nop
|
003F 0000 00097 nop
|
||||||
0040 0000 00098 nop
|
0040 0000 00098 nop
|
||||||
0041 0000 00099 nop
|
0041 0000 00099 nop
|
||||||
0042 0000 00100 nop
|
0042 0000 00100 nop
|
||||||
0043 0000 00101 nop
|
0043 0000 00101 nop
|
||||||
0044 0000 00102 nop
|
0044 0000 00102 nop
|
||||||
0045 0000 00103 nop
|
0045 0000 00103 nop
|
||||||
0046 0000 00104 nop
|
0046 0000 00104 nop
|
||||||
0047 0000 00105 nop
|
0047 0000 00105 nop
|
||||||
0048 0000 00106 nop
|
0048 0000 00106 nop
|
||||||
0049 0000 00107 nop
|
0049 0000 00107 nop
|
||||||
004A 0000 00108 nop
|
004A 0000 00108 nop
|
||||||
004B 0000 00109 nop
|
004B 0000 00109 nop
|
||||||
004C 0000 00110 nop
|
004C 0000 00110 nop
|
||||||
004D 0000 00111 nop
|
004D 0000 00111 nop
|
||||||
004E 0000 00112 nop
|
004E 0000 00112 nop
|
||||||
004F 0000 00113 nop
|
004F 0000 00113 nop
|
||||||
0050 0000 00114 nop
|
0050 0000 00114 nop
|
||||||
0051 0000 00115 nop
|
0051 0000 00115 nop
|
||||||
0052 0000 00116 nop
|
0052 0000 00116 nop
|
||||||
0053 0000 00117 nop
|
0053 0000 00117 nop
|
||||||
0054 0000 00118 nop
|
0054 0000 00118 nop
|
||||||
0055 0000 00119 nop
|
0055 0000 00119 nop
|
||||||
0056 0000 00120 nop
|
0056 0000 00120 nop
|
||||||
0057 0000 00121 nop
|
0057 0000 00121 nop
|
||||||
0058 0000 00122 nop
|
0058 0000 00122 nop
|
||||||
0059 0000 00123 nop
|
0059 0000 00123 nop
|
||||||
005A 0000 00124 nop
|
005A 0000 00124 nop
|
||||||
005B 0000 00125 nop
|
005B 0000 00125 nop
|
||||||
005C 0000 00126 nop
|
005C 0000 00126 nop
|
||||||
005D 0000 00127 nop
|
005D 0000 00127 nop
|
||||||
005E 0000 00128 nop
|
005E 0000 00128 nop
|
||||||
005F 0000 00129 nop
|
005F 0000 00129 nop
|
||||||
0060 0000 00130 nop
|
0060 0000 00130 nop
|
||||||
0061 0000 00131 nop
|
0061 0000 00131 nop
|
||||||
0062 0000 00132 nop
|
0062 0000 00132 nop
|
||||||
0063 0000 00133 nop
|
0063 0000 00133 nop
|
||||||
0064 0000 00134 nop
|
0064 0000 00134 nop
|
||||||
0065 0000 00135 nop
|
0065 0000 00135 nop
|
||||||
0066 0000 00136 nop
|
0066 0000 00136 nop
|
||||||
0067 0000 00137 nop
|
0067 0000 00137 nop
|
||||||
0068 0000 00138 nop
|
0068 0000 00138 nop
|
||||||
0069 0000 00139 nop
|
0069 0000 00139 nop
|
||||||
006A 0000 00140 nop
|
006A 0000 00140 nop
|
||||||
006B 0000 00141 nop
|
006B 0000 00141 nop
|
||||||
006C 0000 00142 nop
|
006C 0000 00142 nop
|
||||||
006D 0000 00143 nop
|
006D 0000 00143 nop
|
||||||
006E 0000 00144 nop
|
006E 0000 00144 nop
|
||||||
006F 0000 00145 nop
|
006F 0000 00145 nop
|
||||||
0070 0000 00146 nop
|
0070 0000 00146 nop
|
||||||
0071 0000 00147 nop
|
0071 0000 00147 nop
|
||||||
0072 0000 00148 nop
|
0072 0000 00148 nop
|
||||||
0073 0000 00149 nop
|
0073 0000 00149 nop
|
||||||
0074 0000 00150 nop
|
0074 0000 00150 nop
|
||||||
0075 0000 00151 nop
|
0075 0000 00151 nop
|
||||||
0076 0000 00152 nop
|
0076 0000 00152 nop
|
||||||
0077 0000 00153 nop
|
0077 0000 00153 nop
|
||||||
0078 0000 00154 nop
|
0078 0000 00154 nop
|
||||||
0079 0000 00155 nop
|
0079 0000 00155 nop
|
||||||
007A 0000 00156 nop
|
007A 0000 00156 nop
|
||||||
007B 0000 00157 nop
|
007B 0000 00157 nop
|
||||||
007C 0000 00158 nop
|
007C 0000 00158 nop
|
||||||
007D 0000 00159 nop
|
007D 0000 00159 nop
|
||||||
007E 0000 00160 nop
|
007E 0000 00160 nop
|
||||||
007F 0000 00161 nop
|
007F 0000 00161 nop
|
||||||
0080 0000 00162 nop
|
0080 0000 00162 nop
|
||||||
0081 0000 00163 nop
|
0081 0000 00163 nop
|
||||||
0082 0000 00164 nop
|
0082 0000 00164 nop
|
||||||
0083 0000 00165 nop
|
0083 0000 00165 nop
|
||||||
0084 0000 00166 nop
|
0084 0000 00166 nop
|
||||||
0085 0000 00167 nop
|
0085 0000 00167 nop
|
||||||
0086 0000 00168 nop
|
0086 0000 00168 nop
|
||||||
0087 0000 00169 nop
|
0087 0000 00169 nop
|
||||||
0088 0000 00170 nop
|
0088 0000 00170 nop
|
||||||
0089 0000 00171 nop
|
0089 0000 00171 nop
|
||||||
008A 0000 00172 nop
|
008A 0000 00172 nop
|
||||||
008B 0000 00173 nop
|
008B 0000 00173 nop
|
||||||
008C 0000 00174 nop
|
008C 0000 00174 nop
|
||||||
008D 0000 00175 nop
|
008D 0000 00175 nop
|
||||||
008E 0000 00176 nop
|
008E 0000 00176 nop
|
||||||
008F 0000 00177 nop
|
008F 0000 00177 nop
|
||||||
0090 0000 00178 nop
|
0090 0000 00178 nop
|
||||||
0091 0000 00179 nop
|
0091 0000 00179 nop
|
||||||
0092 0000 00180 nop
|
0092 0000 00180 nop
|
||||||
0093 0000 00181 nop
|
0093 0000 00181 nop
|
||||||
0094 0000 00182 nop
|
0094 0000 00182 nop
|
||||||
0095 0000 00183 nop
|
0095 0000 00183 nop
|
||||||
0096 0000 00184 nop
|
0096 0000 00184 nop
|
||||||
0097 0000 00185 nop
|
0097 0000 00185 nop
|
||||||
0098 0000 00186 nop
|
0098 0000 00186 nop
|
||||||
0099 0000 00187 nop
|
0099 0000 00187 nop
|
||||||
009A 0000 00188 nop
|
009A 0000 00188 nop
|
||||||
009B 0000 00189 nop
|
009B 0000 00189 nop
|
||||||
009C 0000 00190 nop
|
009C 0000 00190 nop
|
||||||
009D 0000 00191 nop
|
009D 0000 00191 nop
|
||||||
009E 0000 00192 nop
|
009E 0000 00192 nop
|
||||||
009F 0000 00193 nop
|
009F 0000 00193 nop
|
||||||
00A0 0000 00194 nop
|
00A0 0000 00194 nop
|
||||||
00A1 0000 00195 nop
|
00A1 0000 00195 nop
|
||||||
00A2 0000 00196 nop
|
00A2 0000 00196 nop
|
||||||
00A3 0000 00197 nop
|
00A3 0000 00197 nop
|
||||||
00A4 0000 00198 nop
|
00A4 0000 00198 nop
|
||||||
00A5 0000 00199 nop
|
00A5 0000 00199 nop
|
||||||
00A6 0000 00200 nop
|
00A6 0000 00200 nop
|
||||||
00A7 0000 00201 nop
|
00A7 0000 00201 nop
|
||||||
00A8 0000 00202 nop
|
00A8 0000 00202 nop
|
||||||
00A9 0000 00203 nop
|
00A9 0000 00203 nop
|
||||||
00AA 0000 00204 nop
|
00AA 0000 00204 nop
|
||||||
00AB 0000 00205 nop
|
00AB 0000 00205 nop
|
||||||
00AC 0000 00206 nop
|
00AC 0000 00206 nop
|
||||||
00AD 0000 00207 nop
|
00AD 0000 00207 nop
|
||||||
00AE 0000 00208 nop
|
00AE 0000 00208 nop
|
||||||
00AF 0000 00209 nop
|
00AF 0000 00209 nop
|
||||||
00B0 0000 00210 nop
|
00B0 0000 00210 nop
|
||||||
00B1 0000 00211 nop
|
00B1 0000 00211 nop
|
||||||
00B2 0000 00212 nop
|
00B2 0000 00212 nop
|
||||||
00B3 0000 00213 nop
|
00B3 0000 00213 nop
|
||||||
00B4 0000 00214 nop
|
00B4 0000 00214 nop
|
||||||
00B5 0000 00215 nop
|
00B5 0000 00215 nop
|
||||||
00B6 0000 00216 nop
|
00B6 0000 00216 nop
|
||||||
00B7 0000 00217 nop
|
00B7 0000 00217 nop
|
||||||
00B8 0000 00218 nop
|
00B8 0000 00218 nop
|
||||||
00B9 0000 00219 nop
|
00B9 0000 00219 nop
|
||||||
00BA 0000 00220 nop
|
00BA 0000 00220 nop
|
||||||
00BB 0000 00221 nop
|
00BB 0000 00221 nop
|
||||||
00BC 0000 00222 nop
|
00BC 0000 00222 nop
|
||||||
00BD 0000 00223 nop
|
00BD 0000 00223 nop
|
||||||
00BE 0000 00224 nop
|
00BE 0000 00224 nop
|
||||||
00BF 0000 00225 nop
|
00BF 0000 00225 nop
|
||||||
00C0 0000 00226 nop
|
00C0 0000 00226 nop
|
||||||
00C1 0000 00227 nop
|
00C1 0000 00227 nop
|
||||||
00C2 0000 00228 nop
|
00C2 0000 00228 nop
|
||||||
00C3 0000 00229 nop
|
00C3 0000 00229 nop
|
||||||
00C4 0000 00230 nop
|
00C4 0000 00230 nop
|
||||||
00C5 0000 00231 nop
|
00C5 0000 00231 nop
|
||||||
00C6 0000 00232 nop
|
00C6 0000 00232 nop
|
||||||
00C7 0000 00233 nop
|
00C7 0000 00233 nop
|
||||||
00C8 0000 00234 nop
|
00C8 0000 00234 nop
|
||||||
00C9 0000 00235 nop
|
00C9 0000 00235 nop
|
||||||
00CA 0000 00236 nop
|
00CA 0000 00236 nop
|
||||||
00CB 0000 00237 nop
|
00CB 0000 00237 nop
|
||||||
00CC 0000 00238 nop
|
00CC 0000 00238 nop
|
||||||
00CD 0000 00239 nop
|
00CD 0000 00239 nop
|
||||||
00CE 0000 00240 nop
|
00CE 0000 00240 nop
|
||||||
00CF 0000 00241 nop
|
00CF 0000 00241 nop
|
||||||
00D0 0000 00242 nop
|
00D0 0000 00242 nop
|
||||||
00D1 0000 00243 nop
|
00D1 0000 00243 nop
|
||||||
00D2 0000 00244 nop
|
00D2 0000 00244 nop
|
||||||
00D3 0000 00245 nop
|
00D3 0000 00245 nop
|
||||||
00D4 0000 00246 nop
|
00D4 0000 00246 nop
|
||||||
00D5 0000 00247 nop
|
00D5 0000 00247 nop
|
||||||
00D6 0000 00248 nop
|
00D6 0000 00248 nop
|
||||||
00D7 0000 00249 nop
|
00D7 0000 00249 nop
|
||||||
00D8 0000 00250 nop
|
00D8 0000 00250 nop
|
||||||
00D9 0000 00251 nop
|
00D9 0000 00251 nop
|
||||||
00DA 0000 00252 nop
|
00DA 0000 00252 nop
|
||||||
00DB 0000 00253 nop
|
00DB 0000 00253 nop
|
||||||
00DC 0000 00254 nop
|
00DC 0000 00254 nop
|
||||||
00DD 0000 00255 nop
|
00DD 0000 00255 nop
|
||||||
00DE 0000 00256 nop
|
00DE 0000 00256 nop
|
||||||
00DF 0000 00257 nop
|
00DF 0000 00257 nop
|
||||||
00E0 0000 00258 nop
|
00E0 0000 00258 nop
|
||||||
00E1 0000 00259 nop
|
00E1 0000 00259 nop
|
||||||
00E2 0000 00260 nop
|
00E2 0000 00260 nop
|
||||||
00E3 0000 00261 nop
|
00E3 0000 00261 nop
|
||||||
00E4 0000 00262 nop
|
00E4 0000 00262 nop
|
||||||
00E5 0000 00263 nop
|
00E5 0000 00263 nop
|
||||||
00E6 0000 00264 nop
|
00E6 0000 00264 nop
|
||||||
00E7 0000 00265 nop
|
00E7 0000 00265 nop
|
||||||
00E8 0000 00266 nop
|
00E8 0000 00266 nop
|
||||||
00E9 0000 00267 nop
|
00E9 0000 00267 nop
|
||||||
00EA 0000 00268 nop
|
00EA 0000 00268 nop
|
||||||
00EB 0000 00269 nop
|
00EB 0000 00269 nop
|
||||||
00EC 0000 00270 nop
|
00EC 0000 00270 nop
|
||||||
00ED 0000 00271 nop
|
00ED 0000 00271 nop
|
||||||
00EE 0000 00272 nop
|
00EE 0000 00272 nop
|
||||||
00EF 0000 00273 nop
|
00EF 0000 00273 nop
|
||||||
00F0 0000 00274 nop
|
00F0 0000 00274 nop
|
||||||
00F1 0000 00275 nop
|
00F1 0000 00275 nop
|
||||||
00F2 0000 00276 nop
|
00F2 0000 00276 nop
|
||||||
00F3 0000 00277 nop
|
00F3 0000 00277 nop
|
||||||
00F4 0000 00278 nop
|
00F4 0000 00278 nop
|
||||||
00F5 0000 00279 nop
|
00F5 0000 00279 nop
|
||||||
00F6 0000 00280 nop
|
00F6 0000 00280 nop
|
||||||
00F7 0000 00281 nop
|
00F7 0000 00281 nop
|
||||||
00F8 0000 00282 nop
|
00F8 0000 00282 nop
|
||||||
00F9 0000 00283 nop
|
00F9 0000 00283 nop
|
||||||
00FA 0000 00284 nop
|
00FA 0000 00284 nop
|
||||||
00FB 0000 00285 nop
|
00FB 0000 00285 nop
|
||||||
00FC 0000 00286 nop
|
00FC 0000 00286 nop
|
||||||
00FD 0000 00287 nop
|
00FD 0000 00287 nop
|
||||||
00FE 0000 00288 nop
|
00FE 0000 00288 nop
|
||||||
00FF 0000 00289 nop
|
00FF 0000 00289 nop
|
||||||
0100 0000 00290 nop
|
0100 0000 00290 nop
|
||||||
0101 0000 00291 nop
|
0101 0000 00291 nop
|
||||||
0102 0000 00292 nop
|
0102 0000 00292 nop
|
||||||
0103 0000 00293 nop
|
0103 0000 00293 nop
|
||||||
0104 0000 00294 nop
|
0104 0000 00294 nop
|
||||||
0105 0000 00295 nop
|
0105 0000 00295 nop
|
||||||
0106 0000 00296 nop
|
0106 0000 00296 nop
|
||||||
0107 0000 00297 nop
|
0107 0000 00297 nop
|
||||||
0108 0000 00298 nop
|
0108 0000 00298 nop
|
||||||
00299 Tabelle
|
00299 Tabelle
|
||||||
0109 0782 00300 addwf pcl
|
0109 0782 00300 addwf pcl
|
||||||
010A 3460 00301 retlw 60h
|
010A 3460 00301 retlw 60h
|
||||||
010B 3461 00302 retlw 61h
|
010B 3461 00302 retlw 61h
|
||||||
010C 3462 00303 retlw 62h
|
010C 3462 00303 retlw 62h
|
||||||
010D 3463 00304 retlw 63h
|
010D 3463 00304 retlw 63h
|
||||||
010E 3464 00305 retlw 64h
|
010E 3464 00305 retlw 64h
|
||||||
010F 3465 00306 retlw 65h
|
010F 3465 00306 retlw 65h
|
||||||
0110 3466 00307 retlw 66h
|
0110 3466 00307 retlw 66h
|
||||||
0111 3467 00308 retlw 67h
|
0111 3467 00308 retlw 67h
|
||||||
0112 3468 00309 retlw 68h
|
0112 3468 00309 retlw 68h
|
||||||
0113 3469 00310 retlw 69h
|
0113 3469 00310 retlw 69h
|
||||||
0114 346A 00311 retlw 6Ah
|
0114 346A 00311 retlw 6Ah
|
||||||
00312
|
00312
|
||||||
00313
|
00313
|
||||||
00314
|
00314
|
||||||
|
@ -1,312 +1,312 @@
|
|||||||
;TPicSim10
|
;TPicSim10
|
||||||
;Programm zum Test des 16F84-Simulators.
|
;Programm zum Test des 16F84-Simulators.
|
||||||
;Es wird die richtige Funktionsweise von PCL und PCLATH am Beispiel
|
;Es wird die richtige Funktionsweise von PCL und PCLATH am Beispiel
|
||||||
;eines Tabellenzugriffs getestet
|
;eines Tabellenzugriffs getestet
|
||||||
;(c) St. Lehmann
|
;(c) St. Lehmann
|
||||||
;19.04.2014
|
;19.04.2014
|
||||||
|
|
||||||
|
|
||||||
;Definition einiger Symbole
|
;Definition einiger Symbole
|
||||||
indirect equ 0
|
indirect equ 0
|
||||||
pcl equ 02h
|
pcl equ 02h
|
||||||
status equ 03h
|
status equ 03h
|
||||||
fsr equ 04h
|
fsr equ 04h
|
||||||
ra equ 05h
|
ra equ 05h
|
||||||
rb equ 06h
|
rb equ 06h
|
||||||
pclath equ 0ah
|
pclath equ 0ah
|
||||||
intcon equ 0bh
|
intcon equ 0bh
|
||||||
|
|
||||||
;Definition des Prozessors
|
;Definition des Prozessors
|
||||||
device 16F84
|
device 16F84
|
||||||
;Festlegen des Codebeginns
|
;Festlegen des Codebeginns
|
||||||
org 0
|
org 0
|
||||||
start
|
start
|
||||||
movlw 0 ;Index f?r Tabellenzugriff in 0FH
|
movlw 0 ;Index f?r Tabellenzugriff in 0FH
|
||||||
movwf 0fh
|
movwf 0fh
|
||||||
movlw 5 ;insgesamt 5 Tabellenzugriffe
|
movlw 5 ;insgesamt 5 Tabellenzugriffe
|
||||||
movwf 0eh
|
movwf 0eh
|
||||||
movlw 10h ;Ergebnis wird ab 10H abgespeichert
|
movlw 10h ;Ergebnis wird ab 10H abgespeichert
|
||||||
movwf fsr
|
movwf fsr
|
||||||
loop
|
loop
|
||||||
movlw 1 ;PCLATH setzen, damit auf den Bereich 256-511 zugegriffen werden kann
|
movlw 1 ;PCLATH setzen, damit auf den Bereich 256-511 zugegriffen werden kann
|
||||||
movwf pclath
|
movwf pclath
|
||||||
movf 0fh,w
|
movf 0fh,w
|
||||||
call tabelle
|
call tabelle
|
||||||
movwf indirect
|
movwf indirect
|
||||||
incf fsr
|
incf fsr
|
||||||
incf 0fh
|
incf 0fh
|
||||||
decfsz 0eh
|
decfsz 0eh
|
||||||
goto loop
|
goto loop
|
||||||
clrf pclath
|
clrf pclath
|
||||||
movf 0fh,w
|
movf 0fh,w
|
||||||
call tabelle ;Fehler, der ADDWF PCL kommt nicht in die Tabelle. Grund: in W steht 5
|
call tabelle ;Fehler, der ADDWF PCL kommt nicht in die Tabelle. Grund: in W steht 5
|
||||||
;im PC 109 bzw. nach dem Fetch 10A. Zu diesem Wert wird 5 addiert und
|
;im PC 109 bzw. nach dem Fetch 10A. Zu diesem Wert wird 5 addiert und
|
||||||
;die oberen Bits auf 0 gesetzt (PCLATH=0). Damit steht im PC der Wert
|
;die oberen Bits auf 0 gesetzt (PCLATH=0). Damit steht im PC der Wert
|
||||||
;0Fh. Dorthin springt der PIC durch den ADDWF-Befehl. Hier verweilt
|
;0Fh. Dorthin springt der PIC durch den ADDWF-Befehl. Hier verweilt
|
||||||
;das Programm w?hrend der Stack immer weiter w?chst.
|
;das Programm w?hrend der Stack immer weiter w?chst.
|
||||||
|
|
||||||
|
|
||||||
ende
|
ende
|
||||||
goto ende ;Endlosschleife, verhindert Nirwana
|
goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
|
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
Tabelle
|
Tabelle
|
||||||
addwf pcl
|
addwf pcl
|
||||||
retlw 60h
|
retlw 60h
|
||||||
retlw 61h
|
retlw 61h
|
||||||
retlw 62h
|
retlw 62h
|
||||||
retlw 63h
|
retlw 63h
|
||||||
retlw 64h
|
retlw 64h
|
||||||
retlw 65h
|
retlw 65h
|
||||||
retlw 66h
|
retlw 66h
|
||||||
retlw 67h
|
retlw 67h
|
||||||
retlw 68h
|
retlw 68h
|
||||||
retlw 69h
|
retlw 69h
|
||||||
retlw 6Ah
|
retlw 6Ah
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
00001 ;TPicSim11
|
00001 ;TPicSim11
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es wird der Watchdog mit und ohne Vorteiler geprüft
|
00003 ;Es wird der Watchdog mit und ohne Vorteiler geprüft
|
||||||
00004 ;(c) St. Lehmann
|
00004 ;(c) St. Lehmann
|
||||||
00005 ;19.04.2014
|
00005 ;19.04.2014
|
||||||
00006
|
00006
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 ;Definition einiger Symbole
|
00009 ;Definition einiger Symbole
|
||||||
00010 indirect equ 0
|
00010 indirect equ 0
|
||||||
00011 status equ 03h
|
00011 status equ 03h
|
||||||
00012 fsr equ 04h
|
00012 fsr equ 04h
|
||||||
00013 ra equ 05h
|
00013 ra equ 05h
|
||||||
00014 rb equ 06h
|
00014 rb equ 06h
|
||||||
00015 count equ 0ch
|
00015 count equ 0ch
|
||||||
00016
|
00016
|
||||||
00017 ;Definition des Prozessors
|
00017 ;Definition des Prozessors
|
||||||
00018 device 16F84
|
00018 device 16F84
|
||||||
00019 ;Festlegen des Codebeginns
|
00019 ;Festlegen des Codebeginns
|
||||||
00020 org 0
|
00020 org 0
|
||||||
00021 start
|
00021 start
|
||||||
00022 ;zuerst wird der VT dem Timer zugewiesen. Damit bekommt der Watchdog
|
00022 ;zuerst wird der VT dem Timer zugewiesen. Damit bekommt der Watchdog
|
||||||
00023 ;die kleinste Zeit (ca. 18 ms) zugewiesen
|
00023 ;die kleinste Zeit (ca. 18 ms) zugewiesen
|
||||||
0000 3000 00024 movlw 00000000B ;Option-Register entsp. initialisieren
|
0000 3000 00024 movlw 00000000B ;Option-Register entsp. initialisieren
|
||||||
0001 1683 00025 bsf status,5 ;Bank umschalten
|
0001 1683 00025 bsf status,5 ;Bank umschalten
|
||||||
0002 0081 00026 movwf 1 ;Option-Register
|
0002 0081 00026 movwf 1 ;Option-Register
|
||||||
0003 1283 00027 bcf status,5
|
0003 1283 00027 bcf status,5
|
||||||
0004 01A0 00028 clrf 20h
|
0004 01A0 00028 clrf 20h
|
||||||
0005 01A1 00029 clrf 21h
|
0005 01A1 00029 clrf 21h
|
||||||
0006 01A2 00030 clrf 22h
|
0006 01A2 00030 clrf 22h
|
||||||
0007 01A3 00031 clrf 23h
|
0007 01A3 00031 clrf 23h
|
||||||
00032 loop1
|
00032 loop1
|
||||||
0008 0FA0 00033 incfsz 20h
|
0008 0FA0 00033 incfsz 20h
|
||||||
0009 2808 00034 goto loop1 ;kein Überlauf
|
0009 2808 00034 goto loop1 ;kein Überlauf
|
||||||
000A 0FA1 00035 incfsz 21h ;nächste Stelle
|
000A 0FA1 00035 incfsz 21h ;nächste Stelle
|
||||||
000B 2808 00036 goto loop1 ;kein Überlauf
|
000B 2808 00036 goto loop1 ;kein Überlauf
|
||||||
000C 0FA2 00037 incfsz 22h ;ja
|
000C 0FA2 00037 incfsz 22h ;ja
|
||||||
000D 2808 00038 goto loop1
|
000D 2808 00038 goto loop1
|
||||||
000E 0FA3 00039 incfsz 23h
|
000E 0FA3 00039 incfsz 23h
|
||||||
000F 2808 00040 goto loop1
|
000F 2808 00040 goto loop1
|
||||||
00041
|
00041
|
||||||
00042 ;******************************************************************
|
00042 ;******************************************************************
|
||||||
00043 ;in 20h steht ca. 5fH
|
00043 ;in 20h steht ca. 5fH
|
||||||
00044 ;in 21H ca. 17H
|
00044 ;in 21H ca. 17H
|
||||||
00045 ;Zählerstand 16-Bit ca. 175FH = 5983d
|
00045 ;Zählerstand 16-Bit ca. 175FH = 5983d
|
||||||
00046
|
00046
|
||||||
00047 ende
|
00047 ende
|
||||||
0010 2810 00048 goto ende ;Endlosschleife, verhindert Nirwana
|
0010 2810 00048 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00049
|
00049
|
||||||
00050
|
00050
|
||||||
|
@ -1,48 +1,48 @@
|
|||||||
;TPicSim11
|
;TPicSim11
|
||||||
;Programm zum Test des 16F84-Simulators.
|
;Programm zum Test des 16F84-Simulators.
|
||||||
;Es wird der Watchdog mit und ohne Vorteiler gepr?ft
|
;Es wird der Watchdog mit und ohne Vorteiler gepr?ft
|
||||||
;(c) St. Lehmann
|
;(c) St. Lehmann
|
||||||
;19.04.2014
|
;19.04.2014
|
||||||
|
|
||||||
|
|
||||||
;Definition einiger Symbole
|
;Definition einiger Symbole
|
||||||
indirect equ 0
|
indirect equ 0
|
||||||
status equ 03h
|
status equ 03h
|
||||||
fsr equ 04h
|
fsr equ 04h
|
||||||
ra equ 05h
|
ra equ 05h
|
||||||
rb equ 06h
|
rb equ 06h
|
||||||
count equ 0ch
|
count equ 0ch
|
||||||
|
|
||||||
;Definition des Prozessors
|
;Definition des Prozessors
|
||||||
device 16F84
|
device 16F84
|
||||||
;Festlegen des Codebeginns
|
;Festlegen des Codebeginns
|
||||||
org 0
|
org 0
|
||||||
start
|
start
|
||||||
;zuerst wird der VT dem Timer zugewiesen. Damit bekommt der Watchdog
|
;zuerst wird der VT dem Timer zugewiesen. Damit bekommt der Watchdog
|
||||||
;die kleinste Zeit (ca. 18 ms) zugewiesen
|
;die kleinste Zeit (ca. 18 ms) zugewiesen
|
||||||
movlw 00000000B ;Option-Register entsp. initialisieren
|
movlw 00000000B ;Option-Register entsp. initialisieren
|
||||||
bsf status,5 ;Bank umschalten
|
bsf status,5 ;Bank umschalten
|
||||||
movwf 1 ;Option-Register
|
movwf 1 ;Option-Register
|
||||||
bcf status,5
|
bcf status,5
|
||||||
clrf 20h
|
clrf 20h
|
||||||
clrf 21h
|
clrf 21h
|
||||||
clrf 22h
|
clrf 22h
|
||||||
clrf 23h
|
clrf 23h
|
||||||
loop1
|
loop1
|
||||||
incfsz 20h
|
incfsz 20h
|
||||||
goto loop1 ;kein ?berlauf
|
goto loop1 ;kein ?berlauf
|
||||||
incfsz 21h ;n?chste Stelle
|
incfsz 21h ;n?chste Stelle
|
||||||
goto loop1 ;kein ?berlauf
|
goto loop1 ;kein ?berlauf
|
||||||
incfsz 22h ;ja
|
incfsz 22h ;ja
|
||||||
goto loop1
|
goto loop1
|
||||||
incfsz 23h
|
incfsz 23h
|
||||||
goto loop1
|
goto loop1
|
||||||
|
|
||||||
;******************************************************************
|
;******************************************************************
|
||||||
;in 20h steht ca. 5fH
|
;in 20h steht ca. 5fH
|
||||||
;in 21H ca. 17H
|
;in 21H ca. 17H
|
||||||
;Z?hlerstand 16-Bit ca. 175FH = 5983d
|
;Z?hlerstand 16-Bit ca. 175FH = 5983d
|
||||||
|
|
||||||
ende
|
ende
|
||||||
goto ende ;Endlosschleife, verhindert Nirwana
|
goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
|
|
||||||
|
@ -1,78 +1,78 @@
|
|||||||
00001 ;TPicSim12
|
00001 ;TPicSim12
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Funktion: Beschreiben und Lesen des EEPROMs
|
00003 ;Funktion: Beschreiben und Lesen des EEPROMs
|
||||||
00004 ;(c) St. Lehmann Ersterstellung: 11.05.2011
|
00004 ;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||||
00005 ;Definition einiger Symbole
|
00005 ;Definition einiger Symbole
|
||||||
00006
|
00006
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 indirect equ 0
|
00009 indirect equ 0
|
||||||
00010 status equ 03h
|
00010 status equ 03h
|
||||||
00011 fsr equ 04h
|
00011 fsr equ 04h
|
||||||
00012 ra equ 05h
|
00012 ra equ 05h
|
||||||
00013 rb equ 06h
|
00013 rb equ 06h
|
||||||
00014 count equ 0ch
|
00014 count equ 0ch
|
||||||
00015 eedata equ 08h
|
00015 eedata equ 08h
|
||||||
00016 eeaddr equ 09h
|
00016 eeaddr equ 09h
|
||||||
00017 eecon1 equ 08h ;auf Bank 1
|
00017 eecon1 equ 08h ;auf Bank 1
|
||||||
00018 eecon2 equ 09h ;auf Bank 1
|
00018 eecon2 equ 09h ;auf Bank 1
|
||||||
00019
|
00019
|
||||||
00020 ;Definition des Prozessors
|
00020 ;Definition des Prozessors
|
||||||
00021 device 16F84
|
00021 device 16F84
|
||||||
00022
|
00022
|
||||||
00023 ;Festlegen des Codebeginns
|
00023 ;Festlegen des Codebeginns
|
||||||
00024 org 0
|
00024 org 0
|
||||||
00025 start
|
00025 start
|
||||||
0000 3000 00026 movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gefüllt
|
0000 3000 00026 movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gefüllt
|
||||||
0001 008C 00027 movwf count
|
0001 008C 00027 movwf count
|
||||||
00028 schreiben
|
00028 schreiben
|
||||||
0002 080C 00029 movf count,w
|
0002 080C 00029 movf count,w
|
||||||
0003 0089 00030 movwf eeaddr ;diese Adresse soll beschrieben werden
|
0003 0089 00030 movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||||
0004 3AFF 00031 xorlw 255 ;Adresse invertieren
|
0004 3AFF 00031 xorlw 255 ;Adresse invertieren
|
||||||
0005 0088 00032 movwf eedata ;dieser Wert an obige Adresse schreiben
|
0005 0088 00032 movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||||
00033
|
00033
|
||||||
0006 1683 00034 bsf status,5 ;auf Bank 1
|
0006 1683 00034 bsf status,5 ;auf Bank 1
|
||||||
0007 1208 00035 bcf eecon1,4 ;EEIF zurücksetzen, wird überwacht
|
0007 1208 00035 bcf eecon1,4 ;EEIF zurücksetzen, wird überwacht
|
||||||
0008 1508 00036 bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben möglich
|
0008 1508 00036 bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben möglich
|
||||||
0009 1488 00037 bsf eecon1,1 ;WR-Bit setzen
|
0009 1488 00037 bsf eecon1,1 ;WR-Bit setzen
|
||||||
00038
|
00038
|
||||||
000A 3055 00039 movlw 55h ;State-Machine anwerfen
|
000A 3055 00039 movlw 55h ;State-Machine anwerfen
|
||||||
000B 0089 00040 movwf eecon2
|
000B 0089 00040 movwf eecon2
|
||||||
000C 30AA 00041 movlw 0AAh
|
000C 30AA 00041 movlw 0AAh
|
||||||
000D 0089 00042 movwf eecon2 ;Schreibvorgang beginnt jetzt
|
000D 0089 00042 movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||||
00043
|
00043
|
||||||
00044 warte
|
00044 warte
|
||||||
000E 1E08 00045 btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
000E 1E08 00045 btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||||
000F 280E 00046 goto warte
|
000F 280E 00046 goto warte
|
||||||
00047
|
00047
|
||||||
0010 1108 00048 bcf eecon1,2 ;WREN auf 0
|
0010 1108 00048 bcf eecon1,2 ;WREN auf 0
|
||||||
00049
|
00049
|
||||||
0011 1283 00050 bcf status,5 ;zurück auf Bank 0
|
0011 1283 00050 bcf status,5 ;zurück auf Bank 0
|
||||||
00051
|
00051
|
||||||
0012 0A8C 00052 incf count
|
0012 0A8C 00052 incf count
|
||||||
0013 080C 00053 movf count,w ;ist der Wert 40H erreicht
|
0013 080C 00053 movf count,w ;ist der Wert 40H erreicht
|
||||||
0014 3C40 00054 sublw 40h
|
0014 3C40 00054 sublw 40h
|
||||||
0015 1D03 00055 btfss status,2 ;wenn 0, dann fertig
|
0015 1D03 00055 btfss status,2 ;wenn 0, dann fertig
|
||||||
0016 2802 00056 goto schreiben
|
0016 2802 00056 goto schreiben
|
||||||
00057
|
00057
|
||||||
00058
|
00058
|
||||||
0017 018C 00059 clrf count ;jetzt gesamten Speicher lesen
|
0017 018C 00059 clrf count ;jetzt gesamten Speicher lesen
|
||||||
00060 lesen:
|
00060 lesen:
|
||||||
0018 080C 00061 movf count,w
|
0018 080C 00061 movf count,w
|
||||||
0019 0089 00062 movwf eeaddr
|
0019 0089 00062 movwf eeaddr
|
||||||
00063
|
00063
|
||||||
001A 1683 00064 bsf status,5 ;auf Bank 1
|
001A 1683 00064 bsf status,5 ;auf Bank 1
|
||||||
001B 1408 00065 bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
001B 1408 00065 bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||||
001C 1283 00066 bcf status,5 ;zurück auf Bank 0
|
001C 1283 00066 bcf status,5 ;zurück auf Bank 0
|
||||||
00067
|
00067
|
||||||
001D 0808 00068 movf eedata,w ;Wert ins W-Register
|
001D 0808 00068 movf eedata,w ;Wert ins W-Register
|
||||||
00069
|
00069
|
||||||
001E 0A8C 00070 incf count
|
001E 0A8C 00070 incf count
|
||||||
001F 080C 00071 movf count,w ;ist der Wert 40H erreicht
|
001F 080C 00071 movf count,w ;ist der Wert 40H erreicht
|
||||||
0020 3C40 00072 sublw 40h
|
0020 3C40 00072 sublw 40h
|
||||||
0021 1D03 00073 btfss status,2 ;wenn 0, dann fertig
|
0021 1D03 00073 btfss status,2 ;wenn 0, dann fertig
|
||||||
0022 2818 00074 goto lesen
|
0022 2818 00074 goto lesen
|
||||||
00075
|
00075
|
||||||
00076 ende
|
00076 ende
|
||||||
0023 2823 00077 goto ende
|
0023 2823 00077 goto ende
|
||||||
00078
|
00078
|
||||||
|
@ -1,76 +1,76 @@
|
|||||||
;TPicSim12
|
;TPicSim12
|
||||||
;Programm zum Test des 16F84-Simulators.
|
;Programm zum Test des 16F84-Simulators.
|
||||||
;Funktion: Beschreiben und Lesen des EEPROMs
|
;Funktion: Beschreiben und Lesen des EEPROMs
|
||||||
;(c) St. Lehmann Ersterstellung: 11.05.2011
|
;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||||
;Definition einiger Symbole
|
;Definition einiger Symbole
|
||||||
|
|
||||||
|
|
||||||
indirect equ 0
|
indirect equ 0
|
||||||
status equ 03h
|
status equ 03h
|
||||||
fsr equ 04h
|
fsr equ 04h
|
||||||
ra equ 05h
|
ra equ 05h
|
||||||
rb equ 06h
|
rb equ 06h
|
||||||
count equ 0ch
|
count equ 0ch
|
||||||
eedata equ 08h
|
eedata equ 08h
|
||||||
eeaddr equ 09h
|
eeaddr equ 09h
|
||||||
eecon1 equ 08h ;auf Bank 1
|
eecon1 equ 08h ;auf Bank 1
|
||||||
eecon2 equ 09h ;auf Bank 1
|
eecon2 equ 09h ;auf Bank 1
|
||||||
|
|
||||||
;Definition des Prozessors
|
;Definition des Prozessors
|
||||||
device 16F84
|
device 16F84
|
||||||
|
|
||||||
;Festlegen des Codebeginns
|
;Festlegen des Codebeginns
|
||||||
org 0
|
org 0
|
||||||
start
|
start
|
||||||
movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gef?llt
|
movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gef?llt
|
||||||
movwf count
|
movwf count
|
||||||
schreiben
|
schreiben
|
||||||
movf count,w
|
movf count,w
|
||||||
movwf eeaddr ;diese Adresse soll beschrieben werden
|
movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||||
xorlw 255 ;Adresse invertieren
|
xorlw 255 ;Adresse invertieren
|
||||||
movwf eedata ;dieser Wert an obige Adresse schreiben
|
movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||||
|
|
||||||
bsf status,5 ;auf Bank 1
|
bsf status,5 ;auf Bank 1
|
||||||
bcf eecon1,4 ;EEIF zur?cksetzen, wird ?berwacht
|
bcf eecon1,4 ;EEIF zur?cksetzen, wird ?berwacht
|
||||||
bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben m?glich
|
bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben m?glich
|
||||||
bsf eecon1,1 ;WR-Bit setzen
|
bsf eecon1,1 ;WR-Bit setzen
|
||||||
|
|
||||||
movlw 55h ;State-Machine anwerfen
|
movlw 55h ;State-Machine anwerfen
|
||||||
movwf eecon2
|
movwf eecon2
|
||||||
movlw 0AAh
|
movlw 0AAh
|
||||||
movwf eecon2 ;Schreibvorgang beginnt jetzt
|
movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||||
|
|
||||||
warte
|
warte
|
||||||
btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||||
goto warte
|
goto warte
|
||||||
|
|
||||||
bcf eecon1,2 ;WREN auf 0
|
bcf eecon1,2 ;WREN auf 0
|
||||||
|
|
||||||
bcf status,5 ;zur?ck auf Bank 0
|
bcf status,5 ;zur?ck auf Bank 0
|
||||||
|
|
||||||
incf count
|
incf count
|
||||||
movf count,w ;ist der Wert 40H erreicht
|
movf count,w ;ist der Wert 40H erreicht
|
||||||
sublw 40h
|
sublw 40h
|
||||||
btfss status,2 ;wenn 0, dann fertig
|
btfss status,2 ;wenn 0, dann fertig
|
||||||
goto schreiben
|
goto schreiben
|
||||||
|
|
||||||
|
|
||||||
clrf count ;jetzt gesamten Speicher lesen
|
clrf count ;jetzt gesamten Speicher lesen
|
||||||
lesen:
|
lesen:
|
||||||
movf count,w
|
movf count,w
|
||||||
movwf eeaddr
|
movwf eeaddr
|
||||||
|
|
||||||
bsf status,5 ;auf Bank 1
|
bsf status,5 ;auf Bank 1
|
||||||
bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||||
bcf status,5 ;zur?ck auf Bank 0
|
bcf status,5 ;zur?ck auf Bank 0
|
||||||
|
|
||||||
movf eedata,w ;Wert ins W-Register
|
movf eedata,w ;Wert ins W-Register
|
||||||
|
|
||||||
incf count
|
incf count
|
||||||
movf count,w ;ist der Wert 40H erreicht
|
movf count,w ;ist der Wert 40H erreicht
|
||||||
sublw 40h
|
sublw 40h
|
||||||
btfss status,2 ;wenn 0, dann fertig
|
btfss status,2 ;wenn 0, dann fertig
|
||||||
goto lesen
|
goto lesen
|
||||||
|
|
||||||
ende
|
ende
|
||||||
goto ende
|
goto ende
|
||||||
|
@ -1,78 +1,78 @@
|
|||||||
00001 ;TPicSim12
|
00001 ;TPicSim12
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Funktion: Beschreiben und Lesen des EEPROMs
|
00003 ;Funktion: Beschreiben und Lesen des EEPROMs
|
||||||
00004 ;(c) St. Lehmann Ersterstellung: 11.05.2011
|
00004 ;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||||
00005 ;Definition einiger Symbole
|
00005 ;Definition einiger Symbole
|
||||||
00006
|
00006
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 indirect equ 0
|
00009 indirect equ 0
|
||||||
00010 status equ 03h
|
00010 status equ 03h
|
||||||
00011 fsr equ 04h
|
00011 fsr equ 04h
|
||||||
00012 ra equ 05h
|
00012 ra equ 05h
|
||||||
00013 rb equ 06h
|
00013 rb equ 06h
|
||||||
00014 count equ 0ch
|
00014 count equ 0ch
|
||||||
00015 eedata equ 08h
|
00015 eedata equ 08h
|
||||||
00016 eeaddr equ 09h
|
00016 eeaddr equ 09h
|
||||||
00017 eecon1 equ 08h ;auf Bank 1
|
00017 eecon1 equ 08h ;auf Bank 1
|
||||||
00018 eecon2 equ 09h ;auf Bank 1
|
00018 eecon2 equ 09h ;auf Bank 1
|
||||||
00019
|
00019
|
||||||
00020 ;Definition des Prozessors
|
00020 ;Definition des Prozessors
|
||||||
00021 device 16F84
|
00021 device 16F84
|
||||||
00022
|
00022
|
||||||
00023 ;Festlegen des Codebeginns
|
00023 ;Festlegen des Codebeginns
|
||||||
00024 org 0
|
00024 org 0
|
||||||
00025 start
|
00025 start
|
||||||
0000 0020 00026 movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gefüllt
|
0000 0020 00026 movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gefüllt
|
||||||
0001 0060 00027 movwf count
|
0001 0060 00027 movwf count
|
||||||
00028 schreiben
|
00028 schreiben
|
||||||
0002 0040 00029 movf count,w
|
0002 0040 00029 movf count,w
|
||||||
0003 0000 00030 movwf eeaddr ;diese Adresse soll beschrieben werden
|
0003 0000 00030 movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||||
0004 3AFF 00031 xorlw 255 ;Adresse invertieren
|
0004 3AFF 00031 xorlw 255 ;Adresse invertieren
|
||||||
0005 0088 00032 movwf eedata ;dieser Wert an obige Adresse schreiben
|
0005 0088 00032 movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||||
00033
|
00033
|
||||||
0006 1683 00034 bsf status,5 ;auf Bank 1
|
0006 1683 00034 bsf status,5 ;auf Bank 1
|
||||||
0007 1208 00035 bcf eecon1,4 ;EEIF zurücksetzen, wird überwacht
|
0007 1208 00035 bcf eecon1,4 ;EEIF zurücksetzen, wird überwacht
|
||||||
0008 1508 00036 bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben möglich
|
0008 1508 00036 bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben möglich
|
||||||
0009 1488 00037 bsf eecon1,1 ;WR-Bit setzen
|
0009 1488 00037 bsf eecon1,1 ;WR-Bit setzen
|
||||||
00038
|
00038
|
||||||
000A 3055 00039 movlw 55h ;State-Machine anwerfen
|
000A 3055 00039 movlw 55h ;State-Machine anwerfen
|
||||||
000B 0089 00040 movwf eecon2
|
000B 0089 00040 movwf eecon2
|
||||||
000C 30AA 00041 movlw 0AAh
|
000C 30AA 00041 movlw 0AAh
|
||||||
000D 0089 00042 movwf eecon2 ;Schreibvorgang beginnt jetzt
|
000D 0089 00042 movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||||
00043
|
00043
|
||||||
00044 warte
|
00044 warte
|
||||||
000E 1E08 00045 btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
000E 1E08 00045 btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||||
000F 280E 00046 goto warte
|
000F 280E 00046 goto warte
|
||||||
00047
|
00047
|
||||||
0010 1108 00048 bcf eecon1,2 ;WREN auf 0
|
0010 1108 00048 bcf eecon1,2 ;WREN auf 0
|
||||||
00049
|
00049
|
||||||
0011 1283 00050 bcf status,5 ;zurück auf Bank 0
|
0011 1283 00050 bcf status,5 ;zurück auf Bank 0
|
||||||
00051
|
00051
|
||||||
0012 0A8C 00052 incf count
|
0012 0A8C 00052 incf count
|
||||||
0013 080C 00053 movf count,w ;ist der Wert 40H erreicht
|
0013 080C 00053 movf count,w ;ist der Wert 40H erreicht
|
||||||
0014 3C40 00054 sublw 40h
|
0014 3C40 00054 sublw 40h
|
||||||
0015 1D03 00055 btfss status,2 ;wenn 0, dann fertig
|
0015 1D03 00055 btfss status,2 ;wenn 0, dann fertig
|
||||||
0016 2802 00056 goto schreiben
|
0016 2802 00056 goto schreiben
|
||||||
00057
|
00057
|
||||||
00058
|
00058
|
||||||
0017 018C 00059 clrf count ;jetzt gesamten Speicher lesen
|
0017 018C 00059 clrf count ;jetzt gesamten Speicher lesen
|
||||||
00060 lesen:
|
00060 lesen:
|
||||||
0018 080C 00061 movf count,w
|
0018 080C 00061 movf count,w
|
||||||
0019 0089 00062 movwf eeaddr
|
0019 0089 00062 movwf eeaddr
|
||||||
00063
|
00063
|
||||||
001A 1683 00064 bsf status,5 ;auf Bank 1
|
001A 1683 00064 bsf status,5 ;auf Bank 1
|
||||||
001B 1408 00065 bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
001B 1408 00065 bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||||
001C 1283 00066 bcf status,5 ;zurück auf Bank 0
|
001C 1283 00066 bcf status,5 ;zurück auf Bank 0
|
||||||
00067
|
00067
|
||||||
001D 0808 00068 movf eedata,w ;Wert ins W-Register
|
001D 0808 00068 movf eedata,w ;Wert ins W-Register
|
||||||
00069
|
00069
|
||||||
001E 0A8C 00070 incf count
|
001E 0A8C 00070 incf count
|
||||||
001F 080C 00071 movf count,w ;ist der Wert 40H erreicht
|
001F 080C 00071 movf count,w ;ist der Wert 40H erreicht
|
||||||
0020 3C40 00072 sublw 40h
|
0020 3C40 00072 sublw 40h
|
||||||
0021 1D03 00073 btfss status,2 ;wenn 0, dann fertig
|
0021 1D03 00073 btfss status,2 ;wenn 0, dann fertig
|
||||||
0022 2818 00074 goto lesen
|
0022 2818 00074 goto lesen
|
||||||
00075
|
00075
|
||||||
00076 ende
|
00076 ende
|
||||||
0023 2823 00077 goto ende
|
0023 2823 00077 goto ende
|
||||||
00078
|
00078
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
00001 ;TPicSim2
|
00001 ;TPicSim2
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es werden CALL, GOTO, RETLW, RETURN geprüft (kein RETFIE)
|
00003 ;Es werden CALL, GOTO, RETLW, RETURN geprüft (kein RETFIE)
|
||||||
00004 ;(c) St. Lehmann
|
00004 ;(c) St. Lehmann
|
||||||
00005 ;Ersterstellung: 23.03.2016
|
00005 ;Ersterstellung: 23.03.2016
|
||||||
00006 ;
|
00006 ;
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 ;Definition einiger Symbole
|
00009 ;Definition einiger Symbole
|
||||||
00010 ;zuerst Hardware-Register
|
00010 ;zuerst Hardware-Register
|
||||||
00011 status equ 03h
|
00011 status equ 03h
|
||||||
00012 ra equ 05h
|
00012 ra equ 05h
|
||||||
00013 rb equ 06h
|
00013 rb equ 06h
|
||||||
00014
|
00014
|
||||||
00015 ;für den Benutzer frei verwendbare Register
|
00015 ;für den Benutzer frei verwendbare Register
|
||||||
00016 count equ 0ch
|
00016 count equ 0ch
|
||||||
00017
|
00017
|
||||||
00018 ;Definition des Prozessors
|
00018 ;Definition des Prozessors
|
||||||
00019 device 16F84
|
00019 device 16F84
|
||||||
00020
|
00020
|
||||||
00021 ;Festlegen des Codebeginns
|
00021 ;Festlegen des Codebeginns
|
||||||
00022 org 0
|
00022 org 0
|
||||||
00023 loop
|
00023 loop
|
||||||
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unverändert
|
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unverändert
|
||||||
0001 2006 00025 call up1 ;beim Call wird Rücksprungadresse auf Stack gelegt
|
0001 2006 00025 call up1 ;beim Call wird Rücksprungadresse auf Stack gelegt
|
||||||
0002 0000 00026 nop ;W = 36h, C=0, DC=0, Z=0
|
0002 0000 00026 nop ;W = 36h, C=0, DC=0, Z=0
|
||||||
0003 2008 00027 call up2 ;in W steht der Rückgabewert
|
0003 2008 00027 call up2 ;in W steht der Rückgabewert
|
||||||
0004 0000 00028 nop ;W = 77h, DC=0, C=0, Z=0;
|
0004 0000 00028 nop ;W = 77h, DC=0, C=0, Z=0;
|
||||||
0005 2800 00029 goto loop
|
0005 2800 00029 goto loop
|
||||||
00030
|
00030
|
||||||
00031 ;UP1 zählt zu W den Wert 25h hinzu und kehrt mit RETURN zurück
|
00031 ;UP1 zählt zu W den Wert 25h hinzu und kehrt mit RETURN zurück
|
||||||
0006 3E25 00032 up1 addlw 25h ;W = 36h, DC=0, C=0, Z=0
|
0006 3E25 00032 up1 addlw 25h ;W = 36h, DC=0, C=0, Z=0
|
||||||
0007 0008 00033 return
|
0007 0008 00033 return
|
||||||
00034
|
00034
|
||||||
00035 ;UP2 kehrt mit der Konstanten 77h zurück
|
00035 ;UP2 kehrt mit der Konstanten 77h zurück
|
||||||
0008 3477 00036 up2 retlw 77h
|
0008 3477 00036 up2 retlw 77h
|
||||||
00037
|
00037
|
||||||
00038 ende
|
00038 ende
|
||||||
0009 2809 00039 goto ende ;Endlosschleife, verhindert Nirwana
|
0009 2809 00039 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00040
|
00040
|
||||||
00041
|
00041
|
||||||
|
@ -1,64 +1,64 @@
|
|||||||
00001 ;TPicSim3
|
00001 ;TPicSim3
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es werden die Byte-orientieren File-Register Befehle geprüft
|
00003 ;Es werden die Byte-orientieren File-Register Befehle geprüft
|
||||||
00004 ;aber kein DECFSZ, INCFSZ, RLF, RRF
|
00004 ;aber kein DECFSZ, INCFSZ, RLF, RRF
|
||||||
00005 ;(c) St. Lehmann
|
00005 ;(c) St. Lehmann
|
||||||
00006 ;Ersterstellung: 23.03.2016
|
00006 ;Ersterstellung: 23.03.2016
|
||||||
00007
|
00007
|
||||||
00008 ;Hinweis:
|
00008 ;Hinweis:
|
||||||
00009 ;Bei diesen Befehlen entscheidet das d-Bit (Destination), ob das Ergebnis
|
00009 ;Bei diesen Befehlen entscheidet das d-Bit (Destination), ob das Ergebnis
|
||||||
00010 ;dieser Operation ins W- oder File-Register geschrieben wird. Wird im
|
00010 ;dieser Operation ins W- oder File-Register geschrieben wird. Wird im
|
||||||
00011 ;Assemblercode der Befehl mit ",W" geschrieben, bedeutet dies, dass das
|
00011 ;Assemblercode der Befehl mit ",W" geschrieben, bedeutet dies, dass das
|
||||||
00012 ;d-Bit 0 ist und das Ergebnis ins W-Register kommt. Fehlt ",W" ist das
|
00012 ;d-Bit 0 ist und das Ergebnis ins W-Register kommt. Fehlt ",W" ist das
|
||||||
00013 ;d-Bit 1 und das Ergebnis wird ins Fileregister geschrieben.
|
00013 ;d-Bit 1 und das Ergebnis wird ins Fileregister geschrieben.
|
||||||
00014 ;
|
00014 ;
|
||||||
00015 ;Alle Befehle die eine Fileregister-Adresse haben, können auch "indirekt"
|
00015 ;Alle Befehle die eine Fileregister-Adresse haben, können auch "indirekt"
|
||||||
00016 ;adressieren. Dies ist im Testfile TPicSim6.LST beschrieben.
|
00016 ;adressieren. Dies ist im Testfile TPicSim6.LST beschrieben.
|
||||||
00017 ;
|
00017 ;
|
||||||
00018 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00018 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00019
|
00019
|
||||||
00020 ;Definition einiger Symbole
|
00020 ;Definition einiger Symbole
|
||||||
00021 ;zuerst Hardware-Register
|
00021 ;zuerst Hardware-Register
|
||||||
00022 status equ 03h
|
00022 status equ 03h
|
||||||
00023 ra equ 05h
|
00023 ra equ 05h
|
||||||
00024 rb equ 06h
|
00024 rb equ 06h
|
||||||
00025
|
00025
|
||||||
00026 ;für den Benutzer frei verwendbare Register
|
00026 ;für den Benutzer frei verwendbare Register
|
||||||
00027 wert1 equ 0ch ;Variable Nr.1
|
00027 wert1 equ 0ch ;Variable Nr.1
|
||||||
00028 wert2 equ 0dh ;Variable Nr.2
|
00028 wert2 equ 0dh ;Variable Nr.2
|
||||||
00029 ergeb equ 0eh ;Variable Nr.3
|
00029 ergeb equ 0eh ;Variable Nr.3
|
||||||
00030
|
00030
|
||||||
00031 ;Definition des Prozessors
|
00031 ;Definition des Prozessors
|
||||||
00032 device 16F84
|
00032 device 16F84
|
||||||
00033
|
00033
|
||||||
00034 ;Festlegen des Codebeginns
|
00034 ;Festlegen des Codebeginns
|
||||||
00035 org 0
|
00035 org 0
|
||||||
00036 loop
|
00036 loop
|
||||||
0000 3011 00037 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
0000 3011 00037 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||||
0001 008C 00038 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
0001 008C 00038 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||||
0002 3014 00039 movlw 14h ;W = 14h, DC=?, C=?, Z=?
|
0002 3014 00039 movlw 14h ;W = 14h, DC=?, C=?, Z=?
|
||||||
0003 070C 00040 addwf wert1,w ;W = 25h, DC=0, C=0, Z=0
|
0003 070C 00040 addwf wert1,w ;W = 25h, DC=0, C=0, Z=0
|
||||||
0004 078C 00041 addwf wert1 ;W = 25h, wert1 = 36h, DC=0, C=0, Z=0
|
0004 078C 00041 addwf wert1 ;W = 25h, wert1 = 36h, DC=0, C=0, Z=0
|
||||||
0005 050C 00042 andwf wert1,w ;W = 24h, wert1 = 36h, DC=0, C=0, Z=0
|
0005 050C 00042 andwf wert1,w ;W = 24h, wert1 = 36h, DC=0, C=0, Z=0
|
||||||
0006 008D 00043 movwf wert2 ;W=24h, wert1=36, wert2=24h
|
0006 008D 00043 movwf wert2 ;W=24h, wert1=36, wert2=24h
|
||||||
0007 018C 00044 clrf wert1 ;W=24h, wert1=0, wert2=24h, DC=0, C=0, Z=1
|
0007 018C 00044 clrf wert1 ;W=24h, wert1=0, wert2=24h, DC=0, C=0, Z=1
|
||||||
0008 090D 00045 comf wert2,w ;W=DBh, wert1=0, wert2=24h, DC=0, C=0, Z=0
|
0008 090D 00045 comf wert2,w ;W=DBh, wert1=0, wert2=24h, DC=0, C=0, Z=0
|
||||||
0009 030C 00046 decf wert1,w ;W=FFh, wert1=0, wert2=24h, DC=0, C=0, Z=0
|
0009 030C 00046 decf wert1,w ;W=FFh, wert1=0, wert2=24h, DC=0, C=0, Z=0
|
||||||
000A 0A8D 00047 incf wert2 ;W=FFh, wert1=0, wert2=25h, DC=0, C=0, Z=0
|
000A 0A8D 00047 incf wert2 ;W=FFh, wert1=0, wert2=25h, DC=0, C=0, Z=0
|
||||||
000B 088C 00048 movf wert1 ;W=FFh, wert1=0, wert2=25h, DC=0, C=0, Z=1
|
000B 088C 00048 movf wert1 ;W=FFh, wert1=0, wert2=25h, DC=0, C=0, Z=1
|
||||||
000C 048C 00049 iorwf wert1 ;W=FFh, wert1=FFh, wert2=25h, DC=0, C=0, Z=0
|
000C 048C 00049 iorwf wert1 ;W=FFh, wert1=FFh, wert2=25h, DC=0, C=0, Z=0
|
||||||
000D 020D 00050 subwf wert2,w ;W=26h, wert1=FFh, wert2=25h, DC=0, C=0, Z=0
|
000D 020D 00050 subwf wert2,w ;W=26h, wert1=FFh, wert2=25h, DC=0, C=0, Z=0
|
||||||
000E 0E8D 00051 swapf wert2 ;W=26h, wert1=FFh, wert2=52h, DC=0, C=0, Z=0
|
000E 0E8D 00051 swapf wert2 ;W=26h, wert1=FFh, wert2=52h, DC=0, C=0, Z=0
|
||||||
000F 068C 00052 xorwf wert1 ;W=26h, wert1=D9h, wert2=52h, DC=0, C=0, Z=0
|
000F 068C 00052 xorwf wert1 ;W=26h, wert1=D9h, wert2=52h, DC=0, C=0, Z=0
|
||||||
0010 0100 00053 clrw ;W=00h, wert1=D9h, wert2=52h, DC=0, C=0, Z=1
|
0010 0100 00053 clrw ;W=00h, wert1=D9h, wert2=52h, DC=0, C=0, Z=1
|
||||||
00054
|
00054
|
||||||
0011 020C 00055 subwf wert1,w ;W=D9h, wert1=D9h, wert2=52h, DC=1, C=1, Z=0
|
0011 020C 00055 subwf wert1,w ;W=D9h, wert1=D9h, wert2=52h, DC=1, C=1, Z=0
|
||||||
0012 020D 00056 subwf wert2,w ;W=79h, wert1=D9h, wert2=52h, DC=0, C=0, Z=0
|
0012 020D 00056 subwf wert2,w ;W=79h, wert1=D9h, wert2=52h, DC=0, C=0, Z=0
|
||||||
0013 028D 00057 subwf wert2 ;W=79h, wert1=D9h, wert2=D9h, DC=0, C=0, Z=0
|
0013 028D 00057 subwf wert2 ;W=79h, wert1=D9h, wert2=D9h, DC=0, C=0, Z=0
|
||||||
0014 028D 00058 subwf wert2 ;W=79h, wert1=D9h, wert2=60h, DC=1, C=1, Z=0
|
0014 028D 00058 subwf wert2 ;W=79h, wert1=D9h, wert2=60h, DC=1, C=1, Z=0
|
||||||
00059
|
00059
|
||||||
00060
|
00060
|
||||||
00061 ende
|
00061 ende
|
||||||
0015 2815 00062 goto ende ;Endlosschleife, verhindert Nirwana
|
0015 2815 00062 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00063
|
00063
|
||||||
00064
|
00064
|
||||||
|
@ -1,80 +1,80 @@
|
|||||||
00001 ;TPicSim4
|
00001 ;TPicSim4
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es werden die Befehle DECFSZ, INCFSZ, RLF, RRF geprüft
|
00003 ;Es werden die Befehle DECFSZ, INCFSZ, RLF, RRF geprüft
|
||||||
00004 ;(c) St. Lehmann
|
00004 ;(c) St. Lehmann
|
||||||
00005 ;Ersterstellung: 23.03.2016
|
00005 ;Ersterstellung: 23.03.2016
|
||||||
00006 ;
|
00006 ;
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 ;Definition einiger Symbole
|
00009 ;Definition einiger Symbole
|
||||||
00010 ;zuerst Hardware-Register
|
00010 ;zuerst Hardware-Register
|
||||||
00011 status equ 03h
|
00011 status equ 03h
|
||||||
00012 ra equ 05h
|
00012 ra equ 05h
|
||||||
00013 rb equ 06h
|
00013 rb equ 06h
|
||||||
00014
|
00014
|
||||||
00015 ;für den Benutzer frei verwendbare Register
|
00015 ;für den Benutzer frei verwendbare Register
|
||||||
00016 wert1 equ 0ch ;Variable Nr.1
|
00016 wert1 equ 0ch ;Variable Nr.1
|
||||||
00017 wert2 equ 0dh ;Variable Nr.2
|
00017 wert2 equ 0dh ;Variable Nr.2
|
||||||
00018 ergeb equ 0eh ;Variable Nr.3
|
00018 ergeb equ 0eh ;Variable Nr.3
|
||||||
00019
|
00019
|
||||||
00020 ;Definition des Prozessors
|
00020 ;Definition des Prozessors
|
||||||
00021 device 16F84
|
00021 device 16F84
|
||||||
00022
|
00022
|
||||||
00023 ;Festlegen des Codebeginns
|
00023 ;Festlegen des Codebeginns
|
||||||
00024 org 0
|
00024 org 0
|
||||||
00025 loop
|
00025 loop
|
||||||
0000 3011 00026 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
0000 3011 00026 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||||
0001 008C 00027 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
0001 008C 00027 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||||
0002 3E11 00028 addlw 11h ;löscht u.a. das Carry-Flag, DC=0, C=0, Z=0
|
0002 3E11 00028 addlw 11h ;löscht u.a. das Carry-Flag, DC=0, C=0, Z=0
|
||||||
0003 0D8C 00029 rlf wert1 ;W=22h, wert1=22h, wert2=?? , DC=0, C=0, Z=0
|
0003 0D8C 00029 rlf wert1 ;W=22h, wert1=22h, wert2=?? , DC=0, C=0, Z=0
|
||||||
0004 0D8C 00030 rlf wert1 ;W=22h, wert1=44h, wert2=?? , DC=0, C=0, Z=0
|
0004 0D8C 00030 rlf wert1 ;W=22h, wert1=44h, wert2=?? , DC=0, C=0, Z=0
|
||||||
0005 0D8C 00031 rlf wert1 ;W=22h, wert1=88h, wert2=?? , DC=0, C=0, Z=0
|
0005 0D8C 00031 rlf wert1 ;W=22h, wert1=88h, wert2=?? , DC=0, C=0, Z=0
|
||||||
0006 0D0C 00032 rlf wert1,w ;W=10h, wert1=88h, wert2=?? , DC=0, C=1, Z=0
|
0006 0D0C 00032 rlf wert1,w ;W=10h, wert1=88h, wert2=?? , DC=0, C=1, Z=0
|
||||||
0007 0D8C 00033 rlf wert1 ;W=10h, wert1=11h, wert2=?? , DC=0, C=1, Z=0
|
0007 0D8C 00033 rlf wert1 ;W=10h, wert1=11h, wert2=?? , DC=0, C=1, Z=0
|
||||||
0008 0D0C 00034 rlf wert1,w ;W=23h, wert1=11h, wert2=?? , DC=0, C=0, Z=0
|
0008 0D0C 00034 rlf wert1,w ;W=23h, wert1=11h, wert2=?? , DC=0, C=0, Z=0
|
||||||
0009 0C8C 00035 rrf wert1 ;W=23h, wert1=08h, wert2=?? , DC=0, C=0, Z=0
|
0009 0C8C 00035 rrf wert1 ;W=23h, wert1=08h, wert2=?? , DC=0, C=0, Z=0
|
||||||
000A 008D 00036 movwf wert2 ;W=23h, wert1=08h, wert2=23h, DC=0, C=0, Z=0
|
000A 008D 00036 movwf wert2 ;W=23h, wert1=08h, wert2=23h, DC=0, C=0, Z=0
|
||||||
000B 0C8D 00037 rrf wert2 ;W=23h, wert1=08h, wert2=91h, DC=0, C=1, Z=0
|
000B 0C8D 00037 rrf wert2 ;W=23h, wert1=08h, wert2=91h, DC=0, C=1, Z=0
|
||||||
000C 0C0D 00038 rrf wert2,w ;W=C8h, wert1=08h, wert2=91h, DC=0, C=1, Z=0
|
000C 0C0D 00038 rrf wert2,w ;W=C8h, wert1=08h, wert2=91h, DC=0, C=1, Z=0
|
||||||
00039
|
00039
|
||||||
000D 3009 00040 movlw 9 ;W=09h, wert1=08h, wert2=10h, DC=0, C=1, Z=0
|
000D 3009 00040 movlw 9 ;W=09h, wert1=08h, wert2=10h, DC=0, C=1, Z=0
|
||||||
000E 008C 00041 movwf wert1 ;W=09h, wert1=09h, wert2=10h, DC=0, C=1, Z=0
|
000E 008C 00041 movwf wert1 ;W=09h, wert1=09h, wert2=10h, DC=0, C=1, Z=0
|
||||||
000F 0100 00042 clrw ;W=00h, wert1=09h, wert2=10h, DC=0, C=1, Z=1
|
000F 0100 00042 clrw ;W=00h, wert1=09h, wert2=10h, DC=0, C=1, Z=1
|
||||||
00043 loop1
|
00043 loop1
|
||||||
0010 3E01 00044 addlw 1 ;W=01h, DC=0, C=0, Z=0
|
0010 3E01 00044 addlw 1 ;W=01h, DC=0, C=0, Z=0
|
||||||
00045 ;W=02h, DC=0, C=0, Z=0
|
00045 ;W=02h, DC=0, C=0, Z=0
|
||||||
00046 ;W=03h, DC=0, C=0, Z=0
|
00046 ;W=03h, DC=0, C=0, Z=0
|
||||||
00047 ;W=04h, DC=0, C=0, Z=0
|
00047 ;W=04h, DC=0, C=0, Z=0
|
||||||
00048 ;W=05h, DC=0, C=0, Z=0
|
00048 ;W=05h, DC=0, C=0, Z=0
|
||||||
00049 ;W=06h, DC=0, C=0, Z=0
|
00049 ;W=06h, DC=0, C=0, Z=0
|
||||||
00050 ;W=07h, DC=0, C=0, Z=0
|
00050 ;W=07h, DC=0, C=0, Z=0
|
||||||
00051 ;W=08h, DC=0, C=0, Z=0
|
00051 ;W=08h, DC=0, C=0, Z=0
|
||||||
00052 ;W=09h, DC=0, C=0, Z=0
|
00052 ;W=09h, DC=0, C=0, Z=0
|
||||||
0011 078D 00053 addwf wert2 ;wert2=92h, DC=0, C=0, Z=0
|
0011 078D 00053 addwf wert2 ;wert2=92h, DC=0, C=0, Z=0
|
||||||
00054 ;wert2=94h, DC=0, C=0, Z=0
|
00054 ;wert2=94h, DC=0, C=0, Z=0
|
||||||
00055 ;wert2=97h, DC=0, C=0, Z=0
|
00055 ;wert2=97h, DC=0, C=0, Z=0
|
||||||
00056 ;wert2=9Bh, DC=0, C=0, Z=0
|
00056 ;wert2=9Bh, DC=0, C=0, Z=0
|
||||||
00057 ;wert2=A0h, DC=0, C=1, Z=0
|
00057 ;wert2=A0h, DC=0, C=1, Z=0
|
||||||
00058 ;wert2=A6h, DC=0, C=0, Z=0
|
00058 ;wert2=A6h, DC=0, C=0, Z=0
|
||||||
00059 ;wert2=ADh, DC=0, C=0, Z=0
|
00059 ;wert2=ADh, DC=0, C=0, Z=0
|
||||||
00060 ;wert2=B5h, DC=0, C=1, Z=0
|
00060 ;wert2=B5h, DC=0, C=1, Z=0
|
||||||
00061 ;wert2=BEh, DC=0, C=0, Z=0
|
00061 ;wert2=BEh, DC=0, C=0, Z=0
|
||||||
0012 0B8C 00062 decfsz wert1 ;wert1=08h, wert1=07h, ... DC,C und Z bleiben unverändert
|
0012 0B8C 00062 decfsz wert1 ;wert1=08h, wert1=07h, ... DC,C und Z bleiben unverändert
|
||||||
0013 2810 00063 goto loop1
|
0013 2810 00063 goto loop1
|
||||||
00064
|
00064
|
||||||
0014 30F0 00065 movlw 0f0h ;Wert wird bis 00h (über FFh) hochgezählt
|
0014 30F0 00065 movlw 0f0h ;Wert wird bis 00h (über FFh) hochgezählt
|
||||||
0015 008C 00066 movwf wert1
|
0015 008C 00066 movwf wert1
|
||||||
0016 018D 00067 clrf wert2
|
0016 018D 00067 clrf wert2
|
||||||
0017 0100 00068 clrw
|
0017 0100 00068 clrw
|
||||||
00069 loop2
|
00069 loop2
|
||||||
0018 070C 00070 addwf wert1,w ;W=F0h, DC=0, C=0, Z=0
|
0018 070C 00070 addwf wert1,w ;W=F0h, DC=0, C=0, Z=0
|
||||||
00071
|
00071
|
||||||
00072
|
00072
|
||||||
0019 0A8D 00073 incf wert2 ;wert2=F1h, DC=
|
0019 0A8D 00073 incf wert2 ;wert2=F1h, DC=
|
||||||
001A 0F8C 00074 incfsz wert1
|
001A 0F8C 00074 incfsz wert1
|
||||||
001B 2818 00075 goto loop2
|
001B 2818 00075 goto loop2
|
||||||
00076
|
00076
|
||||||
00077 ende
|
00077 ende
|
||||||
001C 281C 00078 goto ende ;Endlosschleife, verhindert Nirwana
|
001C 281C 00078 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00079
|
00079
|
||||||
00080
|
00080
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
00001 ;TPicSim5
|
00001 ;TPicSim5
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es werden die Befehle BCF, BSF, BTFSC und BTFSS geprüft
|
00003 ;Es werden die Befehle BCF, BSF, BTFSC und BTFSS geprüft
|
||||||
00004 ;(c) St. Lehmann
|
00004 ;(c) St. Lehmann
|
||||||
00005 ;Ersterstellung: 23.03.2016
|
00005 ;Ersterstellung: 23.03.2016
|
||||||
00006 ;
|
00006 ;
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 ;Definition einiger Symbole
|
00009 ;Definition einiger Symbole
|
||||||
00010 ;zuerst Hardware-Register
|
00010 ;zuerst Hardware-Register
|
||||||
00011 status equ 03h
|
00011 status equ 03h
|
||||||
00012 ra equ 05h
|
00012 ra equ 05h
|
||||||
00013 rb equ 06h
|
00013 rb equ 06h
|
||||||
00014
|
00014
|
||||||
00015 ;für den Benutzer frei verwendbare Register
|
00015 ;für den Benutzer frei verwendbare Register
|
||||||
00016 wert1 equ 0ch ;Variable Nr.1
|
00016 wert1 equ 0ch ;Variable Nr.1
|
||||||
00017 wert2 equ 0dh ;Variable Nr.2
|
00017 wert2 equ 0dh ;Variable Nr.2
|
||||||
00018 ergeb equ 0eh ;Variable Nr.3
|
00018 ergeb equ 0eh ;Variable Nr.3
|
||||||
00019
|
00019
|
||||||
00020 ;Definition des Prozessors
|
00020 ;Definition des Prozessors
|
||||||
00021 device 16F84
|
00021 device 16F84
|
||||||
00022
|
00022
|
||||||
00023 ;Festlegen des Codebeginns
|
00023 ;Festlegen des Codebeginns
|
||||||
00024 org 0
|
00024 org 0
|
||||||
00025 loop
|
00025 loop
|
||||||
0000 3011 00026 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
0000 3011 00026 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||||
0001 008C 00027 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
0001 008C 00027 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||||
0002 018D 00028 clrf wert2 ;W=11h, wert1=11h, wert2=00h, DC=?, C=?, Z=1
|
0002 018D 00028 clrf wert2 ;W=11h, wert1=11h, wert2=00h, DC=?, C=?, Z=1
|
||||||
0003 178C 00029 bsf wert1,7 ;W=11h, wert1=91h, wert2=00h, DC=?, C=?, Z=1
|
0003 178C 00029 bsf wert1,7 ;W=11h, wert1=91h, wert2=00h, DC=?, C=?, Z=1
|
||||||
0004 158C 00030 bsf wert1,3 ;W=11h, wert1=99h, wert2=00h, DC=?, C=?, Z=1
|
0004 158C 00030 bsf wert1,3 ;W=11h, wert1=99h, wert2=00h, DC=?, C=?, Z=1
|
||||||
0005 120C 00031 bcf wert1,4 ;W=11h, wert1=89h, wert2=00h, DC=?, C=?, Z=1
|
0005 120C 00031 bcf wert1,4 ;W=11h, wert1=89h, wert2=00h, DC=?, C=?, Z=1
|
||||||
0006 100C 00032 bcf wert1,0 ;W=11h, wert1=88h, wert2=00h, DC=?, C=?, Z=1
|
0006 100C 00032 bcf wert1,0 ;W=11h, wert1=88h, wert2=00h, DC=?, C=?, Z=1
|
||||||
00033
|
00033
|
||||||
0007 180C 00034 btfsc wert1,0
|
0007 180C 00034 btfsc wert1,0
|
||||||
0008 0A8D 00035 incf wert2
|
0008 0A8D 00035 incf wert2
|
||||||
0009 0A8D 00036 incf wert2
|
0009 0A8D 00036 incf wert2
|
||||||
000A 198C 00037 btfsc wert1,3
|
000A 198C 00037 btfsc wert1,3
|
||||||
000B 0A8D 00038 incf wert2
|
000B 0A8D 00038 incf wert2
|
||||||
000C 0A8D 00039 incf wert2
|
000C 0A8D 00039 incf wert2
|
||||||
000D 1D0C 00040 btfss wert1,2
|
000D 1D0C 00040 btfss wert1,2
|
||||||
000E 0A8D 00041 incf wert2
|
000E 0A8D 00041 incf wert2
|
||||||
000F 0A8D 00042 incf wert2
|
000F 0A8D 00042 incf wert2
|
||||||
0010 1F8C 00043 btfss wert1,7
|
0010 1F8C 00043 btfss wert1,7
|
||||||
0011 0A8D 00044 incf wert2
|
0011 0A8D 00044 incf wert2
|
||||||
0012 038D 00045 decf wert2 ;in wert2 muss 04h stehen
|
0012 038D 00045 decf wert2 ;in wert2 muss 04h stehen
|
||||||
00046
|
00046
|
||||||
00047 ende
|
00047 ende
|
||||||
0013 2813 00048 goto ende ;Endlosschleife, verhindert Nirwana
|
0013 2813 00048 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00049
|
00049
|
||||||
00050
|
00050
|
||||||
|
@ -1,95 +1,95 @@
|
|||||||
00001 ;TPicSim6
|
00001 ;TPicSim6
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es werden die Byte-orientieren File-Register-Befehle im
|
00003 ;Es werden die Byte-orientieren File-Register-Befehle im
|
||||||
00004 ;Zusammenhang mit der indirekten Adressierung geprüft
|
00004 ;Zusammenhang mit der indirekten Adressierung geprüft
|
||||||
00005 ;
|
00005 ;
|
||||||
00006 ;(c) St. Lehmann
|
00006 ;(c) St. Lehmann
|
||||||
00007 ;Ersterstellung: 23.03.2016
|
00007 ;Ersterstellung: 23.03.2016
|
||||||
00008
|
00008
|
||||||
00009 ;Hinweis:
|
00009 ;Hinweis:
|
||||||
00010 ;Bei der indirekten Adressierung werden die Register "IND" oder auch als
|
00010 ;Bei der indirekten Adressierung werden die Register "IND" oder auch als
|
||||||
00011 ;"indirect addr" bezeichnet und das Register FSR (File Select Register)
|
00011 ;"indirect addr" bezeichnet und das Register FSR (File Select Register)
|
||||||
00012 ;benutzt. Dabei beinhaltet das FSR-Register die Zieladresse in die etwas
|
00012 ;benutzt. Dabei beinhaltet das FSR-Register die Zieladresse in die etwas
|
||||||
00013 ;geschrieben oder von der etwas gelesen werden soll. Der eigentliche
|
00013 ;geschrieben oder von der etwas gelesen werden soll. Der eigentliche
|
||||||
00014 ;Zugriff erfolgt über das Ansprechen der Registeradresse 0 (IND). Der PIC
|
00014 ;Zugriff erfolgt über das Ansprechen der Registeradresse 0 (IND). Der PIC
|
||||||
00015 ;ersetzt in dem Falle die Adresse 0 durch die Adresse im FSR-Register.
|
00015 ;ersetzt in dem Falle die Adresse 0 durch die Adresse im FSR-Register.
|
||||||
00016 ;Da die Adresse im FSR-Register 8-Bit umfasst, die Adresse bei der direkten
|
00016 ;Da die Adresse im FSR-Register 8-Bit umfasst, die Adresse bei der direkten
|
||||||
00017 ;Adressierung jedoch nur 7 Bit, kann man durch die indirekte Adressierung
|
00017 ;Adressierung jedoch nur 7 Bit, kann man durch die indirekte Adressierung
|
||||||
00018 ;auch auf Bank 1 zugreifen ohne das RP0-Bit zu setzen.
|
00018 ;auch auf Bank 1 zugreifen ohne das RP0-Bit zu setzen.
|
||||||
00019 ;
|
00019 ;
|
||||||
00020 ;Bei diesen Befehlen entscheidet das d-Bit (Destination), ob das Ergebnis
|
00020 ;Bei diesen Befehlen entscheidet das d-Bit (Destination), ob das Ergebnis
|
||||||
00021 ;dieser Operation ins W- oder File-Register geschrieben wird. Wird im
|
00021 ;dieser Operation ins W- oder File-Register geschrieben wird. Wird im
|
||||||
00022 ;Assemblercode der Befehl mit ",W" geschrieben, bedeutet dies, dass das
|
00022 ;Assemblercode der Befehl mit ",W" geschrieben, bedeutet dies, dass das
|
||||||
00023 ;d-Bit 0 ist und das Ergebnis ins W-Register kommt. Fehlt ",W" ist das
|
00023 ;d-Bit 0 ist und das Ergebnis ins W-Register kommt. Fehlt ",W" ist das
|
||||||
00024 ;d-Bit 1 und das Ergebnis wird ins Fileregister geschrieben.
|
00024 ;d-Bit 1 und das Ergebnis wird ins Fileregister geschrieben.
|
||||||
00025 ;
|
00025 ;
|
||||||
00026 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00026 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00027
|
00027
|
||||||
00028 ;Definition einiger Symbole
|
00028 ;Definition einiger Symbole
|
||||||
00029 ;zuerst Hardware-Register
|
00029 ;zuerst Hardware-Register
|
||||||
00030 indirect equ 00h
|
00030 indirect equ 00h
|
||||||
00031 status equ 03h
|
00031 status equ 03h
|
||||||
00032 fsr equ 04h
|
00032 fsr equ 04h
|
||||||
00033 ra equ 05h
|
00033 ra equ 05h
|
||||||
00034 rb equ 06h
|
00034 rb equ 06h
|
||||||
00035
|
00035
|
||||||
00036 ;für den Benutzer frei verwendbare Register
|
00036 ;für den Benutzer frei verwendbare Register
|
||||||
00037 wert1 equ 0ch ;Variable Nr.1
|
00037 wert1 equ 0ch ;Variable Nr.1
|
||||||
00038 wert2 equ 0dh ;Variable Nr.2
|
00038 wert2 equ 0dh ;Variable Nr.2
|
||||||
00039 ergeb equ 0eh ;Variable Nr.3
|
00039 ergeb equ 0eh ;Variable Nr.3
|
||||||
00040
|
00040
|
||||||
00041 ;Definition des Prozessors
|
00041 ;Definition des Prozessors
|
||||||
00042 device 16F84
|
00042 device 16F84
|
||||||
00043
|
00043
|
||||||
00044 ;Festlegen des Codebeginns
|
00044 ;Festlegen des Codebeginns
|
||||||
00045 org 0
|
00045 org 0
|
||||||
00046 loop
|
00046 loop
|
||||||
0000 3020 00047 movlw 20h ;in W steht nun 20h, DC=?, C=?, Z=?
|
0000 3020 00047 movlw 20h ;in W steht nun 20h, DC=?, C=?, Z=?
|
||||||
0001 008C 00048 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
0001 008C 00048 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||||
0002 3010 00049 movlw 10h ;W = 10h, DC=?, C=?, Z=?
|
0002 3010 00049 movlw 10h ;W = 10h, DC=?, C=?, Z=?
|
||||||
0003 0084 00050 movwf fsr ;W=10h, FSR=10h, wert1=20h, wert2=?? , DC=?, C=?, Z=?
|
0003 0084 00050 movwf fsr ;W=10h, FSR=10h, wert1=20h, wert2=?? , DC=?, C=?, Z=?
|
||||||
0004 008D 00051 movwf wert2 ;W=10h, FSR=10h, wert1=20h, wert2=10h, DC=?, C=?, Z=?
|
0004 008D 00051 movwf wert2 ;W=10h, FSR=10h, wert1=20h, wert2=10h, DC=?, C=?, Z=?
|
||||||
0005 080C 00052 movf wert1,w ;W=20h
|
0005 080C 00052 movf wert1,w ;W=20h
|
||||||
00053 ;der Speicherbereich von 10h bis 1Fh wird mit Zahlen 20h, 21h, etc. gefüllt
|
00053 ;der Speicherbereich von 10h bis 1Fh wird mit Zahlen 20h, 21h, etc. gefüllt
|
||||||
00054 loop1
|
00054 loop1
|
||||||
0006 0080 00055 movwf indirect ;W=20h, FSR=10h, F10=20h
|
0006 0080 00055 movwf indirect ;W=20h, FSR=10h, F10=20h
|
||||||
0007 3E01 00056 addlw 1 ;W=20h, 21h, 22h, etc
|
0007 3E01 00056 addlw 1 ;W=20h, 21h, 22h, etc
|
||||||
0008 0A84 00057 incf fsr ;FSR=11h, 12h, etc
|
0008 0A84 00057 incf fsr ;FSR=11h, 12h, etc
|
||||||
0009 0B8D 00058 decfsz wert2
|
0009 0B8D 00058 decfsz wert2
|
||||||
000A 2806 00059 goto loop1
|
000A 2806 00059 goto loop1
|
||||||
00060
|
00060
|
||||||
000B 301F 00061 movlw 1fh ;FSR-Zeiger wieder auf Anfang stellen
|
000B 301F 00061 movlw 1fh ;FSR-Zeiger wieder auf Anfang stellen
|
||||||
000C 0084 00062 movwf fsr
|
000C 0084 00062 movwf fsr
|
||||||
000D 30F0 00063 movlw 0f0h
|
000D 30F0 00063 movlw 0f0h
|
||||||
000E 008D 00064 movwf wert2
|
000E 008D 00064 movwf wert2
|
||||||
000F 0100 00065 clrw
|
000F 0100 00065 clrw
|
||||||
00066 loop2
|
00066 loop2
|
||||||
0010 0700 00067 addwf indirect,w
|
0010 0700 00067 addwf indirect,w
|
||||||
0011 0384 00068 decf fsr
|
0011 0384 00068 decf fsr
|
||||||
0012 0F8D 00069 incfsz wert2
|
0012 0F8D 00069 incfsz wert2
|
||||||
0013 2810 00070 goto loop2
|
0013 2810 00070 goto loop2
|
||||||
00071 ;im W-Register muss 78h stehen
|
00071 ;im W-Register muss 78h stehen
|
||||||
0014 008D 00072 movwf wert2
|
0014 008D 00072 movwf wert2
|
||||||
0015 0A84 00073 incf fsr
|
0015 0A84 00073 incf fsr
|
||||||
0016 0C80 00074 rrf indirect ;F10=10h
|
0016 0C80 00074 rrf indirect ;F10=10h
|
||||||
0017 0A80 00075 incf indirect ;F10=11h
|
0017 0A80 00075 incf indirect ;F10=11h
|
||||||
0018 0C80 00076 rrf indirect ;F10=08h, C=1
|
0018 0C80 00076 rrf indirect ;F10=08h, C=1
|
||||||
0019 1780 00077 bsf indirect,7 ;F10=88h
|
0019 1780 00077 bsf indirect,7 ;F10=88h
|
||||||
001A 1003 00078 bcf status,0 ;C=0
|
001A 1003 00078 bcf status,0 ;C=0
|
||||||
001B 0D80 00079 rlf indirect ;F10=10h, C=1
|
001B 0D80 00079 rlf indirect ;F10=10h, C=1
|
||||||
001C 0A84 00080 incf fsr ;fsr=11h
|
001C 0A84 00080 incf fsr ;fsr=11h
|
||||||
001D 0D80 00081 rlf indirect ;F11=43h, C=0
|
001D 0D80 00081 rlf indirect ;F11=43h, C=0
|
||||||
001E 0E80 00082 swapf indirect ;F11=34h
|
001E 0E80 00082 swapf indirect ;F11=34h
|
||||||
001F 0680 00083 xorwf indirect ;F11=4Ch
|
001F 0680 00083 xorwf indirect ;F11=4Ch
|
||||||
0020 1A80 00084 btfsc indirect,5
|
0020 1A80 00084 btfsc indirect,5
|
||||||
0021 2800 00085 goto loop
|
0021 2800 00085 goto loop
|
||||||
0022 1D00 00086 btfss indirect,2
|
0022 1D00 00086 btfss indirect,2
|
||||||
0023 2800 00087 goto loop
|
0023 2800 00087 goto loop
|
||||||
0024 1980 00088 btfsc indirect,3
|
0024 1980 00088 btfsc indirect,3
|
||||||
0025 2827 00089 goto ende
|
0025 2827 00089 goto ende
|
||||||
0026 2800 00090 goto loop
|
0026 2800 00090 goto loop
|
||||||
00091
|
00091
|
||||||
00092 ende
|
00092 ende
|
||||||
0027 2827 00093 goto ende ;Endlosschleife, verhindert Nirwana
|
0027 2827 00093 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00094
|
00094
|
||||||
00095
|
00095
|
||||||
|
@ -1,83 +1,83 @@
|
|||||||
00001 ;TPicSim7
|
00001 ;TPicSim7
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es wird der Timer0 mit und ohne Vorteiler geprüft
|
00003 ;Es wird der Timer0 mit und ohne Vorteiler geprüft
|
||||||
00004 ;(c) St. Lehmann Ersterstellung: 23.01.2003
|
00004 ;(c) St. Lehmann Ersterstellung: 23.01.2003
|
||||||
00005 ;19.04.2014 überarbeitet
|
00005 ;19.04.2014 überarbeitet
|
||||||
00006
|
00006
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 ;Definition einiger Symbole
|
00009 ;Definition einiger Symbole
|
||||||
00010 indirect equ 0
|
00010 indirect equ 0
|
||||||
00011 status equ 03h
|
00011 status equ 03h
|
||||||
00012 fsr equ 04h
|
00012 fsr equ 04h
|
||||||
00013 ra equ 05h
|
00013 ra equ 05h
|
||||||
00014 rb equ 06h
|
00014 rb equ 06h
|
||||||
00015 count equ 0ch
|
00015 count equ 0ch
|
||||||
00016
|
00016
|
||||||
00017 ;Definition des Prozessors
|
00017 ;Definition des Prozessors
|
||||||
00018 device 16F84
|
00018 device 16F84
|
||||||
00019 ;Festlegen des Codebeginns
|
00019 ;Festlegen des Codebeginns
|
||||||
00020 org 0
|
00020 org 0
|
||||||
00021 start
|
00021 start
|
||||||
00022 ;zuerst Timer0 intern durch den Befehlstakt erhöhen VT = 1:4
|
00022 ;zuerst Timer0 intern durch den Befehlstakt erhöhen VT = 1:4
|
||||||
00023 ;somit wird nach jedem 4. Befehlstakt (Achtung GOTO etc) TMR0 erhöht
|
00023 ;somit wird nach jedem 4. Befehlstakt (Achtung GOTO etc) TMR0 erhöht
|
||||||
0000 3001 00024 movlw 00000001B ;Option-Register entsp. initialisieren
|
0000 3001 00024 movlw 00000001B ;Option-Register entsp. initialisieren
|
||||||
0001 1683 00025 bsf status,5 ;Bank umschalten
|
0001 1683 00025 bsf status,5 ;Bank umschalten
|
||||||
0002 0081 00026 movwf 1 ;Option-Register
|
0002 0081 00026 movwf 1 ;Option-Register
|
||||||
0003 1283 00027 bcf status,5
|
0003 1283 00027 bcf status,5
|
||||||
0004 3001 00028 movlw 1 ;Timer 1 auf 1
|
0004 3001 00028 movlw 1 ;Timer 1 auf 1
|
||||||
0005 0081 00029 movwf 1
|
0005 0081 00029 movwf 1
|
||||||
0006 0190 00030 clrf 10h ;zähler
|
0006 0190 00030 clrf 10h ;zähler
|
||||||
00031 loop1
|
00031 loop1
|
||||||
0007 0000 00032 nop
|
0007 0000 00032 nop
|
||||||
0008 0000 00033 nop
|
0008 0000 00033 nop
|
||||||
0009 0000 00034 nop
|
0009 0000 00034 nop
|
||||||
000A 0A90 00035 incf 10h
|
000A 0A90 00035 incf 10h
|
||||||
000B 0801 00036 movf 1,w ;lese Timerwert aus
|
000B 0801 00036 movf 1,w ;lese Timerwert aus
|
||||||
000C 1D03 00037 btfss status,2 ;wenn Timer = 0, dann fertig
|
000C 1D03 00037 btfss status,2 ;wenn Timer = 0, dann fertig
|
||||||
000D 2807 00038 goto loop1
|
000D 2807 00038 goto loop1
|
||||||
00039 ;num muss 80H in 10h stehen
|
00039 ;num muss 80H in 10h stehen
|
||||||
00040
|
00040
|
||||||
00041 ;nun mit einem VT = 1:16
|
00041 ;nun mit einem VT = 1:16
|
||||||
00042 ;somit wird nach jedem 16. Befehlstakt (Achtung GOTO etc) TMR0 erhöht
|
00042 ;somit wird nach jedem 16. Befehlstakt (Achtung GOTO etc) TMR0 erhöht
|
||||||
000E 3003 00043 movlw 00000011B ;Option-Register entsp. initialisieren
|
000E 3003 00043 movlw 00000011B ;Option-Register entsp. initialisieren
|
||||||
000F 1683 00044 bsf status,5 ;Bank umschalten
|
000F 1683 00044 bsf status,5 ;Bank umschalten
|
||||||
0010 0081 00045 movwf 1 ;Option-Register
|
0010 0081 00045 movwf 1 ;Option-Register
|
||||||
0011 1283 00046 bcf status,5
|
0011 1283 00046 bcf status,5
|
||||||
0012 3001 00047 movlw 1 ;Timer 1 auf 1
|
0012 3001 00047 movlw 1 ;Timer 1 auf 1
|
||||||
0013 0081 00048 movwf 1
|
0013 0081 00048 movwf 1
|
||||||
0014 0190 00049 clrf 10h ;zähler
|
0014 0190 00049 clrf 10h ;zähler
|
||||||
00050 loop2
|
00050 loop2
|
||||||
0015 0A90 00051 incf 10h
|
0015 0A90 00051 incf 10h
|
||||||
0016 0801 00052 movf 1,w ;lese Timerwert aus
|
0016 0801 00052 movf 1,w ;lese Timerwert aus
|
||||||
0017 1D03 00053 btfss status,2 ;wenn Timer = 0, dann fertig
|
0017 1D03 00053 btfss status,2 ;wenn Timer = 0, dann fertig
|
||||||
0018 2815 00054 goto loop2
|
0018 2815 00054 goto loop2
|
||||||
00055 ;num muss 31H in 10h stehen
|
00055 ;num muss 31H in 10h stehen
|
||||||
00056 ;*****************************************************************
|
00056 ;*****************************************************************
|
||||||
00057 ;jetzt wird der Timer0 durch den externen Takt an RA4 hochgezählt.
|
00057 ;jetzt wird der Timer0 durch den externen Takt an RA4 hochgezählt.
|
||||||
00058 ;zuerst ohne VT, damit zählt jede fallende Flanke an RA
|
00058 ;zuerst ohne VT, damit zählt jede fallende Flanke an RA
|
||||||
0019 3038 00059 movlw 00111000B ;Option-Register initialisieren
|
0019 3038 00059 movlw 00111000B ;Option-Register initialisieren
|
||||||
001A 1683 00060 bsf status,5
|
001A 1683 00060 bsf status,5
|
||||||
001B 0081 00061 movwf 1 ;Wert ins Option-Register
|
001B 0081 00061 movwf 1 ;Wert ins Option-Register
|
||||||
001C 1283 00062 bcf status,5
|
001C 1283 00062 bcf status,5
|
||||||
001D 0181 00063 clrf 1 ;Timer löschen
|
001D 0181 00063 clrf 1 ;Timer löschen
|
||||||
00064 loop3
|
00064 loop3
|
||||||
001E 1E01 00065 btfss 1,4 ;bis im Timer0 der Wert 16 erreicht wird
|
001E 1E01 00065 btfss 1,4 ;bis im Timer0 der Wert 16 erreicht wird
|
||||||
001F 281E 00066 goto loop3
|
001F 281E 00066 goto loop3
|
||||||
00067
|
00067
|
||||||
00068 ;jetzt auch mit VT 1:4, damit zählt jede 4. fallende Flanke an RA
|
00068 ;jetzt auch mit VT 1:4, damit zählt jede 4. fallende Flanke an RA
|
||||||
0020 3031 00069 movlw 00110001B ;Option-Register initialisieren
|
0020 3031 00069 movlw 00110001B ;Option-Register initialisieren
|
||||||
0021 1683 00070 bsf status,5
|
0021 1683 00070 bsf status,5
|
||||||
0022 0081 00071 movwf 1 ;Wert ins Option-Register
|
0022 0081 00071 movwf 1 ;Wert ins Option-Register
|
||||||
0023 1283 00072 bcf status,5
|
0023 1283 00072 bcf status,5
|
||||||
0024 0181 00073 clrf 1 ;Timer löschen
|
0024 0181 00073 clrf 1 ;Timer löschen
|
||||||
00074 loop4
|
00074 loop4
|
||||||
0025 1D81 00075 btfss 1,3 ;bis im Timer0 der Wert 8 erreicht wird
|
0025 1D81 00075 btfss 1,3 ;bis im Timer0 der Wert 8 erreicht wird
|
||||||
0026 2825 00076 goto loop4
|
0026 2825 00076 goto loop4
|
||||||
00077
|
00077
|
||||||
00078 ;******************************************************************
|
00078 ;******************************************************************
|
||||||
00079
|
00079
|
||||||
00080 ende
|
00080 ende
|
||||||
0027 2827 00081 goto ende ;Endlosschleife, verhindert Nirwana
|
0027 2827 00081 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00082
|
00082
|
||||||
00083
|
00083
|
||||||
|
@ -1,116 +1,116 @@
|
|||||||
00001 ;TPicSim8
|
00001 ;TPicSim8
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Es werden die Interrupts für TMR0, RB0 (INT) und RB4-7 geprüft
|
00003 ;Es werden die Interrupts für TMR0, RB0 (INT) und RB4-7 geprüft
|
||||||
00004 ;(c) St. Lehmann
|
00004 ;(c) St. Lehmann
|
||||||
00005 ;19.04.2014
|
00005 ;19.04.2014
|
||||||
00006
|
00006
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 ;Definition einiger Symbole
|
00009 ;Definition einiger Symbole
|
||||||
00010 indirect equ 0
|
00010 indirect equ 0
|
||||||
00011 status equ 03h
|
00011 status equ 03h
|
||||||
00012 fsr equ 04h
|
00012 fsr equ 04h
|
||||||
00013 ra equ 05h
|
00013 ra equ 05h
|
||||||
00014 rb equ 06h
|
00014 rb equ 06h
|
||||||
00015 intcon equ 0bh
|
00015 intcon equ 0bh
|
||||||
00016
|
00016
|
||||||
00017 ;Definition des Prozessors
|
00017 ;Definition des Prozessors
|
||||||
00018 device 16F84
|
00018 device 16F84
|
||||||
00019 ;Festlegen des Codebeginns
|
00019 ;Festlegen des Codebeginns
|
||||||
00020 org 0
|
00020 org 0
|
||||||
00021 start
|
00021 start
|
||||||
0000 281C 00022 goto main
|
0000 281C 00022 goto main
|
||||||
0001 0000 00023 nop
|
0001 0000 00023 nop
|
||||||
0002 0000 00024 nop
|
0002 0000 00024 nop
|
||||||
0003 0000 00025 nop
|
0003 0000 00025 nop
|
||||||
00026
|
00026
|
||||||
00027 ;Interrupt-Service-Routine muss an Adresse 4 stehen, deshalb die 3 NOPs
|
00027 ;Interrupt-Service-Routine muss an Adresse 4 stehen, deshalb die 3 NOPs
|
||||||
00028 ISR
|
00028 ISR
|
||||||
0004 1D0B 00029 btfss intcon,2 ;war es ein Timer-Interrupt?
|
0004 1D0B 00029 btfss intcon,2 ;war es ein Timer-Interrupt?
|
||||||
0005 280B 00030 goto isr1 ;nein
|
0005 280B 00030 goto isr1 ;nein
|
||||||
0006 3054 00031 movlw 54h ;ja, 54h = T in 20h schreiben
|
0006 3054 00031 movlw 54h ;ja, 54h = T in 20h schreiben
|
||||||
0007 00A0 00032 movwf 20h
|
0007 00A0 00032 movwf 20h
|
||||||
0008 128B 00033 bcf intcon,5 ;Timer-Interrupt sperren
|
0008 128B 00033 bcf intcon,5 ;Timer-Interrupt sperren
|
||||||
0009 110B 00034 bcf intcon,2 ;Interrupt-Flag zurücksetzen
|
0009 110B 00034 bcf intcon,2 ;Interrupt-Flag zurücksetzen
|
||||||
000A 281B 00035 goto isrend
|
000A 281B 00035 goto isrend
|
||||||
00036 ISR1
|
00036 ISR1
|
||||||
000B 1C8B 00037 btfss intcon,1 ;war es ein RB0-Interrupt?
|
000B 1C8B 00037 btfss intcon,1 ;war es ein RB0-Interrupt?
|
||||||
000C 2812 00038 goto isr2 ;nein
|
000C 2812 00038 goto isr2 ;nein
|
||||||
000D 3049 00039 movlw 'I' ;schreibe ein I an 21h
|
000D 3049 00039 movlw 'I' ;schreibe ein I an 21h
|
||||||
000E 00A1 00040 movwf 21h
|
000E 00A1 00040 movwf 21h
|
||||||
000F 120B 00041 bcf intcon,4 ;RB0-Interrupt sperren
|
000F 120B 00041 bcf intcon,4 ;RB0-Interrupt sperren
|
||||||
0010 108B 00042 bcf intcon,1 ;RB0-Interrupt-Flag löschen
|
0010 108B 00042 bcf intcon,1 ;RB0-Interrupt-Flag löschen
|
||||||
0011 281B 00043 goto isrend
|
0011 281B 00043 goto isrend
|
||||||
00044 ISR2
|
00044 ISR2
|
||||||
0012 1C0B 00045 btfss intcon,0 ;war es ein RB4-7 Interrupt?
|
0012 1C0B 00045 btfss intcon,0 ;war es ein RB4-7 Interrupt?
|
||||||
0013 2819 00046 goto isr3 ;dürfte nie passieren
|
0013 2819 00046 goto isr3 ;dürfte nie passieren
|
||||||
0014 3052 00047 movlw 'R' ;schreibe ein R nach 22h
|
0014 3052 00047 movlw 'R' ;schreibe ein R nach 22h
|
||||||
0015 00A2 00048 movwf 22h
|
0015 00A2 00048 movwf 22h
|
||||||
0016 118B 00049 bcf intcon,3 ;keine RB4-7 Interrupts erlauben
|
0016 118B 00049 bcf intcon,3 ;keine RB4-7 Interrupts erlauben
|
||||||
0017 100B 00050 bcf intcon,0 ;auch das Flag löschen
|
0017 100B 00050 bcf intcon,0 ;auch das Flag löschen
|
||||||
0018 281B 00051 goto isrend
|
0018 281B 00051 goto isrend
|
||||||
00052 ISR3
|
00052 ISR3
|
||||||
0019 3046 00053 movlw 'F' ;Fehlermeldung
|
0019 3046 00053 movlw 'F' ;Fehlermeldung
|
||||||
001A 00A3 00054 movwf 23h
|
001A 00A3 00054 movwf 23h
|
||||||
00055
|
00055
|
||||||
00056 isrend
|
00056 isrend
|
||||||
001B 0009 00057 retfie ;Ende der Inetrrupt-Service-Routine
|
001B 0009 00057 retfie ;Ende der Inetrrupt-Service-Routine
|
||||||
00058
|
00058
|
||||||
00059
|
00059
|
||||||
00060 main:
|
00060 main:
|
||||||
00061 ;Der TMR0 wird vom Befehlstakt incrementiert. beim Überlauf wird ein Interrupt ausgelöst
|
00061 ;Der TMR0 wird vom Befehlstakt incrementiert. beim Überlauf wird ein Interrupt ausgelöst
|
||||||
001C 3001 00062 movlw 00000001B ;Option-Register entsp. initialisieren
|
001C 3001 00062 movlw 00000001B ;Option-Register entsp. initialisieren
|
||||||
001D 1683 00063 bsf status,5 ;Bank umschalten
|
001D 1683 00063 bsf status,5 ;Bank umschalten
|
||||||
001E 0081 00064 movwf 1 ;Option-Register
|
001E 0081 00064 movwf 1 ;Option-Register
|
||||||
001F 1283 00065 bcf status,5
|
001F 1283 00065 bcf status,5
|
||||||
0020 3020 00066 movlw 20h ;nur Timer-Interrupt erlauben
|
0020 3020 00066 movlw 20h ;nur Timer-Interrupt erlauben
|
||||||
0021 008B 00067 movwf intcon
|
0021 008B 00067 movwf intcon
|
||||||
0022 178B 00068 bsf intcon,7 ;Globale Freigabe, ab jetzt kann ein Interrupt durchkommen
|
0022 178B 00068 bsf intcon,7 ;Globale Freigabe, ab jetzt kann ein Interrupt durchkommen
|
||||||
00069 loop1
|
00069 loop1
|
||||||
0023 1A8B 00070 btfsc intcon,5 ;fertig, wenn ISR dieses Bit zurücksetzt
|
0023 1A8B 00070 btfsc intcon,5 ;fertig, wenn ISR dieses Bit zurücksetzt
|
||||||
0024 2823 00071 goto loop1 ;bis Timer überläuft
|
0024 2823 00071 goto loop1 ;bis Timer überläuft
|
||||||
00072
|
00072
|
||||||
00073 ;zuerst die wirksame Flanke für RB0 festlegen (hier die fallende Flanke)
|
00073 ;zuerst die wirksame Flanke für RB0 festlegen (hier die fallende Flanke)
|
||||||
0025 300F 00074 movlw 00001111b
|
0025 300F 00074 movlw 00001111b
|
||||||
0026 1683 00075 bsf status,5
|
0026 1683 00075 bsf status,5
|
||||||
0027 0081 00076 movwf 1
|
0027 0081 00076 movwf 1
|
||||||
0028 1283 00077 bcf status,5
|
0028 1283 00077 bcf status,5
|
||||||
00078 ;nun den RB0-Interrupt freigeben, Rest sperren
|
00078 ;nun den RB0-Interrupt freigeben, Rest sperren
|
||||||
0029 3010 00079 movlw 10h
|
0029 3010 00079 movlw 10h
|
||||||
002A 008B 00080 movwf intcon
|
002A 008B 00080 movwf intcon
|
||||||
002B 178B 00081 bsf intcon,7
|
002B 178B 00081 bsf intcon,7
|
||||||
00082 loop2
|
00082 loop2
|
||||||
002C 1A0B 00083 btfsc intcon,4
|
002C 1A0B 00083 btfsc intcon,4
|
||||||
002D 282C 00084 goto loop2
|
002D 282C 00084 goto loop2
|
||||||
00085
|
00085
|
||||||
00086 ;Beim RB4-7 Interrupts wird ein Flankenwechsel nur an den Pins die als Eingang arbeiten erkannt
|
00086 ;Beim RB4-7 Interrupts wird ein Flankenwechsel nur an den Pins die als Eingang arbeiten erkannt
|
||||||
002E 3008 00087 movlw 08h ;RB4-7 Interrupt freigeben
|
002E 3008 00087 movlw 08h ;RB4-7 Interrupt freigeben
|
||||||
002F 008B 00088 movwf intcon
|
002F 008B 00088 movwf intcon
|
||||||
0030 178B 00089 bsf intcon,7 ;GIE
|
0030 178B 00089 bsf intcon,7 ;GIE
|
||||||
00090 loop3
|
00090 loop3
|
||||||
0031 198B 00091 btfsc intcon,3 ;wird in ISR zurückgesetzt
|
0031 198B 00091 btfsc intcon,3 ;wird in ISR zurückgesetzt
|
||||||
0032 2831 00092 goto loop3
|
0032 2831 00092 goto loop3
|
||||||
00093
|
00093
|
||||||
00094 ;das gleiche nochmals, nur sind RB4-6 Ausgänge und werden deshalb ignoriert
|
00094 ;das gleiche nochmals, nur sind RB4-6 Ausgänge und werden deshalb ignoriert
|
||||||
0033 308F 00095 movlw 10001111B
|
0033 308F 00095 movlw 10001111B
|
||||||
0034 1683 00096 bsf status,5
|
0034 1683 00096 bsf status,5
|
||||||
0035 0086 00097 movwf 6 ;TRIS RB
|
0035 0086 00097 movwf 6 ;TRIS RB
|
||||||
0036 1283 00098 bcf status,5
|
0036 1283 00098 bcf status,5
|
||||||
0037 3008 00099 movlw 08h ;RB4-7 Interrupt freigeben
|
0037 3008 00099 movlw 08h ;RB4-7 Interrupt freigeben
|
||||||
0038 008B 00100 movwf intcon ;aber nur RB7 ist aktiv
|
0038 008B 00100 movwf intcon ;aber nur RB7 ist aktiv
|
||||||
0039 178B 00101 bsf intcon,7 ;GIE
|
0039 178B 00101 bsf intcon,7 ;GIE
|
||||||
00102 loop4
|
00102 loop4
|
||||||
003A 198B 00103 btfsc intcon,3 ;wird in ISR zurückgesetzt
|
003A 198B 00103 btfsc intcon,3 ;wird in ISR zurückgesetzt
|
||||||
003B 283A 00104 goto loop4
|
003B 283A 00104 goto loop4
|
||||||
00105
|
00105
|
||||||
00106
|
00106
|
||||||
00107 ;******************************************************************
|
00107 ;******************************************************************
|
||||||
00108 ;wenn alles richtig, dann
|
00108 ;wenn alles richtig, dann
|
||||||
00109 ;in 20h steht 54H
|
00109 ;in 20h steht 54H
|
||||||
00110 ;in 21H ein 49H
|
00110 ;in 21H ein 49H
|
||||||
00111 ;in 22H ein 53H
|
00111 ;in 22H ein 53H
|
||||||
00112
|
00112
|
||||||
00113 ende
|
00113 ende
|
||||||
003C 283C 00114 goto ende ;Endlosschleife, verhindert Nirwana
|
003C 283C 00114 goto ende ;Endlosschleife, verhindert Nirwana
|
||||||
00115
|
00115
|
||||||
00116
|
00116
|
||||||
|
@ -1,40 +1,40 @@
|
|||||||
00001 ;TPicSim9
|
00001 ;TPicSim9
|
||||||
00002 ;Programm zum Test des 16F84-Simulators.
|
00002 ;Programm zum Test des 16F84-Simulators.
|
||||||
00003 ;Funktion: SLEEP-Befehl
|
00003 ;Funktion: SLEEP-Befehl
|
||||||
00004 ;(c) St. Lehmann Ersterstellung: 31.03.2016
|
00004 ;(c) St. Lehmann Ersterstellung: 31.03.2016
|
||||||
00005 ;Definition einiger Symbole
|
00005 ;Definition einiger Symbole
|
||||||
00006
|
00006
|
||||||
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
00007 list c=132 ;Zeilenlänge im LST auf 132 Zeichen setzen
|
||||||
00008
|
00008
|
||||||
00009 status equ 03h
|
00009 status equ 03h
|
||||||
00010 rb equ 06h
|
00010 rb equ 06h
|
||||||
00011 var equ 0ch
|
00011 var equ 0ch
|
||||||
00012 liste1 equ 10h
|
00012 liste1 equ 10h
|
||||||
00013 liste2 equ 11h
|
00013 liste2 equ 11h
|
||||||
00014 liste3 equ 12h
|
00014 liste3 equ 12h
|
||||||
00015 liste4 equ 13h
|
00015 liste4 equ 13h
|
||||||
00016
|
00016
|
||||||
00017 ;Definition des Prozessors
|
00017 ;Definition des Prozessors
|
||||||
00018 device 16F84
|
00018 device 16F84
|
||||||
00019
|
00019
|
||||||
00020 ;Festlegen des Codebeginns
|
00020 ;Festlegen des Codebeginns
|
||||||
00021 org 0
|
00021 org 0
|
||||||
00022 ;wenn mit eingeschaltetem Watchdog-Timer der SLEEP-Befehl aktiviert wird,
|
00022 ;wenn mit eingeschaltetem Watchdog-Timer der SLEEP-Befehl aktiviert wird,
|
||||||
00023 ;dann wird das Programm nach ca. 2,3ms weiter laufen.
|
00023 ;dann wird das Programm nach ca. 2,3ms weiter laufen.
|
||||||
00024
|
00024
|
||||||
00025 ;wenn der Watchdog-Timer ausgeschaltet ist, beendet ein RESET den SLEEP-Modus
|
00025 ;wenn der Watchdog-Timer ausgeschaltet ist, beendet ein RESET den SLEEP-Modus
|
||||||
00026
|
00026
|
||||||
00027 ;Auch ein Interrupt an RB0 oder RB4 bis RB7 beendet den SLEEP-Modus
|
00027 ;Auch ein Interrupt an RB0 oder RB4 bis RB7 beendet den SLEEP-Modus
|
||||||
00028 start
|
00028 start
|
||||||
0000 018C 00029 clrf var ;
|
0000 018C 00029 clrf var ;
|
||||||
0001 0E03 00030 swapf status,w
|
0001 0E03 00030 swapf status,w
|
||||||
0002 0090 00031 movwf liste1 ;T0=1 , PD=1
|
0002 0090 00031 movwf liste1 ;T0=1 , PD=1
|
||||||
0003 0063 00032 sleep ;warte bis Watchdogtimer anspricht
|
0003 0063 00032 sleep ;warte bis Watchdogtimer anspricht
|
||||||
0004 0E03 00033 swapf status,w
|
0004 0E03 00033 swapf status,w
|
||||||
0005 0091 00034 movwf liste2 ;T0=1 , PD=0 bei Watchdog-Timeout
|
0005 0091 00034 movwf liste2 ;T0=1 , PD=0 bei Watchdog-Timeout
|
||||||
00035 ;T0=0 , PD=0 bei RESET oder Interrupt
|
00035 ;T0=0 , PD=0 bei RESET oder Interrupt
|
||||||
00036
|
00036
|
||||||
00037
|
00037
|
||||||
00038 ende
|
00038 ende
|
||||||
0006 2806 00039 goto ende
|
0006 2806 00039 goto ende
|
||||||
00040
|
00040
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
Für die Test, ob ihr Simulator richtig funktioniert, gibt es
|
Für die Test, ob ihr Simulator richtig funktioniert, gibt es
|
||||||
dieverse Testprogramme. Sie sind bewusst kurz gehalten, damit
|
dieverse Testprogramme. Sie sind bewusst kurz gehalten, damit
|
||||||
der Überblick nicht verloren geht.
|
der Überblick nicht verloren geht.
|
||||||
|
|
||||||
|
|
||||||
Die Testprogramme für den PIC-Simulator haben folgende Aufgaben:
|
Die Testprogramme für den PIC-Simulator haben folgende Aufgaben:
|
||||||
|
|
||||||
TPicSim1
|
TPicSim1
|
||||||
Es werden die Literal-Befehle getestet
|
Es werden die Literal-Befehle getestet
|
||||||
|
|
||||||
TPicSim2
|
TPicSim2
|
||||||
Test von CALL, GOTO, RETLW und RETURN (RETFIE in TPicSim8)
|
Test von CALL, GOTO, RETLW und RETURN (RETFIE in TPicSim8)
|
||||||
|
|
||||||
TPicSim3
|
TPicSim3
|
||||||
Prüfen der Byte-orientierten Befehle, ohne die aus TPicSim4
|
Prüfen der Byte-orientierten Befehle, ohne die aus TPicSim4
|
||||||
|
|
||||||
TPicSim4
|
TPicSim4
|
||||||
DECFSZ, INCFSZ, RLF und RRF werden hier gesondert getestet
|
DECFSZ, INCFSZ, RLF und RRF werden hier gesondert getestet
|
||||||
|
|
||||||
TPicSim5
|
TPicSim5
|
||||||
Hier werden die Bit-orientierten Befehle geprüft.
|
Hier werden die Bit-orientierten Befehle geprüft.
|
||||||
|
|
||||||
TPicSim6
|
TPicSim6
|
||||||
Die indirekte Adressierung ist wichtig und kommt sehr oft vor.
|
Die indirekte Adressierung ist wichtig und kommt sehr oft vor.
|
||||||
|
|
||||||
TPicSim7
|
TPicSim7
|
||||||
Der Timer0 wird mit und ohne Vorteiler geprüft.
|
Der Timer0 wird mit und ohne Vorteiler geprüft.
|
||||||
|
|
||||||
TPicSim8
|
TPicSim8
|
||||||
Es gibt neben dem RB0, RB4-RB7 und dem Timer-Interrupt auch den
|
Es gibt neben dem RB0, RB4-RB7 und dem Timer-Interrupt auch den
|
||||||
EEPROM-Interrupt, der aber nicht geprüft wird.
|
EEPROM-Interrupt, der aber nicht geprüft wird.
|
||||||
|
|
||||||
TPicSim9
|
TPicSim9
|
||||||
Der SLEEP-Befehl verlangt etwas mehr Überlegung bei den Tests.
|
Der SLEEP-Befehl verlangt etwas mehr Überlegung bei den Tests.
|
||||||
(Siehe auch TPicSim11)
|
(Siehe auch TPicSim11)
|
||||||
|
|
||||||
TPicSim10
|
TPicSim10
|
||||||
Das PCL- und das PCLATH-Register sind etwas Besonderes beim PIC
|
Das PCL- und das PCLATH-Register sind etwas Besonderes beim PIC
|
||||||
und benötigt mehr Detailkenntisse als die übrigen Befehle
|
und benötigt mehr Detailkenntisse als die übrigen Befehle
|
||||||
|
|
||||||
TPicSim11
|
TPicSim11
|
||||||
Diese Funktion ist grundlegend für das TPicSim9-Testprogramm.
|
Diese Funktion ist grundlegend für das TPicSim9-Testprogramm.
|
||||||
|
|
||||||
TPicSim12
|
TPicSim12
|
||||||
Lesen und Beschreiben des internen Daten-EEPROMs.
|
Lesen und Beschreiben des internen Daten-EEPROMs.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user