[dumb] questions about 6502 javascript simulator
Moderator: Moderators
[dumb] questions about 6502 javascript simulator
http://visual6502.org/JSSim/
I don't know even what the starting bytecode means. This:
0000: a9 00 20 10 00 4c 02 00 00 00 00 00 00 00 00 40
0010: e8 88 e6 0f 38 69 02 60 00 00 00 00 00 00 00 00
Execution starts from beginning? On 6502 emulator it started from $600.
Googling out takes too long and gives not complete results, so let's post it. I need either disassembler, or good table with all opcodes. Like http://visual6502.org/wiki/index.php?ti ... 56_Opcodes , but I don't know what those addressing modes mean. Wait, I don't need that yet.
edit
Link to disassembler was so close! So close!
http://www.e-tradition.net/bytes/6502/disassembler.html
Wait, I copypasted something wrong, here is the right listing.
* = 0000
0000 A9 00 LDA #$00
0002 20 10 00 JSR $0010
0005 4C 02 00 JMP $0002
0008 00 BRK
0009 00 BRK
000A 00 BRK
000B 00 BRK
000C 00 BRK
000D 00 BRK
000E 00 BRK
000F 40 RTI
0010 E8 INX
0011 88 DEY
0012 E6 0F INC $0F
0014 38 SEC
0015 69 02 ADC #$02
0017 60 RTS
0018 00 BRK
0019 00 BRK
001A 00 BRK
001B 00 BRK
001C 00 BRK
001D 00 BRK
001E 00 BRK
001F 00 BRK
0020 .END
I don't know even what the starting bytecode means. This:
0000: a9 00 20 10 00 4c 02 00 00 00 00 00 00 00 00 40
0010: e8 88 e6 0f 38 69 02 60 00 00 00 00 00 00 00 00
Execution starts from beginning? On 6502 emulator it started from $600.
Googling out takes too long and gives not complete results, so let's post it. I need either disassembler, or good table with all opcodes. Like http://visual6502.org/wiki/index.php?ti ... 56_Opcodes , but I don't know what those addressing modes mean. Wait, I don't need that yet.
edit
Link to disassembler was so close! So close!
http://www.e-tradition.net/bytes/6502/disassembler.html
Wait, I copypasted something wrong, here is the right listing.
* = 0000
0000 A9 00 LDA #$00
0002 20 10 00 JSR $0010
0005 4C 02 00 JMP $0002
0008 00 BRK
0009 00 BRK
000A 00 BRK
000B 00 BRK
000C 00 BRK
000D 00 BRK
000E 00 BRK
000F 40 RTI
0010 E8 INX
0011 88 DEY
0012 E6 0F INC $0F
0014 38 SEC
0015 69 02 ADC #$02
0017 60 RTS
0018 00 BRK
0019 00 BRK
001A 00 BRK
001B 00 BRK
001C 00 BRK
001D 00 BRK
001E 00 BRK
001F 00 BRK
0020 .END
Last edited by michikaze on Sat Nov 22, 2014 1:58 pm, edited 2 times in total.
Re: [dumb] questions about 6502 javascript simulator
Probably because your "6502 emulator" hardcoded the RESET vector to $0600, while in Visual6502 it's set to $0000.michikaze wrote:http://visual6502.org/JSSim/
Execution starts from beginning? On 6502 emulator it started from $600.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
P.S. If you don't get this note, let me know and I'll write you another.
Re: [dumb] questions about 6502 javascript simulator
Four months passed, and I remembered that I still can't understand pretty much anything in http://visual6502.org/JSSim/expert.html
So, I changed code to INX INX INX INX INX JMP $0 (or, in binary, e8 e8 e8 e8 e8 4c 00 00), and now I'm trying to find this X register in this mess.
Yes, I think I'm going to bump this thread until I get this. Please bear with me.
editmaster: By the way, here is a little site about NES processor in russian, http://breaknes.com/. I wouldn't say it makes everything much easier to understand, but it's better than nothing.
So, I changed code to INX INX INX INX INX JMP $0 (or, in binary, e8 e8 e8 e8 e8 4c 00 00), and now I'm trying to find this X register in this mess.
Yes, I think I'm going to bump this thread until I get this. Please bear with me.
editmaster: By the way, here is a little site about NES processor in russian, http://breaknes.com/. I wouldn't say it makes everything much easier to understand, but it's better than nothing.
Re: [dumb] questions about 6502 javascript simulator
X register is displayed in the top-right corner above the memory display, and looks like this:
halfcyc:0 phi0:0 AB:0000 D:a9 RnW:1
PC:0000 A:aa X:00 Y:00 SP:fd nv‑BdIZc
Hz: 1.0 Exec: BRK(T1) (Fetch: LDA #)
The physical X register is over in the lower-left corner of the schematic, you can find it by asking Visual6502 to search for "x0" through "x7". It's in a row, from left to right: Y, X, S, IDB, ALUa, ALUb &c
halfcyc:0 phi0:0 AB:0000 D:a9 RnW:1
PC:0000 A:aa X:00 Y:00 SP:fd nv‑BdIZc
Hz: 1.0 Exec: BRK(T1) (Fetch: LDA #)
The physical X register is over in the lower-left corner of the schematic, you can find it by asking Visual6502 to search for "x0" through "x7". It's in a row, from left to right: Y, X, S, IDB, ALUa, ALUb &c
Re: [dumb] questions about 6502 javascript simulator
ok, found that, thank you. Next, adl0 adl1 adl2, what purpose do those have? Output?
dpc3_SBX?
dpc3_SBX?
Re: [dumb] questions about 6502 javascript simulator
Where did you find these?
Re: [dumb] questions about 6502 javascript simulator
err, here:

adl0 kind of goes over everything, I don't even know which nodes are affected by it. I don't even know if any of them are really related to x0, but they are the closest to it on the schematic.
Lord of the Edit Button: I just leave a few useful links for me. Yes, this is now also a notepad.
Hanson's Block Diagram should be very useful for this:
http://visual6502.org/wiki/index.php?ti ... ck_Diagram
http://www.weihenstephan.org/~michaste/ ... 2/6502.jpg

adl0 kind of goes over everything, I don't even know which nodes are affected by it. I don't even know if any of them are really related to x0, but they are the closest to it on the schematic.
Lord of the Edit Button: I just leave a few useful links for me. Yes, this is now also a notepad.
Hanson's Block Diagram should be very useful for this:
http://visual6502.org/wiki/index.php?ti ... ck_Diagram
http://www.weihenstephan.org/~michaste/ ... 2/6502.jpg
Re: [dumb] questions about 6502 javascript simulator
ADL (and ADH) are the two halves of the address bus. (ADdress Low) Usually the same as the program counter, but necessarily contains something else when the CPU is explicitly reading from or writing to memory.
dpc3_SBX is apparently the control that loads the X register from SB. Not certain what the "dpc" part is, "3" just appears to be a unique identifier (since there is also dpc0_YSB, dpc1_SBY, dpc2_XSB, &c)
dpc3_SBX is apparently the control that loads the X register from SB. Not certain what the "dpc" part is, "3" just appears to be a unique identifier (since there is also dpc0_YSB, dpc1_SBY, dpc2_XSB, &c)
Re: [dumb] questions about 6502 javascript simulator
So, it shows this while running:
halfcyc:0 X:00 Exec: BRK(T1) (Fetch: INX)
halfcyc:1 X:00 Exec: BRK(T1) (Fetch: INX)
halfcyc:2 X:00 Exec: INX(T0+T2)
halfcyc:3 X:00 Exec: INX(T0+T2)
halfcyc:4 X:00 Exec: INX(T1) (Fetch: INX)
halfcyc:5 X:00 Exec: INX(T1) (Fetch: INX)
halfcyc:6 X:01 Exec: INX(T0+T2)
halfcyc:7 X:01 Exec: INX(T0+T2)
halfcyc:8 X:01 Exec: INX(T1) (Fetch: INX)
halfcyc:9 X:01 Exec: INX(T1) (Fetch: INX)
halfcyc:10 X:02 Exec: INX(T0+T2)
halfcyc:11 X:02 Exec: INX(T0+T2)
halfcyc:12 X:02 Exec: INX(T1) (Fetch: INX)
halfcyc:13 X:02 Exec: INX(T1) (Fetch: INX)
halfcyc:14 X:03 Exec: INX(T0+T2)
What are those T0 T1 T2, and where it fetches next opcode?
Now I'm trying to find adl0 on http://visual6502.org/images/6502/MOS_6 ... ll_vec.png. I want to see, to which nodes it connects to. Javascript simulator sort of highlights connected nodes then you click on it. Or it's just white line crossing over yellow rectangle makes it look more bright. This simulator is so blurry then you zoom.
edit hero: SB stands for what bus? Stack?
t u r b o e d i t: http://visual6502.org/wiki/index.php?ti ... 2_datapath
Two interesting signals are dpc2_XSB (moves X to SB) and dpc3_SBX (moves SB to X). And I found SB, it's just near, it's called sb0. Now to figure out how this works.
http://wiki.breaknes.com/6502:regs
A few illustrations of registers.
halfcyc:0 X:00 Exec: BRK(T1) (Fetch: INX)
halfcyc:1 X:00 Exec: BRK(T1) (Fetch: INX)
halfcyc:2 X:00 Exec: INX(T0+T2)
halfcyc:3 X:00 Exec: INX(T0+T2)
halfcyc:4 X:00 Exec: INX(T1) (Fetch: INX)
halfcyc:5 X:00 Exec: INX(T1) (Fetch: INX)
halfcyc:6 X:01 Exec: INX(T0+T2)
halfcyc:7 X:01 Exec: INX(T0+T2)
halfcyc:8 X:01 Exec: INX(T1) (Fetch: INX)
halfcyc:9 X:01 Exec: INX(T1) (Fetch: INX)
halfcyc:10 X:02 Exec: INX(T0+T2)
halfcyc:11 X:02 Exec: INX(T0+T2)
halfcyc:12 X:02 Exec: INX(T1) (Fetch: INX)
halfcyc:13 X:02 Exec: INX(T1) (Fetch: INX)
halfcyc:14 X:03 Exec: INX(T0+T2)
What are those T0 T1 T2, and where it fetches next opcode?
Now I'm trying to find adl0 on http://visual6502.org/images/6502/MOS_6 ... ll_vec.png. I want to see, to which nodes it connects to. Javascript simulator sort of highlights connected nodes then you click on it. Or it's just white line crossing over yellow rectangle makes it look more bright. This simulator is so blurry then you zoom.
edit hero: SB stands for what bus? Stack?
t u r b o e d i t: http://visual6502.org/wiki/index.php?ti ... 2_datapath
Two interesting signals are dpc2_XSB (moves X to SB) and dpc3_SBX (moves SB to X). And I found SB, it's just near, it's called sb0. Now to figure out how this works.
http://wiki.breaknes.com/6502:regs
A few illustrations of registers.
Re: [dumb] questions about 6502 javascript simulator
Instruction Register, I guess.michikaze wrote:and where it fetches next opcode?
So. How works INX.
dpc2_XSB happens
X moves through SB SOMEWHERE
with dpc3_SBX it returns.
tide: right now I just click at these guys right above registers (dpc4_SSB, dpc7_SS, dpc12_0ADD, &c), look at the names of active ones, and see what they do here http://visual6502.org/wiki/index.php?ti ... 2_datapath http://www.weihenstephan.org/~michaste/ ... 2/6502.jpg https://github.com/trebonian/visual6502 ... denames.js
Re: [dumb] questions about 6502 javascript simulator
http://visual6502.org/wiki/index.php?ti ... te_Machine This page is isolated from everything, no category and nothing links to it.
Still searching for the part that does increment. I guess it's somewhere in ALU, and it's to the right of X register.
Can't understand how inverters http://wiki.nesdev.com/w/index.php/Visu ... #Inverters work. find somebody find an example of such invertor in the javascript emulator?
Still searching for the part that does increment. I guess it's somewhere in ALU, and it's to the right of X register.
Can't understand how inverters http://wiki.nesdev.com/w/index.php/Visu ... #Inverters work. find somebody find an example of such invertor in the javascript emulator?
Re: [dumb] questions about 6502 javascript simulator
Do you understand how the MOSFETs themselves work?
An example in Visual6502 is node "notir7" (generated all the way at the right edge of the schematic), which is inverted from "ir7" (reasonably enough)
An example in Visual6502 is node "notir7" (generated all the way at the right edge of the schematic), which is inverted from "ir7" (reasonably enough)
Re: [dumb] questions about 6502 javascript simulator
Not sure. I heard that MOSFETs are a bunch of transistors, and it's like switches that turn on and off other switches at unhuman speed.
Now I trying to figure out how MOSFETs here works. Green and red thingy always stay green and red, yellow turn orange, and blue turn purple. And that transparent something metal something turns red. And they interact. Somehow. Yes. And you have to guess where metal connects with everything else.
Where is an input for ir7 and notir7?
Now I trying to figure out how MOSFETs here works. Green and red thingy always stay green and red, yellow turn orange, and blue turn purple. And that transparent something metal something turns red. And they interact. Somehow. Yes. And you have to guess where metal connects with everything else.
Where is an input for ir7 and notir7?
Re: [dumb] questions about 6502 javascript simulator
Not wrong... Water metaphors are common, e.g. this.michikaze wrote:Not sure. I heard that MOSFETs are a bunch of transistors, and it's like switches that turn on and off other switches at unhuman speed.
Why don't you read the entirety of Ulfalizer's Visual Circuit Tutorial and ask for explanations where you get confused?Now I trying to figure out how MOSFETs here works. Green and red thingy always stay green and red, yellow turn orange, and blue turn purple. And that transparent something metal something turns red. And they interact. Somehow. Yes. And you have to guess where metal connects with everything else.
notir7 is inverted from ir7; ir7 is inverted from node 541. 541 is generated from cp1, fetch, and cclk.Where is an input for ir7 and notir7?