Omnimaga
Omnimaga => News => Topic started by: DJ Omnimaga on January 26, 2011, 02:46:44 am
-
For a while, Runer112 and Deep Thought both had IRC scripts running in #Omnimaga channel that are one of the few rare scripts we actually allowed so far there. The first one, by Runer112, lets you convert hexadecimal code to Z80 assembly and the second one, by Deep Thought, lets you do the opposite. If the assembly code is too large, a Pastebin link is posted instead, to avoid flooding the channel.
The syntax for Runer112's script is "@Z80 <hexadecimal>" and for Deep Thought (DThought) it's ":asm <Z80 code>".
However, DThought script is still buggy, so some syntax errors might cause the script to become unavailable for a while. Runer112 has plans to merge both together. Also note that these scripts are moderated, though. Abuse will lead to a warning then a ban, like any other spam. If you have a lot of code to convert, we recommend using them via /msg instead.
Hopefully this should be useful for our growing hex code fanbase and those who want to quickly translate hex opcodes to Z80 syntax.
-
When'd I die?
/me checks the logs
/me stabs Runer112
I thought I'd fixed that bug, though :P Oh well. I'll fix it later today.
Also, warnings: mine only does one instruction at a time (prevents flooding, anyway ;D), and it doesn't have wildcards yet. If you want something like LD A,$FF you'll have to do :asm LD A,* (which gives you 3E**), then put in the *s yourself. I think I'll try figuring wildcards today too, and add those extra stuff Runer112 added to his.
-
Awesome! Thanks Deep (and Runer, though I've already thanked you :D ). ;D
-
As an update to mine, it accepts wildcards (like "ld a,0") now. No equates, but I might do that tomorrow.
And if anyone didn't know already, both mine and Runer's scripts work from OmnomIRC.
-
Oh that's even cooler :D
-
Yeah, this stuff is really useful! It lets me answer assembly questions much faster... it's like a translator... Why doesn't google have a translator like this!
Hex>>Z80
Z80>>Hex
-
Lol that would be cool. Maybe in the future such script could be implemented directly on the forums. Eeems has a script for that, though, if you look through the Misc page of the site.
-
Wow thats so cool! :D I probably won't find much use for this myself but it definitely is epic ^^
-
Lol that would be cool. Maybe in the future such script could be implemented directly on the forums. Eeems has a script for that, though, if you look through the Misc page of the site.
Oh, that would be cool! Do you mean like if I did @Z80 210000224B8421A29DEF1045C90548656C6C6F in a post, it would return the mnemonics?! That could be really cool...
-
That is cool for a z80 programmer. ;D
-
I thought I was seeing a lot of stuff like that...now I know why :P
Looks useful, though I would probably never use it myself (until/if I learn ASM)
for a z80 programmer
Yeah, true. Maybe in the near future there might be whatever the prizm uses, or 68k, or whatever the inspire uses, or...
-
Some stuff:
My script should be totally stable now. (No crashing.) It also supports wildcards completely now. I'll be working on adding the equates in ti83plus.inc tomorrow.
And posting some updates for Runer112 (since he seems to be offline): his script now does assembly too, and can take multiple lines as well (separated by \). In other words, it's like mine, but *sigh* better. Blasphemy!
As always, his is @z80 and mine is :asm. Both work in privmsgs, so if you have a lot of stuff to do (or if you just want to test them out), get on IRC and /query them if you want to avoid adding too much spam. And they both work from OmnomIRC, too.
-
Just wanted to let everyone know how mine works, since it's not really explained anywhere. It has become quite a massive project. :o
To use it, you can either enter your queries into OmnomIRC right on the forums or through a normal IRC client. If you use the latter, you can also /msg me with your queries. Anyways, to use this, start a message with one of the following: .z80, !z80, or @z80. After this, you can then enter one of four things for different effects:
- Enter the hex for an instruction to see detailed information about the instruction (mnemonic, hex, bytes, cycles, flag effects, and description)
- Enter the mnemonic for an instruction to see detailed information about the instruction
- Enter the hex for multiple instructions to receive disassembled mnemonics
- Enter the mnemonics for multiple instructions separated by backslashes to receive compiled hex (Note that backslashes work oddly in OmnomIRC and require about five of them in a row to be entered)
I believe this should support every instruction on the z80, including all undocumented instructions and bcalls. I'm particularly proud of my recent number handling system for assembling code, as it supports all equates defined in ti83plus.inc and math functions like a real assembler! ;D
If you notice any bugs or have any other feedback, please tell me! And if you use it heavily in a short period of time and it stops responding to you, that's not a bug, that's flood control. :P If you're using an IRC client, you can avoid flood control by /msg'ing me with as many queries as you want.
EDIT: Examples of the four main ways to use this. If you're using OmnomIRC, the bot will always respond publicly like in the first example. If you're an IRC user, you have a few more options.
You enter: @z80 CB30
I respond: <Runer112> [Z80] Instruction \ Main: sll reg8 \ Instance: sll b [CB30]\ Bytes: 2 \ Cycles: 8/15 \ Flags: SZ-0-P0C \ Undocumented \ Description: The contents of reg8 are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.
You enter: .z80 jr nz,$-14
I respond: -Runer112- [Z80] Instruction \ Main: jr cc,ofs8 \ Instance: jr nz,$-14 [20F0] \ Bytes: 2 \ Cycles: 12/7 \ Flags: -------- \ Description: If condition cc is true, the signed value imm8 is added to pc. The jump is measured from the start of the instruction opcode.
You enter: !Z80 E3EF9247218384D1010900EDB0
I respond: -Runer112- [Z80] Disassembly \ http://z80.pastebin.com/D0SRU5X5 \ ex (sp),hl \ B_CALL(_SetXXXXOP2) \ ld hl,$8483 \ pop de \ ld bc,$0009 \ ldir
You enter: /msg Runer112 .Z80 B_CALL(_RunIndicOn) \ set donePrgm,(iy+doneFlags) \ ret \ .db 19,$37,%10101010,plotSScreen % 256 >> (7/2)
I respond in a private message: <Runer112> [Z80] Assembly \ http://z80.pastebin.com/KDbM1xHq \ EF6D45FDCB00EEC91337AA08
-
Nice showcases of usage.
As curiosity, what is the programming language in which the bots are coded?
-
Nice showcases of usage.
As curiosity, what is the programming language in which the bots are coded?
I think @z80 is MySQL.
-
Thanks for the explanation Runer112. Note that the latter commands will not work for people who have notices on /ignore, though, like me. I set *!*@* on ignore for notice because of spam.
Also I think Runer112 script is mIRC language.
-
Nice showcases of usage.
As curiosity, what is the programming language in which the bots are coded?
His is mIRC script, mine is Python.
-
[23:13:53] <@DThought> @z80 legos
[23:13:54] <+Runer112> [Z80] Assembly \ http://tinyurl.com/4zq9pjb
wut? O.O
-
Hahaha, nice :D
-
I think what happened was somebody used that when it just came out to get the message "Could not assemble: Legos" as a joke. So then as an easter egg the ability to assemble Legos was added?
-
Oh maybe. I don't really follow logs all the time so I probably missed it.
-
I think what happened was somebody used that when it just came out to get the message "Could not assemble: Legos" as a joke. So then as an easter egg the ability to assemble Legos was added?
Yep, that's exactly it :D Runer112 should add some other stuff too, like @z80 T-Model, @z80 Megabloks, @z80 Cyborg, etc.
-
lol, interesting antispam mechanism :P
-
Cool, when is this happening?
jk
Maybe @z80 TheGame could be a rickroll :P
I wouldn't add too much random stuff tho, some people would use it as a way to spam
-
lol, interesting antispam mechanism :P
Well, it probably works -- people don't want to lose, so they only use @z80 when they need it :P