when I dealt with banks, I saw a slight difference between nasasm3 and asm6:
nesasm3 - fills the unused space 0xFF (Undefined)
while asm6 - fills 0x00 (BRK)
Moderator: Moderators
Ok, by defaulttepples wrote:In ASM6, try fillvalue $FF
You're asking for a combination of 1) CPU memory map, and 2) list of MMIO registers (some call them "ports", for reasons unknown to mankind). You can find both here (refer to relevant links within wiki itself): https://wiki.nesdev.com/w/index.php/CPU_memory_mapDocWaluigean wrote:-Is there the ENTIRE map of CPU overview? Where each address specifies what it does, like $3F10 is used for palette assignment in those specific screen? I didn't see PPU overview until just now, so that's off the question, but what about the rest of them?
See above.DocWaluigean wrote: -$800 - $1FFF = nothing. Is it the NES system flaw or is it only usable for mapper? or that's actually Famicom before removed toward release in US?
- $0000-$07FF $0800 2KB internal RAMkoitsu wrote:You're asking for a combination of 1) CPU memory map, and 2) list of MMIO registers (some call them "ports", for reasons unknown to mankind). You can find both here (refer to relevant links within wiki itself): https://wiki.nesdev.com/w/index.php/CPU_memory_mapDocWaluigean wrote:-Is there the ENTIRE map of CPU overview? Where each address specifies what it does, like $3F10 is used for palette assignment in those specific screen? I didn't see PPU overview until just now, so that's off the question, but what about the rest of them?
See above.DocWaluigean wrote: -$800 - $1FFF = nothing. Is it the NES system flaw or is it only usable for mapper? or that's actually Famicom before removed toward release in US?
It's exactly what it says it is: memory range $0000 to $07FF is RAM. You can use it for whatever purpose you want. Most people use it for exactly what you described. But if you want to put code there and run code out of RAM, you can do it (ex. jmp $0400 will work exactly like you think, but it's up to to put the code into RAM first :-) ).DocWaluigean wrote:- $0000-$07FF $0800 2KB internal RAM
So are these temporary memory where you place code that's being active? [I.E., equipping level 4 sword, being on World 3-6, no save data until world 4]
Here I agree more withrainwarrior wrote:The use of $FF fill for EPROMs isn't really relevant for most people's workflow these days, though. I personally prefer filling with 0, because it creates a BRK opcode, which has more predictable behaviour in the accident that your program tries to execute an empty space.
$FF is some weird illegal opcode but it will keep executing, eventually try to execute the vector table, and then likely rolling over into ZP and start executing there where who knows what it's going to do.
BRK on the other hand goes straight to your interrupt handler.
You can even use the interrupt handler to trap errors this way. For me this was a big help for catching stack misuse errors (e.g. unpaired PHA/PLA). If you're using your IRQ for something else already, this may not be viable (you can detect the difference between a BRQ and a regular IRQ in the handler though), but even if you can't, I still think $00 fill is a vote for more predictable/detectable error conditions.
If you want to debug, do this on the emulator (for example, fceux), if you want to catch errors, use the emulator with a breakpoint on "break on bad operation" =)tepples wrote:It's conventional to fill with $FF because when programming UV EPROM, traditional EEPROM, or NOR flash, it's faster to program $FF than any other value.
Provided the emulators for your platform even support debugging. Though Mesen and FCEUX do, I doubt that is true of most emulators built for, say, the ARM architecture seen on Pinebook, Raspberry Pi, and Android tablets. Even if your PC is x86-64, you might not want to spend a gigabyte of a small SSD on installing Wine and/or Mono, and you might not want to tolerate the mandatory telemetry and other annoyances of Windows 10. (We've been through this before.)kocmoc wrote:Here I agree more withIf you want to debug, do this on the emulator (for example, fceux)tepples wrote:It's conventional to fill with $FF because when programming UV EPROM, traditional EEPROM, or NOR flash, it's faster to program $FF than any other value.
An authentic MOS 6502 will execute $FF as ISC aaaa,X, which performs INC aaaa,X then SBC aaaa,X. For example, FF 46 02 is ISC $0246,X, and FF FF FF is ISC $FFFF,X. The second source 6502 in the NES executes unofficial opcodes the same way as the original, given that it was cut from an identical mask with only the transistors enabling BCD addition and subtraction cut out. Or what external hardware did you have in mind for detecting that opcode and performing a soft reset?kocmoc wrote:PS The device does not execute this command, $ FF is a bad operation, it will be a software reset.
Code: Select all
***pseudocode***
DEF CAKE:
Milk = 1
Flour = 2
Eggs = 3
Sugar = 4
END DEF-First, the @DEFAULT: is it a label where you jump or go to when certain requires meet? or labels is completely different between BASIC and 6502?dougeff wrote:In Assembly, JOE, ROB, and JUMP could be RAM address, and @NAME is a label that the assembler will give a value to at assembly time. (Omitting some assembly directives to make it easier)JOE = 10
ROB = 5
JUMP = JOE + ROB
IF JOE == ROB
GOTO @NAME
LDA #10 ;load A with 10
STA JOE ;store it to JOE
LDA #5 ;load A with 5
STA ROB ;store it to ROB
LDA JOE ;load A with JOE
CLC ;clear the carry flag, for addition
ADC ROB ;add ROB to A
STA JUMP ;store the result to JUMP
LDA ROB ;load A with ROB
CMP JOE ;compare A with JOE
BEQ @NAME ;branch to the label @NAME if equal
Code: Select all
[color=#00BF00]LDA #10[/color] ;load A with 10
[color=#00BF00]STA JOE[/color] ;store it to JOE
[color=#00BF00]LDX #5[/color] ;load A with 5
[color=#00BF00]STX ROB[/color] ;store it to ROB
[color=#00BF00]LDA JOE[/color] ;load A with JOE
[color=#00BF00]CLC[/color] ;clear the carry flag, for addition
[color=#00BF00]ADC ROB[/color] ;add ROB to A
[color=#00BF00]STY JUMP[/color] ;store the result to JUMP
[color=#00BF00]LDY ROB[/color] ;load A with ROB
[color=#00BF00]CMP JOE[/color] ;compare A with JOE
[color=#00BF00]BEQ @NAME[/color] ;branch to the label @NAME if equalCode: Select all
[color=#00BF00]LDA #10[/color] ;load A with 10
[color=#00BF00]STX JOE[/color] ;store it to JOE
[color=#00BF00]LDY #5[/color] ;load A with 5
[color=#00BF00]STA ROB[/color] ;store it to ROB
[color=#00BF00]LDY JOE[/color] ;load A with JOE
[color=#00BF00]CLC[/color] ;clear the carry flag, for addition
[color=#00BF00]XDC ROB[/color] ;add ROB to A
[color=#00BF00]STA JUMP[/color] ;store the result to JUMP
[color=#00BF00]LDY ROB[/color] ;load A with ROB
[color=#00BF00]CMP JOE[/color] ;compare A with JOE
[color=#00BF00]BEQ @NAME[/color] ;branch to the label @NAME if equalI have no idea what you're trying to do here.DocWaluigean wrote:Is this correct? or what's missing pieces?
Yes, labels mark places in the code where you can jump to. A label is just a "nickname" for a memory location, so they're used for variables too, they're not just for jumping.-First, the @DEFAULT: is it a label where you jump or go to when certain requires meet?
You can change which registers are used for which task, but you have to be consistent (e.g. you can't use STX to write to memory a value that's in Y!) and you have to keep in mind that not all registers can do everything, all of them have different limitations.Now... this one will be strange or hilarious. Let say I change the words around, and change A into X or Y or other unmentioned register from BunnyBoy.
This is correct.LDA #10 ;load A with 10
STA JOE ;store it to JOE
This works fine too. If X isn't being used for anything else, you can use it as intermediate storage when writing a value to memory.LDX #5 ;load A with 5
STX ROB ;store it to ROB
Now this doesn't make sense, because Y doesn't contain the result of the addition, A does. The result is always in A, that's just how the ADC operation works: A = A + MEMORY + C. That STY will just store whatever Y contains into the JUMP variable.LDA JOE ;load A with JOE
CLC ;clear the carry flag, for addition
ADC ROB ;add ROB to A
STY JUMP ;store the result to JUMP
This also won't work, because CMP compares the accumulator against another value. There's another compare instruction for the Y register, CPY. If you use that instead of CMP, it'll work.LDY ROB ;load A with ROB
CMP JOE ;compare A with JOE
BEQ @NAME ;branch to the label @NAME if equal
Yes, they have limits. Math and bitwise operations can only be done with A. X and Y can only be incremented/decremented by 1, and are meant to be used as counters and indices (for accessing arrays and the like), with different addressing modes using them in different ways.or each registers has their own limits?
The number 10 is NOT being stored in JOE.LDA #10 ;load A with 10
STX JOE ;store it to JOE
Number 5 is NOT being stored in ROB. ROB will actually be 10, which is what A contains at this point (remember the LDA #10 from before? so yeah, a still contains 10).LDY #5 ;load A with 5
STA ROB ;store it to ROB
The "A" in ADC doesn't represent the accumulator. "ADC" is short for ADd with Carry. There's no instruction for adding X or Y to another value, only A can be added.LDY JOE ;load A with JOE
CLC ;clear the carry flag, for addition
XDC ROB ;add ROB to A
STA JUMP ;store the result to JUMP
Again, change that CMP to CPY and it'll work.LDY ROB ;load A with ROB
CMP JOE ;compare A with JOE
BEQ @NAME ;branch to the label @NAME if equal
Because you're not routing the values to the places where you want them to go.obviously something is wrong, but why?
The wrong values will go to the wrong variables, decisions will be made based on the wrong conditions, causing the logic you tried to implement to fail.and what result would it give if you go Leeroy Jenkins and keep the code in?
You just have to understand what the CPU does, and think like the CPU. Here's a page with all the instructions the CPU supports. Those are all the commands you have to implement the logic in your game. That's your tool box, and you'll have to make do with just that.Explain it in original way, and in Elementary School way please, so maybe I could write it down for user-friendly guides.
Comments are ignored by the assembler and don't take any space in the assembled binary. They exist to make the source code easier to comprehend, they don't affect the final ROM in any way.-I know comments, but does it waste spaces? And by how much each character?
I'm curious what makes you think this is true. If you know Japanese enough to understand they make coding fun, then you why not just follow the better, more fun ways to learn? If you don't know Japanese, how are you sure it's any different?Like I said, the other countries like Japan has made coding really fun, and I feel we're really behind if lesser-grammar people can't understand the US style.

That's one major difference between coding assembly, and coding high level languages.DocWaluigean wrote:It's my fault for not replying or read-and-think, and attempting to re-read it. But why is nearly every information has to be written so difficult?