Author Topic: Z80 to HEX conversion and vice-versa now available on IRC  (Read 16921 times)

0 Members and 2 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Z80 to HEX conversion and vice-versa now available on IRC
« 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.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #1 on: January 26, 2011, 10:31:59 am »
When'd I die?

* Deep Thought checks the logs

* Deep Thought 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.
« Last Edit: January 26, 2011, 10:34:36 am by Deep Thought »




Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #2 on: January 26, 2011, 04:01:00 pm »
Awesome!  Thanks Deep (and Runer, though I've already thanked you :D ). ;D

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #3 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.
« Last Edit: January 28, 2011, 12:33:05 am by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #4 on: January 26, 2011, 10:54:49 pm »
Oh that's even cooler :D

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #5 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

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #6 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.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #7 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 ^^

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #8 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...

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #9 on: January 27, 2011, 06:33:34 pm »
That is cool for a z80 programmer. ;D
Hobbing in calculator projects.

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #10 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...
« Last Edit: January 28, 2011, 12:29:08 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #11 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.
« Last Edit: January 28, 2011, 12:46:12 am by Deep Thought »




Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #12 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:

  • 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
« Last Edit: January 28, 2011, 02:05:23 pm by Runer112 »

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #13 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?
Hobbing in calculator projects.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Z80 to HEX conversion and vice-versa now available on IRC
« Reply #14 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.