News:

As a consequence of the forum being updated and repaired, the chatbox has been lost.
However, you can still come say hi on our Discord server!

Main Menu

Post your GBA ASM Questions here.

Started by Daddy Poi's Oily Gorillas, 03, November, 2010, 06:10:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Daddy Poi's Oily Gorillas

#60
GBATEK says:
QuoteTHUMB.18: unconditional branch

  15-11  Must be 11100b for this type of instructions
  N/A    Opcode (fixed)
          B label   ;branch (jump)
  10-0   Signed Offset, step 2 ($+4-2048..$+4+2046)

Return: No flags affected, PC adjusted.
Execution Time: 2S+1N

So yes, it is just r15 + 4 +/- offset. (+/- since it is a signed number.) - And "step 2" just means that the actual value should be multiplied by 2 (Probably <<1) , since thumb is 16-bit, and it'd be dumb to point to a non-16-bit aligned address.)


So... If one was making code for that... you could do something like this: (Assuming thumbCode var is an int (Signed 32-bit) ... (The actual data itself is 16-bit.))

r15 + ((thumbCode << 21) >> 20) + 4

That way, you convert it to signed, AND have the step two all down with ease.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

I do understand the THUMB branch.

It it the ARM one I'm curious about.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#62
Oh. (Shame on me for not paying attention... since the whole system of code is pretty much ARM7, but then ARM/THUMB are sub categories...)

QuoteBranch and Branch with Link (B, BL, BLX_imm)
Branch (B) is supposed to jump to a subroutine. Branch with Link is meant to be used to call to a subroutine, return address is then saved in R14.

  Bit    Expl.
  31-28  Condition (must be 1111b for BLX)
  27-25  Must be "101" for this instruction
  24     Opcode (0-1) (or Halfword Offset for BLX)
          0: B{cond} label    ;branch            PC=PC+8+nn*4
          1: BL{cond} label   ;branch/link       PC=PC+8+nn*4, LR=PC+4
          H: BLX label ;ARM9  ;branch/link/thumb PC=PC+8+nn*4+H*2, LR=PC+4, T=1
  23-0   nn - Signed Offset, step 4      (-32M..+32M in steps of 4)

Branch with Link can be used to 'call' to a sub-routine, which may then 'return' by MOV PC,R14 for example.
Execution Time: 2S + 1N
Return: No flags affected.
This says PC=PC+8+nn*4 , so it is quite similar. (As far as I know.)



---

Meanwhile... in Arm-ville.... - https://www.arm.com/products/processors/instruction-set-architectures/index.php - Interesting to know about A64,,,, (Possibly the third and newest instruction set?) - I wonder if there'll be an instruction set that is variable... where each opcode info could technically be assigned by the user in the code or as header data.  (Of course, that could be optional, but it is just what I'm thinking, and I can imagine it still being just as fast. - Although, I am not sure, b/c I don't know the hardware limits.)

For example, if you know for a fact you won't need a certain series of instructions, then you could technically extend a different one, etc. (Or whatever it is you want.) But I'm mostly thinking of how automatic compilers could do it / similar to huffman compression, maybe.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 29, October, 2016, 04:07:48 AM
This says PC=PC+8+nn*4 , so it is quite similar. (As far as I know.)
okay so if the B is at 0x00000000 and the offset = 000001
It's: 0x00000008 + 000001 * 4 = 0x0000000C
And hey, that works fine for the VBA disassembler! :happy:

The minus singed offset works somewhat different, but I think I can figure it out.
Quote from: Fox
Meanwhile... in Arm-ville.... - https://www.arm.com/products/processors/instruction-set-architectures/index.php - Interesting to know about A64,,,, (Possibly the third and newest instruction set?) - I wonder if there'll be an instruction set that is variable... where each opcode info could technically be assigned by the user in the code.  (Of course, that could be optional, but it is just what I'm thinking, and I can imagine it still being just as fast. - Although, I am not sure, b/c I don't know the hardware limits.)
For example, if you know for a fact you won't need a certain series of instructions, then you could technically extend a different one, etc. (Or whatever it is you want.) But I'm mostly thinking of how automatic compilers could do it / similar to huffman compression, maybe.
is A64 that new? Oh I see. Some new versions lately.
Well, altough it is not exactly what you mean, the N64 allows for some user created micro-coding, hence why some games are still hard to emulate.

Well, I don't think ARM CPU's will ever include something like user created instructions. That would not really fit the RISC theme.
Intel is kind of stuborn with it's x86 so I don't think you would see it there as well.

Fast? Well it is just other instructions. It might be a bit faster because you could somehow chain things (like barrel shifter in ARM7TDMI) or optimize something else. But chaging the main ALU's won't be a thing I guess.

That article about CPU's and moore's law that was posted here some while ago, said something about CPU's becoming more dedicated to certain fields of application. More dedication means scrapping certain instructions and replacing them with more fitting ones.
But if the producer dedicates them, it is likely that, as a user, you can't change them back.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#64
--
@A64: I don't mean new as in right now (maybe), but new as in latest...

Micro-code? Hmm... May need to look into that. (Never really got into N64 hacking yet... But probably will eventually.)

@ARM/Intel = I don't think so either, unless another company buys them out and decides to do it? But then it wouldn't really be ARM/Intel at that point, I guess.

@Fast: I don't know for certain (since one has to see how the hardware operates.. e.g. does it stall....) - But for anything speed concerning, I would imagine the only thing that actually is important is what is in loops, everything else is not worth the time in optimizing. (And is likely not going to make the system seem slow.) - So pretty much (following my idea)... you could do such instruction set optimization(s) right before every loop that would occur..... Although, there could be a problem with that if you have a function call in a loop, and that function sets such optimizations because it also has a (smaller) loop. So I guess maybe all the tables could be set ahead of time. (Assuming you could use a pointer to the new set for each loop.)

@ALU = Well, what if you want to only use 4 registers instead of 8 for them? Or anything that's similar to that type of thinking... so as to allow for space for other instructions.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 29, October, 2016, 05:32:02 AM
Micro-code? Hmm... May need to look into that. (Never really got into N64 hacking yet... But probably will eventually.)
Yeah well. N64 assembly is possible, but it is a lot harder than the GBA. It is quite funny that both have a big instruction set, but in reality, they both use the smallest set. (in GBA THUMB and N64 has 64 bit code, but there are few games that even use it).
Quote from: Fox
@ALU = Well, what if you want to only use 4 registers instead of 8 for them? Or anything that's similar to that type of thinking... so as to allow for space for other instructions.
Oh aha. I forgot all about specific registers...
Yeah there might actually be a lot of speed gain from going back to Z80 style registers.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#66
Wait? GBA THUMB has 64-bit code? ... Interesting? Mind refreshing me brain on what that was? (Closest thing I found was bl, which is 32-bit... Well, I think it is actually just two separate instructions read as though it is one in assembly.)

@speed gains: Also depends on how the data is read.. like if simultaneous or not. I mean, 32-bit computers can read 32-bits at a time, I think... so... anything fitting that, I'm not sure if speed is wasted or not. (Further operations on the data = speed waste, though. = I'm guessing an example of that would be checking the conditional bit(s) in ARM if you rarely do conditionals.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 29, October, 2016, 06:43:36 AM
Wait? GBA THUMB has 64-bit code? ... Interesting? Mind refreshing me brain on what that was? (Closest thing I found was bl, which is 32-bit... Well, I think it is actually just two separate instructions read as though it is one in assembly.)
No. The Nintendo 64 has 64 bit instructions, but never actually uses them.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

Oh. So I read incorrectly, okay... (The wording does seem a bit strange, though... but maybe it's just me.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

#69
Okay I finally got an ARM MOV instructions working!

but I noticed something strange with the memory and dissassembler.
[spoiler][/spoiler]
It looks like the bytes are re-ordered in LOFI manner.
I'm sure you guys are familiar with this and I can't seem to find it on GBATEK.

I heard some stuff about the endiasness in GBA... but a different endianness can be done by a rotate around the exact middle.
So can anyone tell me why the instructions are loaded this way and if it is the case for every memory?

EDIT:
Now I am also a bit confused about MOV. MOV does only move values between registers right? And LDR should be used when loading stuff from any memory?
(oh and yeah, I'm just changing values in the bios and disassembling them to see what instructions I get)
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#70
-Because it is little endian, and that's how the GBA works? (All GBA instructions and memory loads/stores (ldr*/str*) are done that way.) Shouldn't you be clicking the 32-bit radio button?

@MOV: Well, not "move" in the sense of taking a value (removing it from there), and putting it somewhere else... but basically setting a register to a value. (Similar to LDR-relative, but the constant is being in the same instruction, instead of pointing to a 32-bit located in a pool..)
MOV r0, #0x08000000 is exactly this: r0 = 0x08000000. (Or in English, set register r0 to 0x08000000.)
@LDR: Yep!.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

#71
Quote from: Fox on 09, November, 2016, 08:22:45 AM
-Because it is little endian, and that's how the GBA works? (All GBA instructions and memory loads/stores (ldr*/str*) are done that way.) Shouldn't you be clicking the 32-bit radio button?
Whoopss... I forgot that button... thanks!!!
And I really had no idea that little endian in 8-bit would swap it that way. I thought it would work differently.
Quote from: Fox
@MOV: Well, not "move" in the sense of taking a value (removing it from there), and putting it somewhere else...
He, I know right? Who ever came up with keeping the name 'move'?
Quote from: Fox
but basically setting a register to a value. (Similar to LDR-relative, but the constant is being in the same instruction, instead of pointing to a 32-bit located in a pool..)
MOV r0, #0x08000000 is exactly this: r0 = 0x08000000. (Or in English, set register r0 to 0x08000000.)
@LDR: Yep!.
Can you give an example of a MOV Immediate address? I can't find the right bits.
And what you tell me here confuses me. So there are two different instructions that do the same aside from two things?
MOV: copy value of one register to another OR copy the value at an address to a register.
LDR: copy the value at an address to a register.
They are both capable of shifting the loaded values as well?

EDIT: (lets throw another question in!) there is this infinite loop in the BIOS at 0x00000210: EB000002 (BL $00000220).
in the disassamble I can see that R14 contains 0x0000020C.
And I don't understand this. Branching means literally executing the statement at the address right? So it should branch to 220, but instead it stays on 210.
Also, the link given to R14 is not the place where said branch leads to...

Thanks in advance. (no pun intended)
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#72
You are welcome.
If your data is 8-bits, there's no need to swap anything around.. :) But code isn't in 8-bit, so you'd have to do it.

No idea, but it still makes sense, I guess... and that's all that matters... I guess..?

I used MOV r0, #0x08000000 as the example, because I saw it in your picture. :)

QuoteMOV: copy value of one register to another OR copy the value at an address to a register.
@First one: Yeah... If looking at one set of instructions...

I mean, Thumb does the hi-register specific ones with like a very limited number of instructions... (Includes mov) -- and add, r#, r#, 0x0 is used when you are "copying" only from/to low registers, since the hi-register ones don't really allow that. (Probably supposed to be labeled as a pseudo-instruction for mov?), but there are other instruction(s) that are also of "mov"... Mov-immediate.

@Second one: Nah? Unless for the second one, you are pretty much saying the address of that instruction or something? But even then....


@MOV-immediate: The value is part of the code itself. In thumb, the constant was 8-bit, in ARM, don't remember... (Too lazy to look up?)
@LDR: Yep! This is the most versatile method, since you can get every bit exactly the way you want it for just one instruction.... (But it's better to use mov if you're only needing a simple value.)
And yeah, the value is there in the register, so any following instruction can do whatever it wants with it.... (If it needs to.)

If you are like at:
> bl $00000220
You will still need to continue executing for 1~2 instructions.... (If you're in thumb, and count blh/ second part of the bl instruction.) then you should have jumped.
R14 is Link Register. It holds the Return address... (Basically the address after the bl instruction.) ... and not the address of the function you are calling. - It is possible to use LR as a general register, though.

---
Although I can verify that BIOS is ARM code, can't quite say that I recommend it to be a good first-place to study ARM code, though.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 09, November, 2016, 04:40:45 PM
I used MOV r0, #0x08000000 as the example, because I saw it in your picture. :)
Now I see.
Quote from: Fox
@First one: Yeah... If looking at one set of instructions...
I mean, Thumb does the hi-register specific ones with like a very limited number of instructions... (Includes mov) -- and add, r#, r#, 0x0 is used when you are "copying" only from/to low registers, since the hi-register ones don't really allow that. (Probably supposed to be labeled as a pseudo-instruction for mov?), but there are other instruction(s) that are also of "mov"... Mov-immediate.
Yeah I forgot to write down that Mov can be used to put an immediate in a register.
I also know that Mov is pretty usefull in THUMB because of the Hi/Lo.
Quote from: Fox
@Second one: Nah? Unless for the second one, you are pretty much saying the address of that instruction or something? But even then....
Uhh... so only LDR can load shifted values from an address?

Quote from: Fox
@MOV-immediate: The value is part of the code itself. In thumb, the constant was 8-bit, in ARM, don't remember... (Too lazy to look up?)
I'll figure it out.
Quote from: Fox
@LDR: Yep! This is the most versatile method, since you can get every bit exactly the way you want it for just one instruction.... (But it's better to use mov if you're only needing a simple value.)
And yeah, the value is there in the register, so any following instruction can do whatever it wants with it.... (If it needs to.)
I guess that clears things up inmensly.
Quote from: Fox
If you are like at:
> bl $00000220
You will still need to continue executing for 1~2 instructions.... (If you're in thumb, and count blh/ second part of the bl instruction.) then you should have jumped.
Okay... I understand the thing with Pipelining and it probably has to do with this...
But what two instructions are executed? VBA disassembler stays on the BL instruction...

Quote from: Fox
R14 is Link Register. It holds the Return address... (Basically the address after the bl instruction.) ... and not the address of the function you are calling. - It is possible to use LR as a general register, though.
Oh yeah..
Quote from: Fox
Although I can verify that BIOS is ARM code, can't quite say that I recommend it to be a good first-place to study ARM code, though.
I don't. I just use the memory there to look at how it disassembles (obviously, I puzzle the instruction together using GBATEK and if I know how one works I add it to an ARM chart), because BIOS is the first addressable area.
And yeah, BIOS has some strange code.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#74
QuoteUhh... so only LDR can load shifted values from an address?
Out of all the instructions, I think only LDR* can load any value from any address? (If ignoring the very data of the instruction that you are executing.)
While I know all Thumb code instructions, I don't think I know all ARM code instructions. (But I do know right many of them.) Not sure how co-processor works. But it's rarely seen anyway.... (On top of the fact that most code in these GBA games are Thumb... But I do know some games like The Lost Vikings was mostly Arm.)

Immensely, yeah. :)

--
@Two instructions: I was referring to Thumb mode, and how the "bl" instruction is made up of two instructions.... And what I said was based on if you were executing in SDL-H... I probably could check the regular VBA, but I'd need to download it again, because my primary computer is in a broken state at the moment.

What does your ARM chart look like at the moment? You know GBATEK does have a chart for the Formats that you can use to help.... ARM9 ones are not on the GBA.

Referring to this:
[spoiler]ARM Binary Opcode Format
  |..3 ..................2 ..................1 ..................0|
  |1_0_9_8_7_6_5_4_3_2_1_0_9_8_7_6_5_4_3_2_1_0_9_8_7_6_5_4_3_2_1_0|
  |_Cond__|0_0_0|___Op__|S|__Rn___|__Rd___|__Shift__|Typ|0|__Rm___| DataProc
  |_Cond__|0_0_0|___Op__|S|__Rn___|__Rd___|__Rs___|0|Typ|1|__Rm___| DataProc
  |_Cond__|0_0_1|___Op__|S|__Rn___|__Rd___|_Shift_|___Immediate___| DataProc
  |_Cond__|0_0_1_1_0|P|1|0|_Field_|__Rd___|_Shift_|___Immediate___| PSR Imm
  |_Cond__|0_0_0_1_0|P|L|0|_Field_|__Rd___|0_0_0_0|0_0_0_0|__Rm___| PSR Reg
  |_Cond__|0_0_0_1_0_0_1_0_1_1_1_1_1_1_1_1_1_1_1_1|0_0|L|1|__Rn___| BX,BLX
  |1_1_1_0|0_0_0_1_0_0_1_0|_____immediate_________|0_1_1_1|_immed_| BKPT ARM9
  |_Cond__|0_0_0_1_0_1_1_0_1_1_1_1|__Rd___|1_1_1_1|0_0_0_1|__Rm___| CLZ  ARM9
  |_Cond__|0_0_0_1_0|Op_|0|__Rn___|__Rd___|0_0_0_0|0_1_0_1|__Rm___| QALU ARM9
  |_Cond__|0_0_0_0_0_0|A|S|__Rd___|__Rn___|__Rs___|1_0_0_1|__Rm___| Multiply
  |_Cond__|0_0_0_0_1|U|A|S|_RdHi__|_RdLo__|__Rs___|1_0_0_1|__Rm___| MulLong
  |_Cond__|0_0_0_1_0|Op_|0|Rd/RdHi|Rn/RdLo|__Rs___|1|y|x|0|__Rm___| MulHalfARM9
  |_Cond__|0_0_0_1_0|B|0_0|__Rn___|__Rd___|0_0_0_0|1_0_0_1|__Rm___| TransSwp12
  |_Cond__|0_0_0|P|U|0|W|L|__Rn___|__Rd___|0_0_0_0|1|S|H|1|__Rm___| TransReg10
  |_Cond__|0_0_0|P|U|1|W|L|__Rn___|__Rd___|OffsetH|1|S|H|1|OffsetL| TransImm10
  |_Cond__|0_1_0|P|U|B|W|L|__Rn___|__Rd___|_________Offset________| TransImm9
  |_Cond__|0_1_1|P|U|B|W|L|__Rn___|__Rd___|__Shift__|Typ|0|__Rm___| TransReg9
  |_Cond__|0_1_1|________________xxx____________________|1|__xxx__| Undefined
  |_Cond__|1_0_0|P|U|S|W|L|__Rn___|__________Register_List________| BlockTrans
  |_Cond__|1_0_1|L|___________________Offset______________________| B,BL,BLX
  |_Cond__|1_1_0|P|U|N|W|L|__Rn___|__CRd__|__CP#__|____Offset_____| CoDataTrans
  |_Cond__|1_1_0_0_0_1_0|L|__Rn___|__Rd___|__CP#__|_CPopc_|__CRm__| CoRR ARM9
  |_Cond__|1_1_1_0|_CPopc_|__CRn__|__CRd__|__CP#__|_CP__|0|__CRm__| CoDataOp
  |_Cond__|1_1_1_0|CPopc|L|__CRn__|__Rd___|__CP#__|_CP__|1|__CRm__| CoRegTrans
  |_Cond__|1_1_1_1|_____________Ignored_by_Processor______________| SWI
[/spoiler]
But you'd still need to look at the actual instructions themselves. (Scroll up from there for brief explanations, or scroll down for more specific stuff.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 10, November, 2016, 08:51:57 AM
Out of all the instructions, I think only LDR* can load any value from any address?
Okay then.
Quote from: Fox
While I know all Thumb code instructions, I don't think I know all ARM code instructions. (But I do know right many of them.) Not sure how co-processor works. But it's rarely seen anyway.... (On top of the fact that most code in these GBA games are Thumb... But I do know some games like The Lost Vikings was mostly Arm.)
Yeah, well I wasn't even sure if I am going to use much ARM at all... I mean, if you want to execute it fast, the best way is to put it in the IWRAM. And you can only store about 900 ARM instructions there...
Maybe I should just use THUMB and learn ARM when I need it?
Quote from: Fox
Immensely, yeah. :)
Hey I learned something besides assembly today!
Quote from: Fox
@Two instructions: I was referring to Thumb mode, and how the "bl" instruction is made up of two instructions.... And what I said was based on if you were executing in SDL-H... I probably could check the regular VBA, but I'd need to download it again, because my primary computer is in a broken state at the moment.
BL made up of two instructions... damn.
But yeah, the thing was a BL in ARM not THUMB.
Quote from: Fox
What does your ARM chart look like at the moment? You know GBATEK does have a chart for the Formats that you can use to help.... ARM9 ones are not on the GBA.
Referring to this:
But you'd still need to look at the actual instructions themselves. (Scroll up from there for brief explanations, or scroll down for more specific stuff.)
I basically took the THUMB chart and started adding ARM stuff.
But it looks shitty and have only two instuctions in there. While I want to have around 100 I guess?

If I am going to use ARM more, I will finish that chart. Because, GBATEK is just a bit to technical to be convenient IMO.
That's why I like the thumb chart, it's just pure Hex of an instruction + description.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#76
QuoteBL made up of two instructions... damn.
Well, two 16-bits... But I assume they are both a type of blh or something. (Depending on how you see it.) The second one can be used by itself, so...

F000 = LR = PC+4+(nn SHL 12)
F800 = PC = LR + (nn SHL 1), and LR = PC+2 OR 1 This one sets the Return address.

QuoteBut yeah, the thing was a BL in ARM not THUMB.
And that's why I said 1~2.... instead of just 2...

But I agree that pure hex = Cool stuff. (While I also think GBATEK is better than nothing. - It seems short and to the point if you already know what it all means.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

My apology, life got me away, school.... people who want to ruin my life... etc.
Anyways. My idea is to convert the old code to see how it works and then edit and polish it for completely new engine.
Like if we have a GS ROM ASM code converted to C with all the data within and working thing. Then we can edit small details on the engine and make it work on PC. Then purify the code and then see what does what. In the end we have a new source code resource for our projects

Daddy Poi's Oily Gorillas

#78
That's okay... People come in and out all the time, I'm sure, so it is to be expected.

That idea sounds extremely similar to my own... (Or even Open GS if you made it a PC game.) ... But then later, I decided that it'd be even smarter/faster to simply convert machine code to ASM code... converting all pointers to labels to be converted back to pointers using armips. ; At least as a possible pre-requisite to any future plans like that of converting to a C language or such... Etc.

Since converting straight to C/C++ would take an extraordinary amount of time.

Plus, having an ASM option gives us that good feel... and people can really learn what the GBA is made of.

---
But note that I may or may not be working on the project at the moment... since the primary computer I use was... er... broke... (Probably no hard drive issues? - But it just simply wouldn't boot passed a flash of a button. - If I had to take a guess, it was probably a power issue.) (BUT I did upload stuff to github so it's not like I lost anything related to the project itself...)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Lord Wolfram
My apology, life got me away, school.... people who want to ruin my life... etc.
Anyways. My idea is to convert the old code to see how it works and then edit and polish it for completely new engine.
Like if we have a GS ROM ASM code converted to C with all the data within and working thing. Then we can edit small details on the engine and make it work on PC. Then purify the code and then see what does what. In the end we have a new source code resource for our projects.
Which old code?
We might have OpenGoldenSun.
Aye, a C source would be nice, but even if labeling is easy, the code might look like a mess where things really aren't that easy to change.
In any case, I would prefer to have OpenGoldenSun, or just Hex edit GS (either RAM or instructions).

Quote from: FoxPlus, having an ASM option gives us that good feel... and people can really learn what the GBA is made of.
I sure hope you don't mean assembly in armips or Devkitarm?
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"