(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-02-24 10:14 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Writing an assembler. Want some input. New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Unicorn_Poop

Micro-Goomba


 





Since: 12-21-05
From: Knox-Vegas

Last post: 6456 days
Last view: 6456 days
Posted on 08-27-06 02:29 AM Link | Quote
I am planning to write an assembler that will run on the SNES. I figure this would be a good project to hone my assembly skills on the 65816 and the SNES in general.

To use my program, my plan is to write straight up ASM mnemonic code in a simple text editor like Notepad. Next, using a program such as windhex, the user would insert the text file binary into the ROM starting at a specific location. The program would be able to assemble one full data bank worth of code (due to RAM constraints) and output the resulting machine code to RAM bank $7E.

To make this project worth while, I plan to enable the assembler to use labels for subroutines, data arrays, databases, and branch commands that can be unique to up to 32 characters.

I would like input as to what assembler commands I should include. So far I have decided upon 6 that I will program in, but due to my lack of assembler familiarity, I would like to know if anybody else has some good ideas for assembler commands that I'm overlooking.

The commands I will include are as follows:
1)Declare Subroutine - Used to name Subroutines
2)Declare Array - Used to name variables
3)Declare Database - Used to name and insert raw binary data such as graphics, sound, pointer tables, etc.
4)Halt Assembly - Kills assembly of the program and displays the stats of the work done
5)Force Output Address - Forces the assembly output to a specific address.
6)Comment - duh.

After the assembly completes, a report would be displayed showing the names of various objects within the assembly and their addresses. Also included would be stuff like how many bytes the assembled code is, number of opcodes, etc.

Assembly would halt if an error occured, such as bad ASM mnemonic, opcode/addressing mode mismatch, assembly output overflows the RAM bank, undeclared variable detected, etc.

If ya got any ideas, I would like to hear your input.
Gavin

Cheep-cheep
Vandalism is not tolerated


 





Since: 11-17-05
From: IL, USA

Last post: 6359 days
Last view: 6302 days
Posted on 08-28-06 02:16 PM Link | Quote
Those sweet-ass +'s and -'s that x816 uses for quick relative branching and other shit:

...


labelOne:
lda $00, X
sta $2006
dex
beq -; branches to labelOne

labelTwo:
jmp +; jumps to labelJump

labelJump:
jmp --; jumps to labelOne
Unicorn_Poop

Micro-Goomba


 





Since: 12-21-05
From: Knox-Vegas

Last post: 6456 days
Last view: 6456 days
Posted on 08-28-06 04:44 PM Link | Quote
I was thinking about adding those branch commands, but I found them a little confusing when you try to write consecutive programs in the same file with multiple instances of +'s and -'s.

So my idea was to make it more general by allowing you to use any one character (I might change it to three characters) as a branch label. To make the branches more clear, the branch instruction in question would contain the branch tag followed by a description that would be over looked by the assembler.

i.e.
+ LDA $1234
DEC A
BNE {+, countdown loop}
STA $0000

Then again, another possibilty that I've entertained is to have a special assembler command that can be used to erase the temporary list of branch labels used in a sub routine so as to allow multiple instances of the same branch label within the 256 bytes the labels are valid

i.e.
= LDA $1234
DEC A
BNE {=, countdown loop}
STA $0000

Clear Branch Labels

= LDA $1111
TAX
STA $0001,X
DEC
BNE {=, fill array}

where these programs are right next to each other in the assembled file. This would probally be to confusing, though, and may make it hard to locate branch labels in the negative direction.
jeff

Double metal axe








Since: 11-17-05

Last post: 6282 days
Last view: 6282 days
Skype
Posted on 08-28-06 06:27 PM Link | Quote
the main reason i like using - and + is because i didn't have to waste time writing out label names for simple things. if i really wanted to know what they were, i'd just comment what it was doing.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - Writing an assembler. Want some input. |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.038 seconds; used 365.04 kB (max 433.08 kB)