Omnimaga

Omnimaga => News => Topic started by: DJ Omnimaga on January 26, 2011, 02:46:44 am

Title: Z80 to HEX conversion and vice-versa now available on IRC
Post 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.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Deep Toaster on January 26, 2011, 10:31:59 am
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.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: ztrumpet on January 26, 2011, 04:01:00 pm
Awesome!  Thanks Deep (and Runer, though I've already thanked you :D ). ;D
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Deep Toaster on January 26, 2011, 08:09:22 pm
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.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: DJ Omnimaga on January 26, 2011, 10:54:49 pm
Oh that's even cooler :D
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Xeda112358 on January 26, 2011, 10:56:43 pm
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
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: DJ Omnimaga on January 27, 2011, 12:22:24 am
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.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Builderboy on January 27, 2011, 01:09:52 am
Wow thats so cool! :D I probably won't find much use for this myself but it definitely is epic ^^
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Xeda112358 on January 27, 2011, 08:58:53 am
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...
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Galandros on January 27, 2011, 06:33:34 pm
That is cool for a z80 programmer. ;D
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Darl181 on January 28, 2011, 12:27:38 am
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...
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Deep Toaster on January 28, 2011, 12:45:52 am
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.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Runer112 on January 28, 2011, 01:36:24 am
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:


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
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Galandros on January 28, 2011, 09:31:55 am
Nice showcases of usage.
As curiosity, what is the programming language in which the bots are coded?
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Munchor on January 28, 2011, 09:32:19 am
Nice showcases of usage.
As curiosity, what is the programming language in which the bots are coded?

I think @z80 is MySQL.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: DJ Omnimaga on January 28, 2011, 09:41:21 am
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.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Deep Toaster on January 28, 2011, 04:33:30 pm
Nice showcases of usage.
As curiosity, what is the programming language in which the bots are coded?

His is mIRC script, mine is Python.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: DJ Omnimaga on March 13, 2011, 11:21:41 pm
[23:13:53] <@DThought> @z80 legos
[23:13:54] <+Runer112> [Z80] Assembly \ http://tinyurl.com/4zq9pjb

wut? O.O
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Juju on March 13, 2011, 11:23:08 pm
Hahaha, nice :D
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Xeda112358 on March 13, 2011, 11:26:43 pm
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?
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: DJ Omnimaga on March 13, 2011, 11:29:46 pm
Oh maybe. I don't really follow logs all the time so I probably missed it.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Deep Toaster on March 13, 2011, 11:35:53 pm
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.
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: willrandship on March 13, 2011, 11:49:09 pm
lol, interesting antispam mechanism :P
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Darl181 on March 13, 2011, 11:49:37 pm
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
Title: Re: Z80 to HEX conversion and vice-versa now available on IRC
Post by: Deep Toaster on March 14, 2011, 12:05:29 am
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