It is currently Sun Oct 22, 2017 12:27 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Jul 29, 2017 2:07 pm 
Offline
User avatar

Joined: Mon Mar 13, 2017 5:21 pm
Posts: 5
I'm sorry if this has already been answered somewhere, but I really looked and couldn't find it.
I'd like to create pointer tables where the low bytes and high bytes are separated out like this example from the wiki:
Code:
PointerTableL
  .db <Pointer1, <Pointer2

PointerTableH
  .db >Pointer1, >Pointer2

I'm trying to do this in NESASM and it gives a Syntax error. Is it possible to do this in NESASM? if not, I may finally have to switch to another assembler.


Top
 Profile  
 
PostPosted: Sat Jul 29, 2017 3:26 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 808
Location: Sweden
Nesasm is using LOW(label) and HIGH(label) functions instead of <label and >label. And BTW doing <label in an instruction means zero page addressing.


Top
 Profile  
 
PostPosted: Sat Jul 29, 2017 4:00 pm 
Offline
User avatar

Joined: Mon Mar 13, 2017 5:21 pm
Posts: 5
Thank you for the answer. I thought that I had already tried the functions that way and they didn't work, but I tried them again just now and they did, so I must have been doing something wrong before. I was already aware of using < for zero page. I programmed my entire first game without knowing that though, so I'm sure the code was running a lot slower than it should have been :) fortunately it was a pretty simple game.


Top
 Profile  
 
PostPosted: Sun Jul 30, 2017 4:05 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 808
Location: Sweden
Nesasm is very poorly documented, the readme doesn't explain all features of the assembler.

Apparently it's made from an old 6502 assembler and modified to make NES and PC Engine specific programs. Then at one point it was split up into two assemblers: PCEas and NESASM. PCEas has since been forked with lots of features including <, > and ^ as aliases for the LOW(), HIGH() and BANK() functions and removal of the mandatory 8k bank segments. But I don't think NESASM have gotten all these upgrades.


Top
 Profile  
 
PostPosted: Sun Jul 30, 2017 7:39 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 929
I have made "Unofficial-MagicKit" which does have various upgrades (although not the < and > like that; it uses < for zero-page addressing), although it is probably even more confusing than PCEas and other assemblers. But it does mean that you can write a macro to write the tables for you so that you need not write them all by hand (you can even postprocess the tables if you need to).

_________________
.


Top
 Profile  
 
PostPosted: Mon Jul 31, 2017 3:30 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 808
Location: Sweden
Ah yes this one right? Lots of new features! But you never removed the 8k banks did you? That is what I think most people dislike the most about Magickit/PCEas/NESASM.

I'm pretty sure Elmer's fork of PCEas still uses < for zero page addressing while using <, > and ^ aliases for the mentioned functions. I don't know if he had to do something special to make sure it doesn't conflict.

Actullay the use of < for zero page addressing is one thing I like about Magickit/PCEas/NESASM. It makes it clear that you are using zero page addressing (if I remember to use it that is), and it makes it possible to choose which addressing mode you want (if you need it for timing or whatever). ASM6 always assumes zero page addressing when using zero page registers.


Top
 Profile  
 
PostPosted: Mon Jul 31, 2017 9:11 am 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 929
Pokun wrote:
Ah yes this one right? Lots of new features! But you never removed the 8k banks did you? That is what I think most people dislike the most about Magickit/PCEas/NESASM.
True, but it can be mitigated by "bank chaining", where you declare the chained 8K banks ahead of time with the same name, and it will automatically go to the next 8K bank if it is already defined with the same name as the current bank.

Quote:
I'm pretty sure Elmer's fork of PCEas still uses < for zero page addressing while using <, > and ^ aliases for the mentioned functions. I don't know if he had to do something special to make sure it doesn't conflict.
It doesn't seem difficult to me, since using < for zero page already implies the low 8-bits (although perhaps sometimes it can make it more difficult to detect errors).

Quote:
Actullay the use of < for zero page addressing is one thing I like about Magickit/PCEas/NESASM. It makes it clear that you are using zero page addressing (if I remember to use it that is), and it makes it possible to choose which addressing mode you want (if you need it for timing or whatever).
Yes, it is one of the things I like about it too.

_________________
.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 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