Register - Login
Views: 99379838
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
04-23-22 11:06:57 PM
Jul - SM64 Hacking (Archive) - Mario 64 'C' header files New poll - New thread - New reply
Pages: 1 2 3 Next newer thread | Next older thread
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 2613/5390
EXP: 29050417
For next: 284588

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 333 days
Last activity: 333 days

Posted on 11-24-09 02:17:00 AM (last edited by HyperHacker at 11-23-09 11:22 PM) Link | Quote
Post #2613 - 11-23-09 09:17:00 PM
So apparently I have to ask again in here. I'm on Xubuntu and my MIPS 'as' is doing stupid optimizations and breaking my code.
For some reason I've had to compile it as "mips-unknown-linux-gnu-as" and similar. It doesn't support the -mno-gpopt flag, so I call it as such:
mips-unknown-linux-gnu-as -EB -mabi=32 -march=vr4300 -mtune=vr4300 -mno-shared -K --warn $1.asm -o $1.elf

Then I throw together some quick dummy code:
LUI $k1, 0x8034
LB $t0, 0xB21D($k1)

BNEL $t0, $zero, next
ADDIU $t0, $t0, 0x0001
BEQZ $a0, next
ADDIU $t0, $t0, 0xFFFF
LUI $t3, 0x5555

next: ADDIU $zero, $zero, 0x1234
and here's what it gets turned into: 0: 3c1b8034 lui k1,0x8034
4: 3c080001 lui t0,0x1
8: 011b4021 addu t0,t0,k1
c: 8108b21d lb t0,-19939(t0)
10: 55000006 bnezl t0,2c
14: 00000000 nop
18: 25080001 addiu t0,t0,1
1c: 10800003 beqz a0,2c
20: 00000000 nop
24: 2508ffff addiu t0,t0,-1
28: 3c0b5555 lui t3,0x5555

0000002c :
2c: 24001234 li zero,4660
For some reason it's decided to go changing how I use $k1, and rearranged my branches in a manner that is anywhere from inefficient to just broken depending on the code. Adding the -g or -g2 flags does not change this.

Additionally, objcopy isn't able to extract the code (though objdump disassembles it fine). It just outputs 24 bytes of zeros, or nothing at all.

____________________
why not?
messiaen
Catgirl
Level: 68


Posts: 698/1085
EXP: 2594039
For next: 134761

Since: 11-20-07


Since last post: 8.1 years
Last activity: 7.2 years

Posted on 11-24-09 01:38:14 PM Link | Quote
Someone told me there were some bugs with MIPS in newer versions of GCC. Try getting some older versions here. As for the delay slots, AFAIR 'as' automatically adds them, and I'm not sure how to change this behavior (have you tried different -o flags?)

Haven't looked much at assemblers, however I know hcs has one assembler he used to built the Neon64 emulator. Also, this one has been released recently.
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 2625/5390
EXP: 29050417
For next: 284588

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 333 days
Last activity: 333 days

Posted on 11-25-09 12:00:57 AM (last edited by HyperHacker at 11-24-09 09:11 PM) Link | Quote
Post #2625 - 11-24-09 07:00:57 PM
Well I downloaded the version of binutils linked there, and compiled it with the specified flags. That sure didn't work:a.asm: Assembler messages:
a.asm:1: Error: illegal operands `lui $k1,0x8034'
a.asm:2: Error: illegal operands `lb $t0,0xB21D($k1)'
a.asm:4: Error: illegal operands `bnel $t0,$zero,next'
a.asm:5: Error: illegal operands `addiu $t0,$t0,0x0001'
a.asm:6: Error: illegal operands `beqz $a0,next'
a.asm:7: Error: illegal operands `addiu $t0,$t0,0xFFFF'
a.asm:8: Error: illegal operands `lui $t3,0x5555'


Apparently this silly thing doesn't even support register names. And it still has the bugs I mentioned above.

____________________
why not?
Pages: 1 2 3 Next newer thread | Next older thread
Jul - SM64 Hacking (Archive) - Mario 64 'C' header files New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

29 database queries.
Query execution time:  0.097321 seconds
Script execution time:  0.009790 seconds
Total render time:  0.107111 seconds


TidyHTML vomit below
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 2 column 300 - Warning: unescaped & or unknown entity "&page"
line 119 column 11 - Warning: <form> isn't allowed in <table> elements
line 118 column 10 - Info: <table> previously mentioned
line 120 column 11 - Warning: missing <tr>
line 120 column 119 - Warning: missing </font> before </td>
line 124 column 16 - Warning: plain text isn't allowed in <tr> elements
line 120 column 11 - Info: <tr> previously mentioned
line 125 column 68 - Warning: missing </nobr> before </td>
line 141 column 68 - Warning: missing </nobr> before <tr>
line 147 column 35 - Warning: missing <tr>
line 147 column 50 - Warning: missing </font> before </td>
line 148 column 37 - Warning: unescaped & or unknown entity "&id"
line 147 column 196 - Warning: missing </font> before </table>
line 149 column 35 - Warning: missing <tr>
line 149 column 94 - Warning: unescaped & or unknown entity "&page"
line 149 column 126 - Warning: unescaped & or unknown entity "&page"
line 149 column 50 - Warning: missing </font> before </td>
line 149 column 163 - Warning: missing </font> before </table>
line 156 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 158 column 9 - Warning: missing <tr>
line 176 column 13 - Warning: missing <tr>
line 177 column 101 - Warning: unescaped & or unknown entity "&postid"
line 179 column 85 - Warning: <style> isn't allowed in <td> elements
line 179 column 9 - Info: <td> previously mentioned
line 198 column 3287 - Error: <next> is not recognized!
line 198 column 3287 - Warning: discarding unexpected <next>
line 201 column 3415 - Error: <next> is not recognized!
line 201 column 3415 - Warning: discarding unexpected <next>
line 206 column 3563 - Error: <next> is not recognized!
line 206 column 3563 - Warning: discarding unexpected <next>
line 213 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 215 column 9 - Warning: missing <tr>
line 233 column 13 - Warning: missing <tr>
line 234 column 101 - Warning: unescaped & or unknown entity "&postid"
line 241 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 243 column 9 - Warning: missing <tr>
line 261 column 13 - Warning: missing <tr>
line 262 column 101 - Warning: unescaped & or unknown entity "&postid"
line 264 column 85 - Warning: <style> isn't allowed in <td> elements
line 264 column 9 - Info: <td> previously mentioned
line 276 column 17 - Warning: missing <tr>
line 276 column 17 - Warning: discarding unexpected <table>
line 279 column 35 - Warning: missing <tr>
line 279 column 94 - Warning: unescaped & or unknown entity "&page"
line 279 column 126 - Warning: unescaped & or unknown entity "&page"
line 279 column 50 - Warning: missing </font> before </td>
line 279 column 163 - Warning: missing </font> before </table>
line 281 column 35 - Warning: missing <tr>
line 281 column 50 - Warning: missing </font> before </td>
line 282 column 37 - Warning: unescaped & or unknown entity "&id"
line 281 column 196 - Warning: missing </font> before </table>
line 283 column 17 - Warning: discarding unexpected </textarea>
line 283 column 28 - Warning: discarding unexpected </form>
line 283 column 35 - Warning: discarding unexpected </embed>
line 283 column 43 - Warning: discarding unexpected </noembed>
line 283 column 53 - Warning: discarding unexpected </noscript>
line 283 column 64 - Warning: discarding unexpected </noembed>
line 283 column 74 - Warning: discarding unexpected </embed>
line 283 column 82 - Warning: discarding unexpected </table>
line 283 column 90 - Warning: discarding unexpected </table>
line 285 column 9 - Warning: missing </font> before <table>
line 297 column 25 - Warning: discarding unexpected </font>
line 306 column 37 - Warning: discarding unexpected </font>
line 284 column 1 - Warning: missing </center>
line 120 column 63 - Warning: <img> lacks "alt" attribute
line 125 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 125 column 93 - Warning: <img> lacks "alt" attribute
line 141 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 141 column 98 - Warning: <img> lacks "alt" attribute
line 148 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 245 - Warning: <img> proprietary attribute value "absmiddle"
line 161 column 23 - Warning: <img> lacks "alt" attribute
line 161 column 64 - Warning: <img> lacks "alt" attribute
line 161 column 113 - Warning: <img> lacks "alt" attribute
line 161 column 163 - Warning: <img> lacks "alt" attribute
line 172 column 15 - Warning: <img> lacks "alt" attribute
line 218 column 22 - Warning: <img> lacks "alt" attribute
line 218 column 63 - Warning: <img> lacks "alt" attribute
line 218 column 111 - Warning: <img> lacks "alt" attribute
line 218 column 161 - Warning: <img> lacks "alt" attribute
line 229 column 15 - Warning: <img> lacks "alt" attribute
line 246 column 23 - Warning: <img> lacks "alt" attribute
line 246 column 64 - Warning: <img> lacks "alt" attribute
line 246 column 113 - Warning: <img> lacks "alt" attribute
line 246 column 163 - Warning: <img> lacks "alt" attribute
line 257 column 15 - Warning: <img> lacks "alt" attribute
line 271 column 2917 - Warning: <img> proprietary attribute value "absmiddle"
line 271 column 2917 - Warning: <img> lacks "alt" attribute
line 282 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 282 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 282 column 245 - Warning: <img> proprietary attribute value "absmiddle"
line 291 column 25 - Warning: <img> lacks "alt" attribute
line 296 column 267 - Warning: <img> lacks "alt" attribute
line 276 column 17 - Warning: trimming empty <tr>
line 125 column 68 - Warning: <nobr> is not approved by W3C
line 141 column 68 - Warning: <nobr> is not approved by W3C
line 177 column 27 - Warning: <nobr> is not approved by W3C
line 234 column 27 - Warning: <nobr> is not approved by W3C
line 262 column 27 - Warning: <nobr> is not approved by W3C
Info: Document content looks like HTML5
Info: No system identifier in emitted doctype
Tidy found 94 warnings and 3 errors!

The alt attribute should be used to give a short description
of an image; longer descriptions should be given with the
longdesc attribute which takes a URL linked to the description.
These measures are needed for people using non-graphical browsers.

For further advice on how to make your pages accessible
see http://www.w3.org/WAI/GL.
You are recommended to use CSS to specify the font and
properties such as its size and color. This will reduce
the size of HTML files and make them easier to maintain
compared with using <FONT> elements.

You are recommended to use CSS to control line wrapping.
Use "white-space: nowrap" to inhibit wrapping in place
of inserting <NOBR>...</NOBR> into the markup.

About HTML Tidy: https://github.com/htacg/tidy-html5
Bug reports and comments: https://github.com/htacg/tidy-html5/issues
Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/
Latest HTML specification: http://dev.w3.org/html5/spec-author-view/
Validate your HTML documents: http://validator.w3.org/nu/
Lobby your company to join the W3C: http://www.w3.org/Consortium

Do you speak a language other than English, or a different variant of
English? Consider helping us to localize HTML Tidy. For details please see
https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md