It is currently Tue Oct 17, 2017 11:51 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 1373 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10 ... 92  Next
Author Message
 Post subject:
PostPosted: Mon May 30, 2011 4:32 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 797
Location: cypress, texas
unregistered wrote:
tokumaru wrote:
...So you don't have to replace anything, just read my example as if I had writen "vblank" instead of "NMI".

*Big sigh of relief* :) Thank you.

waaaaaaait. Um, isn't "NMI" more correct than "vblank"? A vblank is an NMI... but aren't there other NMI?? So, if that is a yes, then it would make more sense for it to be called "NMI"... i guess, right? I'm almost to the point, because it is used in FamiTone, where I'm going to change it to NMI from vblank. Please help me. :)

edit: --------------------
a reply to you, qbradq, isnt wirtten yet. Sorry. :(


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 30, 2011 5:02 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19086
Location: NE Indiana, USA (NTSC)
NMI is an interrupt signal that begins to be asserted at the start of vertical blanking. NMI ends when vblank ends, but NMI also ends on $2002 read. In fact, turning $2000 bit 7 off and on during a single vblank (without reading $2002) causes multiple NMIs. An NMI handler can end before or after NMI ends. The behavior of $2003-$2007 depends on vblank state, disirregardless of NMI state.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 30, 2011 5:16 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10046
Location: Rio de Janeiro - Brazil
It doesn't matter what you call it, as long as you do it consistently. From a technical perspective "NMI" is not the same as "VBlank". VBlank is a period when we are allowed to make changes to VRAM, and the NMI is an interrupt that fires when this period starts, so that we can be sure to make use of it.

VBlanks are the only source of NMIs on the NES, the IRQs are the ones that can be generated by different sources, such as the APU or mappers.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 30, 2011 11:59 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 797
Location: cypress, texas
tepples wrote:
The behavior of $2003-$2007 depends on vblank state, disirregardless of NMI state.
Going to stick with vblank! Thanks tepples! :)

tokumaru wrote:
It doesn't matter what you call it, as long as you do it consistently. From a technical perspective "NMI" is not the same as "VBlank". VBlank is a period when we are allowed to make changes to VRAM, and the NMI is an interrupt that fires when this period starts, so that we can be sure to make use of it.

VBlanks are the only source of NMIs on the NES, the IRQs are the ones that can be generated by different sources, such as the APU or mappers.
Great dialogue! :)

Thanks so much tokumaru and tepples! :D I'm not going to change it to NMI; I promise. : )


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 02, 2011 2:21 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 797
Location: cypress, texas
I'm trying to build my .nes file, but I recieve errors that say Unknown label. and Can't determine address. All of the errors are listed being in my FamiTone music file that was created for me by FamiTone with the -asm6 flag. All of the errors are found on lines that just have a @label (temporary label). There is only one regular label at the top and i tried to add regular label at the bottom, but it listed thta line as an error too. I'm so lost as to what to do now :? ... could you help me?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 02, 2011 5:39 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
Time to move to NESASM3? :P


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2011 3:13 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 797
Location: cypress, texas
3gengames wrote:
Time to move to NESASM3? :P
hehe asm6 continues to rock. :)

So, God helped me make progress again!!! :D But, my question should go to Shiru...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2011 3:30 pm 
Offline
User avatar

Joined: Wed Oct 15, 2008 11:50 am
Posts: 939
Have you seen QASM? It's totally super awesome. It'll even clean your toilets!

Actually it is still likely to have bugs :( I wouldn't recommend it for a newer developer due to that. You might hit a bug in the assembler and think you're doing something wrong.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2011 3:42 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 797
Location: cypress, texas
qbradq wrote:
Have you seen QASM? It's totally super awesome. It'll even clean your toilets!

Actually it is still likely to have bugs :( I wouldn't recommend it for a newer developer due to that. You might hit a bug in the assembler and think you're doing something wrong.


Haha :lol: , that's pretty good (edit: i'm sorry for my failure at being honest here) : ) Thanks for sharing........ and a reply to you is still on its way. :(

edit: Spent some time learning about qasm from qasm_dev.zip. It's exciting and fun! :D I'm looking forward to it. :)


Last edited by unregistered on Sat Jun 04, 2011 9:51 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2011 9:30 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 797
Location: cypress, texas
In asm6 when trying to understand .enum and .ende they use $200. What do the 3 digits mean?
README.TXT wrote:
Reassign PC and suppress assembly output. Useful for defining
variables in RAM.

ENUM $200
foo: db 0
foo2: db 0
ENDE

Does $200 = $0200 or $2000 or what else? Is this three digit implementation only in asm6? Is it only used with .enum? Could you use 4 digits? What important thing did I miss reading? :?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2011 10:36 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10046
Location: Rio de Janeiro - Brazil
unregistered wrote:
Does $200 = $0200 or $2000 or what else?

$0200

Quote:
Is this three digit implementation only in asm6?

No.

Quote:
Is it only used with .enum?

No.

Quote:
Could you use 4 digits?

Yes.

Quote:
What important thing did I miss reading? :?

None, he was just skipping the leading zero. Sometimes people use only 3 digits when referencing RAM on the NES because the NES has only $800 bytes of it.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2011 10:36 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3941
You completely misunderstood what enum does.

It temporarily changes the Current Address ($), and temporarily stops any bytes from being emitted in the output, but addresses continue to increase as bytes or instructions are defined.

So you do ENUM $200. You set the current address to $200, so your next label starts there. You have a .db 0, so the address goes up by 1, and the next label uses that address.

Later you do .ende, so it gets out of ENUM mode, and goes back to generating code as usual, at the previous address that was used before enum mode was turned on.

You use enum mode to define a bunch of labels in a block using space-filling syntax, instead of adding 1 to previously defined addresses in chains.

With enum mode:

.enum $200
label1: .db 0
label2: .db 0
label3: .dw 0
label4: .dsb 32
label5: .db 0
.ende

Without enum mode:

label1 = $200
label2 = label1 + 1
label3 = label2 + 1
label4 = label3 + 2
label5 = label4 + 32

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2011 10:49 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10046
Location: Rio de Janeiro - Brazil
BTW, .enum is great for declaring variables. You can have .enum blocks wherever you want, as they don't mess up the program counter. I use it, for example, to declare "local" variables, variables that are used only during parts of the program, so there's no need to waste RAM locations for them permanently.

After the global variables of each page, I put a marker label:

Code:
   .enum $0300 ;variables in page 3

SomeArray .dsb 64
MyVariable .dsb 1
AnotherVariable .dsb 1
Pointer .dsb 2
LocalVariables3 ;this marks the starting point for local variables

   .ende

And then, at the top of each module's file I do something like this:

Code:
   .enum LocalVariables3 ;local variables in page 3

LocalVariable .dsb 1
AnotherOne .dsb 2
SmallArray .dsb 12

   .ende

And I can continue to fill page 3 from where I left off. This is the safest and most organized way I found to reuse RAM in different parts of the program. You can safely rearrange/add/remove global variables and as long as the total doesn't extrapolate the memory you have free it will still work fine.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 05, 2011 6:13 am 
Offline
User avatar

Joined: Wed Oct 15, 2008 11:50 am
Posts: 939
qasm_dev.zip is actually older than the current release right now :D Grab qasm_v0_05.zip for the latest. If you want to learn about how an assembler is coded in the classic style have a look at qasm_v0_01.zip. That is a traditional two-pass assembler without expressions and macros.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2011 1:51 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 797
Location: cypress, texas
tokumaru, thank you for answering all of my questions! :) Makes sense.

Dwedit, wow, thank you! Now I have an extensive understanding of enum mode; and even know what it would be like to not have enum mode! :D Which is really helpfull, to me!

tokumaru wrote:
I use it, for example, to declare "local" variables, variables that are used only during parts of the program, so there's no need to waste RAM locations for them permanently.


!!So that means we could declare a variable... and then, later on, since the previous variable was local... and we are in a different area of code, we could declare another variable in the same spot!? That would be incredible... like REALLY! :D Just like local variables in C++? If I understood you correctly here, could you answer this next question? If all of the files combine in to one single .asm file then how does this work when there is just one file? The whole thing doesn't make sense to me... there's something I'm missing. :(

qbradq wrote:
If you want to learn about how an assembler is coded in the classic style have a look at qasm_v0_01.zip.
Maybe this could help me understand what im missing above. Cause the local variables in an asm program is what im missing AND your assembler probagbly deals with local variables. Thanks qbradq. : )


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1373 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10 ... 92  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group