X816 Assembler > YMAS

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
User avatar
koitsu
Posts: 4214
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: X816 Assembler > YMAS 0.0180c

Post by koitsu » Sat Jun 08, 2019 11:26 pm

Checksum/complement generation seems faulty; SNES9x reports bad checksum during, ucon64 reports same. FC /B at end.

Code: Select all

uCON64 2.1.0 Win32 (MinGW) 1999-2017
Uses code from various people. See 'developers.html' for more!
This may be freely redistributed under the terms of the GNU Public License

D:\Work\hdmademo\ymas\hdmademo.sfc.bak

Multi Game Doctor 2/MGD2/Multi Game Hunter/MGH

00007fb0  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
00007fc0  28 43 29 20  31 39 39 33  20 4e 6f 72  6d 61 6e 20  (C) 1993 Norman
00007fd0  59 65 6e 20  20 20 00 08  00 01 ff 00  a2 b6 5d 49  Yen   ........]I

Super Nintendo Entertainment System/SNES/Super Famicom
(C) 1993 Norman Yen
Unknown
U.S.A.
131072 Bytes (1.0000 Mb)

Padded: Maybe, 26285 Bytes (0.2005 Mb)
Interleaved/Swapped: No
Backup unit/emulator header: No
HiROM: No
Internal size: 2 Mb
ROM type: (0) ROM
ROM speed: 200 ns (SlowROM)
SRAM: No
Version: 1.0
Checksum: Bad, 0x92ba (calculated) != 0x495d (internal)
Inverse checksum: Bad, 0x6d45 (calculated) != 0xb6a2 (internal)
Checksum (CRC32): 0x90d7bf21

Code: Select all

D:\Work\hdmademo\ymas>fc /b hdmademo.sfc hdmademo.sfc.bak
Comparing files hdmademo.sfc and HDMADEMO.SFC.BAK
00007FDC: 45 A2
00007FDD: 6D B6
00007FDE: BA 5D
00007FDF: 92 49

noyen1973
Posts: 27
Joined: Sat Oct 06, 2018 10:15 am

Re: X816 Assembler > YMAS 0.0180c

Post by noyen1973 » Sun Jul 21, 2019 1:42 am

Changed multiple statement delimiter to the colon (:).
Checksum looks to be fully matching with Ucon64 now.
Updated expression/function parsing.
Updated directive .IRQ to accept multiple commands on a line

Those are the primary updates. Mostly internal changes. The file 'opcodes.txt' is a brief run down of the directives and functions as well as my notes and future plans. Incomplete and definately needs more testing. I've been editting and reassembling source codes I find online to use as test material.
Last edited by noyen1973 on Thu Nov 14, 2019 1:30 pm, edited 1 time in total.

noyen1973
Posts: 27
Joined: Sat Oct 06, 2018 10:15 am

Re: X816 Assembler > YMAS 0.0180c

Post by noyen1973 » Mon Jul 22, 2019 4:17 pm

nicklausw wrote: The TW directive takes one word and one string, and each character of the string is OR'd with the word to output two new bytes.

Code: Select all

.TW $FF00,"HIYA"
HIYA is 48 49 59 41, so the output is FF 48 FF 49 FF 59 FF 41.

It's freaky, I know, but asm6 has always allowed some arithmetic on strings ("HIYA"-1 outputs 47 48 58 40) so this didn't seem too far out there. Hopefully a better solution can be found in some other assembler (most likely ca65) so my one loyal asm16 user can move on to better, much more well-maintained things.
A little late but I've implemented a similiar arithmetic operation in YMAS (I haven't submitted the version in the forum yet).

.word ('hiscore')<<8,$ffff results in 00 68 00 69 00 73 00 63 00 6F 00 72 00 65 FF FF
.byte 0,1,(0,1) xor $ff results in 00 01 FF FE

So the constant values are enclosed in brackets and the operating expression is acted on each value. So with your example, it would look like this (I just noticed your example is big endian but not a problem).
.rword ("HIYA") or $ff00 results in FF 48 FF 49 FF 59 FF 41

Works with standard arithmetic and bitwise operations (+,-,*,/,**,<<,>>,and,or,xor). And all physical values can be replaced with symbols.

Code: Select all

hiyatext='HIYA'
orvalue=$ff00
.rword (hiyatext) or orvalue

User avatar
Hamtaro126
Posts: 763
Joined: Thu Jan 19, 2006 5:08 pm

Re: X816 Assembler > YMAS 0.0180c

Post by Hamtaro126 » Thu Jul 25, 2019 7:15 pm

Thanks a million for implementing that feature the next version.

There is a limitation from the old X816 features that I will place here that I want either removed or user-defined: Please Increase the accessable ASC Letter/Number Table Limit from 0-31 to 0-255 (8-bit) by default,

And please add some sort of HEXIDECIMAL value support option as well for ASC tables, I do not like to have to open Calculator every time I want to make transfer of values...

and for 65816 mode, Values can be increased to other values up to 16-bit, especially combined with HEX values mode
AKA SmilyMZX/AtariHacker.

noyen1973
Posts: 27
Joined: Sat Oct 06, 2018 10:15 am

Re: X816 Assembler > YMAS 0.0180c

Post by noyen1973 » Fri Jul 26, 2019 5:44 pm

Hamtaro126 wrote:Thanks a million for implementing that feature the next version.

There is a limitation from the old X816 features that I will place here that I want either removed or user-defined: Please Increase the accessable ASC Letter/Number Table Limit from 0-31 to 0-255 (8-bit) by default,

And please add some sort of HEXIDECIMAL value support option as well for ASC tables, I do not like to have to open Calculator every time I want to make transfer of values...

and for 65816 mode, Values can be increased to other values up to 16-bit, especially combined with HEX values mode
I've been working on this directive in YMAS this past week. I've changed it to .CHARMAP and .CHAR/.CHARW. The actual value assigning hasn't been written yet but the ideas are the same, 'A'=1 or 65=1 or $41=1 or $41=$01 (yes, hex will be in there) or "A" to "Z"=$01. The use the of the double periods .. is now replaced with "to". I still need to add an option into the 'list' function to show in hex and a range to show. Here's an example on a single line:

.CHARMAP map="hiscore",mapsize=48,clear,' '=$00,'A' to 'Z'=$01,'0' to '9'=$20,list

Creates a character map named "hiscore", 48 tiles, clears all values to 0, space=0, A to Z starts at 1, 0 to 9 starts at 32, list the whole thing on screen.

You can create multiple character maps now and the map size can be 0-65535 characters/tiles using .CHAR for byte size and .CHARW for word size, kind of like .BYTE and .WORD except with .CHAR/.CHARW you can select the map to use at the beginning if not the currently selected map.

.CHAR (map="hiscore") "JONES 12345678"

The map names or numbers, if you prefer, can be replaced with symbol names too.

Code: Select all

hiscoremap="hiscore"
.CHAR (map=hiscoremap) "JONES 12345678"
Any more suggestions?

User avatar
Hamtaro126
Posts: 763
Joined: Thu Jan 19, 2006 5:08 pm

Re: X816 Assembler > YMAS 0.0180c

Post by Hamtaro126 » Fri Jul 26, 2019 6:04 pm

Not right now, In fact, I think the features are great when the newest version gets released.

Thanks again!!!
AKA SmilyMZX/AtariHacker.

User avatar
Hamtaro126
Posts: 763
Joined: Thu Jan 19, 2006 5:08 pm

Re: X816 Assembler > YMAS

Post by Hamtaro126 » Thu Sep 05, 2019 7:29 pm

It's been about two months, Is this project dead? or is this still active?
AKA SmilyMZX/AtariHacker.

noyen1973
Posts: 27
Joined: Sat Oct 06, 2018 10:15 am

Re: X816 Assembler > YMAS

Post by noyen1973 » Fri Sep 06, 2019 2:30 pm

Hamtaro126 wrote:It's been about two months, Is this project dead? or is this still active?
Still active but I've been busy and my spare time has been spent learning about compilers in general. The resources on compiler development 25 years ago was next to nil unless you went into computer studies at university. There's a wealth of information online to absorb and since I'm already in my upper 40's, learning is a much slower process when you have other commitments.

Here's what I've managed to get done since my last post.
  • 1. Added directives .CHARMAP, .CHAR and .CHARW for handling character/tile maps.
    2. Added directive .SAVEMAP to save a map of the used blocks of memory based on .ORG changes.
    3. Added directive .SAVEHEX to save Intel .hex files similar to .SAVEBIN with the addition of saving only assembled code/data based on .ORG changes.
    • (Now I can play around with some C256 Foenix coding)
    4. Added directive .SCOPE and .ENDSCOPE but needs further testing.
    5. Added conditional directive .ELSEIF.
    6. Added use of [] and {} as parenthesis () in expression parser.
    7. Added ternary operator ?: to expression parser but needs further testing.
Here's the latest version. "opcodes.txt" is the working list of directives, functions and instruction sets as well as my scratch pad but it's not needed by the executable.
Last edited by noyen1973 on Thu Nov 14, 2019 1:30 pm, edited 1 time in total.

noyen1973
Posts: 27
Joined: Sat Oct 06, 2018 10:15 am

Re: X816 Assembler > YMAS

Post by noyen1973 » Wed Oct 30, 2019 2:44 am

What's new:
  • 1. Recognizes // as beginning of a comment field (same as using ; comment).
    2. Added directives .DEFINE and .UNDEFINE.
    • Example:

      Code: Select all

      .snes lorom
      .define addab(a,b) a+b
      .define multab(a,b) a*b
      temp = addab 3,5 + multab 2,3+addab(2,1)
      .undefine addab,multab
      .define storename(name) .byte name,0
      storename "Jones",addab(2,3)
      .define rgb(r,g,b) .word ((b<<10)+(g<<5)+r)
      rgb(3,15,29)
      
Attachments
ymas00184a.7z
(122.96 KiB) Downloaded 28 times

Post Reply