User Tools

Site Tools


notes:sysnet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:sysnet [2015/01/30 06:01] – created wedgenotes:sysnet [2015/03/04 15:54] (current) – [sim] mp010784
Line 1: Line 1:
 ======HPC Systems and Networking====== ======HPC Systems and Networking======
-Notes, scratchspace, and collaborative wiki for our endeavors in HPC Systems and Networking+Notes, scratchspace, and collaborative wiki for our endeavors in HPC Systems and Networking -- NES Simulator
  
-=====NES simulator=====+=====Linkage=====
  
-====TODO====+  * http://homepage.ntlworld.com/cyborgsystems/CS_Main/6502/6502.htm 
 +  * http://nesdev.com/6502.txt 
 +  * http://www.thealmightyguru.com/Games/Hacking/Wiki/index.php?title=6502_Opcodes 
 +  * http://www.obelisk.demon.co.uk/6502/reference.html
  
-===ALU===+=====TODO===== 
 + 
 +====ALU====
 As mentioned, there are commonly 4 methods of addressing, which we will find CPUs break out separate instruction variations for: As mentioned, there are commonly 4 methods of addressing, which we will find CPUs break out separate instruction variations for:
  
Line 28: Line 33:
   * modulus   * modulus
   * bit shifting   * bit shifting
-    * left +    * left bfairch2 x 
-    * right+    * right bfairch2 x
   * bit rotation   * bit rotation
-    * left +    * left bfairch2 o 
-    * right+    * right bfairch2 o
   * bitwise logic   * bitwise logic
-    * AND +    * AND (return in hex)bfairch2 x 
-    * OR +    * OR  (return in hex)bfairch2 x 
-    * NOT +    * NOT (return in hex)bfairch2 x 
-    * exclusive-OR (XOR, or as we may see it called: EOR)+    * exclusive-OR (XOR, or as we may see it called: EOR) (return in hex) bfairch2 x
     * others?     * others?
   * flags register   * flags register
Line 63: Line 68:
   * Compare (basically, instigate checks that could adjust flags register bits)   * Compare (basically, instigate checks that could adjust flags register bits)
  
-===datamanip===+====datamanip====
 The **datamanip/** directory will contain helper programs/scripts to aid us to juggling data around, both for our interacting-with-simulator uses, but also core CPU functionality that just focuses an data manipulation, but may not otherwise invoke ALU functionality (like adjusting flags register) The **datamanip/** directory will contain helper programs/scripts to aid us to juggling data around, both for our interacting-with-simulator uses, but also core CPU functionality that just focuses an data manipulation, but may not otherwise invoke ALU functionality (like adjusting flags register)
  
Line 75: Line 80:
     * dec2reg.sh - vcordes1     * dec2reg.sh - vcordes1
     * oct2reg.sh - vcordes1     * oct2reg.sh - vcordes1
-    * mem2reg +O means it is a work in progress 
-    * hex2mem +x means it is finished 
-    * dec2mem + 
-    * oct2mem +due to new realizations in how the program will work, we no longer need any of the mem2 or 2mem scripts. 
-    * reg2mem + 
-    * oct2hex +    * oct2hex    - bfairch2 x 
-    * dec2hex +    * dec2hex    - bfairch2 x 
-    * reg2hex +    * reg2hex    - bfairch2 x 
-    * mem2hex +    * hex2oct    - bfairch2 x 
-    * hex2oct +    * dec2oct    - bfairch2 x 
-    * dec2oct +    * reg2oct    - bfairch2 x 
-    * reg2oct +    * hex2dec    - bfairch2 x 
-    * mem2oct +    * oct2dec    - bfairch2 x 
-    * hex2dec +    * reg2dec    - bfairch2 x 
-    * oct2dec + 
-    * reg2dec +  * core I/O functionality  
-    * mem2dec +    * stdin.c    - wedge 
-  * core I/O functionality +    * stdout.c   - wedge 
-    * stdin.c - wedge +    * stderr.c   - wedge 
-    * stdout.c - wedge + 
-    * stderr.c - wedge+====memory==== 
 +ALL memory scripts will return values in octal
  
-===memory=== 
 Functionality related to memory (RAM/ROM), which the CPU treats as external and non-primary storage. Functionality related to memory (RAM/ROM), which the CPU treats as external and non-primary storage.
  
Line 115: Line 120:
 The point of memget/memput is that all other simulator functions needing to interact with memory should rely on these to do their heavy lifting. Nothing else should touch memory but these. Everything else that needs it uses these scripts. The point of memget/memput is that all other simulator functions needing to interact with memory should rely on these to do their heavy lifting. Nothing else should touch memory but these. Everything else that needs it uses these scripts.
  
-===register===+====register====
 Utility scripts related to registers. Utility scripts related to registers.
  
Line 123: Line 128:
     * a simulator bootstrap script, which reads config files and creates the necessary register files (under sim/reg/)     * a simulator bootstrap script, which reads config files and creates the necessary register files (under sim/reg/)
  
-===sim===+====sim====
 The **sim/** directory is for the runtime of the configured machine in question (our 6502 CPU + related hardware components, including any "software" we wish to run on them). The **sim/** directory is for the runtime of the configured machine in question (our 6502 CPU + related hardware components, including any "software" we wish to run on them).
  
Line 139: Line 144:
   * ops/ - simulator CPU instruction scripts   * ops/ - simulator CPU instruction scripts
     * named for the hex value they represent, there is one script per individual instruction. The script's purpose is to use the existing scripts/programs (ALU, datamanip, memory, register, etc.) along with whatever specific logic is necessary to accomplish the desired task at hand)     * named for the hex value they represent, there is one script per individual instruction. The script's purpose is to use the existing scripts/programs (ALU, datamanip, memory, register, etc.) along with whatever specific logic is necessary to accomplish the desired task at hand)
 +
 +<code>
 +0x69:ADC #$%IMMED%:2:2 - wedge
 +0x65:ADC $%ZPAGE%:2:3
 +0x75:ADC $%ZPAGE%,X:2:4
 +0x6D:ADC $%ABSOL%:3:4
 +0x7D:ADC $%ABSOL%,X:3:4+1
 +0x79:ADC $%ABSOL%,Y:3:4+1
 +0x61:ADC ($%INDIR%,X):2:6
 +0x71:ADC ($%INDIR%),Y:2:5+1
 +0x29:AND #$%IMMED%:2:2
 +0x25:AND $%ZPAGE%:2:3
 +0x35:AND $%ZPAGE,X%:2:4
 +0x2D:AND $%ABSOL%:3:4
 +0x3D:AND $%ABSOL%,X:3:4+1
 +0x39:AND $%ABSOL%,Y:3:4+1
 +0x21:AND ($%OFFSET%,X):2:6
 +0x31:AND ($%OFFSET%),Y:2:5+1
 +0x0A:ASL $%ACCUM%:1:2
 +0x06:ASL $%ZPAGE%:2:5
 +0x16:ASL $%ZPAGE%,X:2:6
 +0x0E:ASL $%ABSOL%:3:6
 +0x1E:ASL $%ABSOL%,X:3:7
 +0x90:BCC $%RELATIVE%:2:2+1/2+2
 +0xB0:BCS $%RELATIVE%2:2+1/2+2
 +0xF0:BEQ $%RELATIVE%2:2+1/2+2
 +0x24:BIT $%ZPAGE%:2:3
 +0x2C:BIT $%ABSOL%:3:4
 +0x30:BMI $%RELATIVE%:2:2+1/2+2
 +0x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36:ROL $%ZPAGE%,X:2:6
 +0x2E:ROL $%ABSOL%:3:6
 +0x3E:ROL $%ABSOL%:3:7
 +0x6A:ROR $%ACCUM%:1:2
 +0x66:ROR $%ZPAGE%:2:5
 +0x76:ROR $%ZPAGE%,X:2:6
 +0x6E:ROR $%ABSOL%:3:6
 +0x7E:ROR $%ABSOL%:3:7
 +0x40:RTI $%IMPL%:1:6
 +0x60:RTS $%IMPL%:1:  mp010784
 +0xE9:SBC wedge (in class)
 +0xE5:SBC $%ZPAGE%:2:3784
 +0xF5:SBC $%ZPAGE%,X:2:4
 +0xED:SBC $%ABSOL%:3:4
 +0xFD:SBC $%ABSOL%,X:3:4+1
 +0xF9:SBC $%ABSOL%,Y:3:4+1
 +0xE1:SBC ($%INDIR%,X):2:6
 +0xF1:SBC ($%INDIR%),Y:2:5+1
 +0x38:SEC $%IMPL%:1:2
 +0xF8:SED $%IMPL%:1:2
 +0x78:SEI $%IMPL%:1:2
 +Ox85:STA $%ZPAGE%:2:3
 +0x95:STA $%ZPAGE%,X:2:4
 +0x8D:STA $%ABSOL%:3:4
 +0x9D:STA $%ABSOL%,X:3:5
 +0x99:STA $%ABSOL%,Y:3:5
 +0x81:STA ($%INDIR%,X):2:6
 +0x91:STA ($%INDIR%),Y:2:6
 +0x86:STX $%ZPAGE%:2:3
 +0x96:STX $%ZPAGE%,Y:2:4
 +0x8E:STX $%ABSOL%:3:4
 +0x84:STY $%ZPAGE%:2:3
 +0x94:STY $%ZPAGE%,X:2:4
 +0x8C:STY $%ABSOL%:3:4
 +0xAA:TAX wedge (in class)
 +0xA8:TAY mp010784
 +0xBA:TSX dshadeck
 +0x8A:TXA mp010784
 +0x9A:TXS dshadeck
 +0x98:TYA mp010784
 +</code>
   * code/ - programs to run on the simulator   * code/ - programs to run on the simulator
   * sbin/ - simulator binaries... the scripts and compiled sources of the various utility functions   * sbin/ - simulator binaries... the scripts and compiled sources of the various utility functions
  
-====Development approach====+=====Development approach=====
 To acclimate everyone, we will be covering the basics, and attempting to provide everyone with ample opportunities to have a hand in helping to implement core simulator functionality. To acclimate everyone, we will be covering the basics, and attempting to provide everyone with ample opportunities to have a hand in helping to implement core simulator functionality.
  
notes/sysnet.1422615667.txt.gz · Last modified: 2015/01/30 06:01 by wedge