6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Jul 03, 2024 4:00 am

All times are UTC




Post new topic Reply to topic  [ 132 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9  Next
Author Message
 Post subject:
PostPosted: Wed Feb 29, 2012 10:17 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Thanks again Bitwise!
What is actually involved in making these 'minor' adjustments to your JAVA creation? Could a layman like myself do them?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 01, 2012 8:19 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
If you can program in Java then the code is quite easy to fix. For example here a link to the patch for the last bug fix

http://dev65.svn.sourceforge.net/viewvc/dev65/trunk/src-65016/org/x6502/x65016/As65016.java?r1=16&r2=15&pathrev=16

You'd need a Subversion client, a copy of the Eclipse IDE with the 'Subclipse' plug in installed, a sourceforge account and access permission to commit changes back to repository -- All these are free downloads and registrations + me granting you repository access.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 07, 2012 2:42 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Not so easy, heh...

Are you sure that's the update? I'm getting all zero page opcodes again, even LDA$xxxxxxxx which was fixed before... I'll try the ! expression.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 07, 2012 10:45 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
ElEctric_EyE wrote:
Not so easy, heh...

Are you sure that's the update? I'm getting all zero page opcodes again, even LDA$xxxxxxxx which was fixed before... I'll try the ! expression.


Curious. I get
Code:
FFFFF000  00BD8000FFFF      :                 LDA $FFFF8000,X
FFFFF003  00BD8000FFFF      :                 LDA !$FFFF8000,X
FFFFF006  00BD8000FFFF      :                 LDA |$FFFF8000,X
                             
FFFFF009  00B58000          :                 LDA $00008000,X
FFFFF00B  00BD80000000      :                 LDA !$00008000,X
FFFFF00E  00BD80000000      :                 LDA |$00008000,X
                             
FFFFF011  00EE8000FFFF      :                 INC $FFFF8000
FFFFF014  00EE8000FFFF      :                 INC !$FFFF8000
FFFFF017  00EE8000FFFF      :                 INC |$FFFF8000
                                                             
FFFFF01A  00E68000          :                 INC $00008000
FFFFF01C  00EE80000000      :                 INC !$00008000
FFFFF01F  00EE80000000      :                 INC |$00008000

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 08, 2012 1:11 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
It works. I forgot it optimizes $00000001 to $0001...

Some more observations as I am testing more opcodes on my .b core:

1) STA $xxxx,Y ($0091) is observed as STA $xxxxxxxx,Y ($0099). In fact, all odd opcodes in column 1 have this problem, i.e. ($0011,$0031,$0051,$0071... observed as $0019,$0039,$0059,$0079, etc.)

Thanks for your continued support!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 08, 2012 4:52 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
ElEctric_EyE wrote:
It works. I forgot it optimizes $00000001 to $0001...

Some more observations as I am testing more opcodes on my .b core:

1) STA $xxxx,Y ($0091) is observed as STA $xxxxxxxx,Y ($0099). In fact, all odd opcodes in column 1 have this problem, i.e. ($0011,$0031,$0051,$0071... observed as $0019,$0039,$0059,$0079, etc.)

Thanks for your continued support!


In the WDC datasheet $91 is STA (zp),Y. Only LDX and STX have a zp,Y addressing mode so the assembler uses the abs,Y instruction where zp,Y isn't available.
Code:
FFFFF02B  009980000000      :                 STA $00008000,Y
FFFFF02E  009980000000      :                 STA !$00008000,Y
FFFFF031  009980000000      :                 STA |$00008000,Y
FFFFF034  00910001          :                 STA ($0001),Y
FFFFF036  00110001          :                 ORA ($0001),Y
FFFFF038  00B61234          :                 LDX $1234,Y
FFFFF03A  00961234          :                 STX $1234,Y

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 08, 2012 7:11 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
DOH, I knew that. Indirect Indexed. :oops:
Still it is an interesting feature of your assembler. Thanks, I think As65 is bug free now!


Top
 Profile  
Reply with quote  
PostPosted: Thu May 31, 2012 5:09 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
In As65, I am using simple macro's like for instance:
Code:
LDBi              .MACRO          ;LDB #$xxxx
                  .BYTE $01A9
                  .ENDM


And so when I write the assembly I have to do this:
Code:
LDBi
.BYTE $00FF


What is the syntax of the macro have to look like to have the assembly abit more agreeable to the eyes?
Code:
LDBi, $00FF
or
Code:
LDBi $00FF
or something along these lines.

Ideally, it would look like
Code:
LDBi #$00FF
Is this possible?

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
PostPosted: Thu May 31, 2012 6:23 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8462
Location: Southern California
In that case, with the three commercial assemblers I've worked with, you would put the name of a macro variable in the macro definition line:
Code:
LDBi:  .MACRO  param
       .BYTE   $1A9, param
       .ENDM
 ;---------------------

Something I liked about the 2500AD assembler is that you could have any number of parameters, and have, in essence, "If there is a fourth parameter, do this; if there is a fifth one, do that," etc..

For different address modes, you would probably have to use another parameter to tell it which addressing mode you want, or put it in the mnemonic, which is what I did in my super-simple Forth assembler, so it takes for example, LDA# or LDA_ZP or LDA_ZP,X etc.. Not being familiar with As65 though, I suspect the range of characters it lets you put in a label (as for macro names) is more limited.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu May 31, 2012 10:18 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
As65 accepts named or numbered arguments. So you can write either
Code:
LDBi    .MACRO  param
        .BYTE   $1A9,param
        .ENDM

or
Code:
LDBi    .MACRO
        .BYTE   $1A9,\0
        .ENDM

In both cases you invoke it with
Code:
        LDBi    $1234

If you wanted to extend the assembler to understand a new opcode the you would add a block like the following but change the constants in the switch to the correct values of the LDB opcodes
Code:
   /**
    * An <CODE>Opcode</CODE> that handles the LDA instruction.
    */
   protected final Opcode    LDA      = new Opcode (KEYWORD, "LDA")
   {
      /**
       * {@inheritDoc}
       */
      public boolean compile ()
      {
         switch (parseMode ()) {
         case IMMD:   genImmd (0x00A9, arg);   break;
         case DPAG:   genDpag (0x00A5, arg);   break;
         case ABSL:   genAbsl (0x00AD, arg);   break;
         case DPGX:   genDpag (0x00B5, arg);   break;
         case ABSX:   genAbsl (0x00BD, arg);   break;
         case DPGY:
         case ABSY:   genAbsl (0x00B9, arg);   break;
         case INDX:   genDpag (0x00A1, arg);   break;
         case INDY:   genDpag (0x00B1, arg);    break;
         case INDI:   genDpag (0x00B2, arg);   break;

         default:
            error (ERR_ILLEGAL_ADDR);
         }
         return (true);
      }
   };

You have to make a couple of other small tweaks but that's the most of it.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 01, 2012 12:27 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Code:
LDBi              .MACRO  param        ;LDB #$xxxx
                  .BYTE $01A9, param
                  .ENDM

This is giving me 'invalid expression' error. Your second example yields same result. What could I be doing wrong?

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 01, 2012 1:04 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
ElEctric_EyE wrote:
Code:
LDBi              .MACRO  param        ;LDB #$xxxx
                  .BYTE $01A9, param
                  .ENDM

This is giving me 'invalid expression' error. Your second example yields same result. What could I be doing wrong?

Curious, I get:
Code:
FFFFF03C                      LDBi            .MACRO  param
                                              .BYTE   $01A9,param
                                              .ENDM
                                             
                                             
                                              .EXTERN fred
                                              LDBi    $00ff
FFFFF03C  01A900FF          +                 .BYTE   $01A9,$00ff
                                              LDBi    fred
FFFFF03E  01A90000          +                 .BYTE   $01A9,fred
                                              LDBi    1+2*3
FFFFF040  01A90007          +                 .BYTE   $01A9,1+2*3

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 01, 2012 1:22 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Ok. Thanks for checking...
Is this sufficient for the beginning of a 65016 boot.asm file, or am I missing something?
Code:
     .CODE
     .ORG   $FFFFC000


I'm running NMAKE from a DOS command window under Windows XP SP3.

NMAKE is giving me 13 of these identical errors if this is any clue.

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 01, 2012 1:48 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Send me a copy of your boot.asm file

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 01, 2012 1:57 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Ah, I am dense. It works. I didn't realize when I change the macro parameters, I need to change the way the macro's are invoked. The errors were all the times the macro was improperly invoked, using the old syntax. Sorry about that.

Now, extending your assembler seems interesting, where would I add that block? You made provisions for $B2, the indirect indexed W addressing mode? Although it seems like more work, it may be worth it in order to get the assembly looking exactly as it should. I'd like to experiment with this.

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


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

All times are UTC


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: