Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2013-10-03 23:57:47

Pokemon_Master
Member
From: emuNAND
Registered: 2013-05-18
Post 331/947
Website

What is ASM ?

What is it ? I've heard this word many times in ROM Hacking. And what is the word calle d routine?

Offline

#2 2013-10-04 00:17:29

RaltVus
Member
From: Twinleaf Town (Sinnoh)
Registered: 2013-06-28
Post 122/548
Website

Re: What is ASM ?

Yes mate, i too want to know what is and how to use, as i'm tryin' to add some functions and items i think is better i know how to use!!!


RaltVus is back.

I'm not hacking in the moment, but i always had ideas to give. Just ask me if you want.

MY FACEBOOK

Offline

#3 2013-10-04 07:43:06

Miksy91
Member
Registered: 2010-10-16
Post 1,919/2,308

Re: What is ASM ?

The games are made of bits, or in other words, zeroes and ones. All the game's data looks like this: 00011011100101010111000111.....
Because working out with binary numbers (consisting of only 0 and 1) is close to impossible for a normal human, we use hexadecimal system for describing 8-bit binary number sets as bytes.

So you could raise a question: "What's convenient about 8-bit numbers then?"

Assembly (or just "ASM") is a programming language that is used to tell the CPU what to do. All of its instructions of Gameboy CPU are either 8, 16, or 24 bits long (so, 1, 2 or 3 bytes long!). And the data this programming language can work with is mostly also restricted to 8 or 16 bit structures (1 or 2 bytes).

If you want to learn how to make use of assembly, you first of all have to know what programming is about. No one taught me how to program - I learned the (very) basics by designing scripts for DE. ASM isn't really any different.
You write script in Gameboy ASM language, and
1) Insert it to the rom with an assembler
2) Write the script data with a hex(/asm) editor in the game

The option #2 is quite easily achieved as well since like I pointed out earlier, all the asm instructions are 8, 16 or 24 bits long. Thus, you can write asm code just by replacing bytes with bytes that represent different asm instructions. To be precise, all the instructions are 8 bits long, but they can have parameters that take either 8 or 16 bits.

Offline

#4 2013-10-04 12:33:00

Pokemon_Master
Member
From: emuNAND
Registered: 2013-05-18
Post 332/947
Website

Re: What is ASM ?

Miksy91 wrote:

The games are made of bits, or in other words, zeroes and ones. All the game's data looks like this: 00011011100101010111000111.....
Because working out with binary numbers (consisting of only 0 and 1) is close to impossible for a normal human, we use hexadecimal system for describing 8-bit binary number sets as bytes.

So you could raise a question: "What's convenient about 8-bit numbers then?"

Assembly (or just "ASM") is a programming language that is used to tell the CPU what to do. All of its instructions of Gameboy CPU are either 8, 16, or 24 bits long (so, 1, 2 or 3 bytes long!). And the data this programming language can work with is mostly also restricted to 8 or 16 bit structures (1 or 2 bytes).

If you want to learn how to make use of assembly, you first of all have to know what programming is about. No one taught me how to program - I learned the (very) basics by designing scripts for DE. ASM isn't really any different.
You write script in Gameboy ASM language, and
1) Insert it to the rom with an assembler
2) Write the script data with a hex(/asm) editor in the game

The option #2 is quite easily achieved as well since like I pointed out earlier, all the asm instructions are 8, 16 or 24 bits long. Thus, you can write asm code just by replacing bytes with bytes that represent different asm instructions. To be precise, all the instructions are 8 bits long, but they can have parameters that take either 8 or 16 bits.

Thanks for this. And wich program can write/edit ASM ? Also what can i do whith PKSV ?

Offline

#5 2013-10-04 14:02:32

RaltVus
Member
From: Twinleaf Town (Sinnoh)
Registered: 2013-06-28
Post 123/548
Website

Re: What is ASM ?

I have one ASM if i remember is GBASM i found in romhcking.net!!!


RaltVus is back.

I'm not hacking in the moment, but i always had ideas to give. Just ask me if you want.

MY FACEBOOK

Offline

#6 2013-10-04 16:15:33

Pokemon_Master
Member
From: emuNAND
Registered: 2013-05-18
Post 333/947
Website

Re: What is ASM ?

raltvus wrote:

I have one ASM if i remember is GBASM i found in romhcking.net!!!

Ferrnando,can you give me the full link? Please!

Offline

#7 2013-10-04 18:08:24

RaltVus
Member
From: Twinleaf Town (Sinnoh)
Registered: 2013-06-28
Post 124/548
Website

Re: What is ASM ?

@Pokemon_Master:
Here's the link!!!
www.romhacking.net/utilities/282/


RaltVus is back.

I'm not hacking in the moment, but i always had ideas to give. Just ask me if you want.

MY FACEBOOK

Offline

#8 2013-10-04 19:17:56

Pokemon_Master
Member
From: emuNAND
Registered: 2013-05-18
Post 335/947
Website

Re: What is ASM ?

raltvus wrote:

@Pokemon_Master:
Here's the link!!!
www.romhacking.net/utilities/282/

Thanks Ferrnando.(if i am right your name is so)

Offline

#9 2013-10-04 20:30:33

RaltVus
Member
From: Twinleaf Town (Sinnoh)
Registered: 2013-06-28
Post 125/548
Website

Re: What is ASM ?

Yeah this is my name snif* you remember!!! haha but only with one "r"

Last edited by RaltVus (2013-10-04 20:31:13)


RaltVus is back.

I'm not hacking in the moment, but i always had ideas to give. Just ask me if you want.

MY FACEBOOK

Offline

#10 2013-10-04 20:52:11

comet
Member
Registered: 2012-04-09
Post 303/673

Re: What is ASM ?

bgb lets you edit your rom in real time and has its own assembly editor

you can also use a symfile (crystal) to work with labels instead of arbitrary addresses

Offline

#11 2013-10-05 06:50:22

Pokemon_Master
Member
From: emuNAND
Registered: 2013-05-18
Post 338/947
Website

Re: What is ASM ?

comet wrote:

bgb lets you edit your rom in real time and has its own assembly editor

you can also use a symfile (crystal) to work with labels instead of arbitrary addresses

Thanks,comet

Offline

#12 2013-10-15 02:09:36

halcyon
Member
Registered: 2013-10-14
Post 3/11

Re: What is ASM ?

Hello, I have a question pertaining to ASM. Instead of creating a new thread, I decided to post it here. I've been trying to add the Dark, Steel and brand-new Fairy types into Red version. I've already added them to the type effectiveness chart and then I progressed to adding their names in. This is where I hit a brick wall. There isn't any blank space in bank 9, so I can't simply repoint to the blank space and add the names. Do I have to learn ASM to point to blank space elsewhere in the ROM? I was already planning on doing this but now it seems as though I'll be learning it earlier than I intended to.

Offline

#13 2013-10-15 02:24:02

Danny-E 33
Administrator
Registered: 2012-06-09
Post 659/1,023

Re: What is ASM ?

Repointing the table of names should not be necessary. The table of type names at 0x27de4 does not have to be contiguous; meaning you can add new type names at the end of the bank without moving the existing names

Here's why:
Try looking just before the type names at 0x27dae. This is a list of pointers to the text strings for every type name. At the beginning of this list of pointers, you see E4 7D. This points to the text string "NORMAL".
A few bytes later, you see E4 7D over and over again. Every time you see that pointer, it is for an unused type id. (id's 0x9-0x13 to be exact)

So what you can do is take one of these pointers to the "NORMAL" text string and change it to point to free space. (but don't change the very first pointer to "NORMAL" of course)
Then at the beginning of free space, add the bytes for "DARK", "STEEL" and "FAIRY" or whatever, but remember to end each name with a 50 to tell the game the text string is finished.
And remember to change three different pointers to point to the three new names.


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#14 2013-10-15 03:14:59

stag019
Idea Killer
Registered: 2011-01-05
Post 505/630

Re: What is ASM ?

But wait.

Is Fairy going to be a physical type or a special type?


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#15 2013-10-15 03:39:05

halcyon
Member
Registered: 2013-10-14
Post 4/11

Re: What is ASM ?

I haven't thought about that. I'm going to have to find out how that's done.

Offline

#16 2013-10-15 04:20:29

stag019
Idea Killer
Registered: 2011-01-05
Post 507/630

Re: What is ASM ?

halcyon wrote:

I haven't thought about that. I'm going to have to find out how that's done.

Oh that's real easy.
Look at "CalculateDamage".


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#17 2013-10-15 13:31:16

Danny-E 33
Administrator
Registered: 2012-06-09
Post 660/1,023

Re: What is ASM ?

Ah, yep that routine makes it easy to divide the unused id's, 0x9-0x13, between normal and special however you want.


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#18 2013-10-17 02:03:43

halcyon
Member
Registered: 2013-10-14
Post 5/11

Re: What is ASM ?

So I'll need to learn Z80. What is a good resource that will help me reach that end?

Offline

#19 2013-10-17 03:46:39

stag019
Idea Killer
Registered: 2011-01-05
Post 509/630

Re: What is ASM ?


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#20 2013-11-09 13:24:06

Pokemon_Master
Member
From: emuNAND
Registered: 2013-05-18
Post 531/947
Website

Re: What is ASM ?

Are the game data rated in this way?:

0001
0010
0011
0100
0101
0111
or not.

Last edited by Pokemon_Master (2013-11-09 13:25:16)

Offline

#21 2013-11-09 20:52:02

Pokemon_Master
Member
From: emuNAND
Registered: 2013-05-18
Post 547/947
Website

Re: What is ASM ?

Pokemon_Master wrote:

Are the game data rated in this way?:

0001
0010
0011
0100
0101
0111
or not.

Can someone tell me are they correct?

Offline

#22 2013-11-09 21:01:31

Danny-E 33
Administrator
Registered: 2012-06-09
Post 680/1,023

Re: What is ASM ?

No one has responded because your question doesn't make any sense.
What are you trying to ask here?


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#23 2013-11-09 21:18:41

Pokemon_Master
Member
From: emuNAND
Registered: 2013-05-18
Post 549/947
Website

Re: What is ASM ?

Danny-E 33 wrote:

No one has responded because your question doesn't make any sense.
What are you trying to ask here?

Oh not yet. What i am asking: If i load the rom in any Asm editor will  the ones and zeroes be shown in this way:

00001,00011,0011,
01111,
10000,10001,10011,1011,11111
or i'm wrong

Offline

#24 2013-11-09 23:08:10

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 912/1,194
Website

Re: What is ASM ?

Pokemon_Master wrote:
Danny-E 33 wrote:

No one has responded because your question doesn't make any sense.
What are you trying to ask here?

Oh not yet. What i am asking: If i load the rom in any Asm editor will  the ones and zeroes be shown in this way:

00001,00011,0011,
01111,
10000,10001,10011,1011,11111
or i'm wrong

He probably says your question makes no sense, because you won't see Bits (like 0101) in an ASM editor at all.. Nor Hex Bytes. You will see Z80 commands, or opcodes. (Like ld a, b $A7C5)


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#25 2013-11-09 23:09:49

Miksy91
Member
Registered: 2010-10-16
Post 1,964/2,308

Re: What is ASM ?

Every decimal or hexadecimal number has a binary presentation.
For example number "5" is "101" in binary system.

Long binary numbers aren't really readable for a human so we use hexadecimal number system instead. I can't think of any editor that would show data in binary instead of decimal or hexadecimal.

Offline

Board footer

Powered by FluxBB