Omnimaga

General Discussion => Technology and Development => Web Programming and Design => Topic started by: Keoni29 on July 11, 2014, 05:06:37 am

Title: js - Relative Jump Calculator
Post by: Keoni29 on July 11, 2014, 05:06:37 am

It does exactely what you think it'd do. Enter the start and end address and it calculates the offset for you. It takes the 2 byte offset in account required for most branch instructions (eg. z80 or 6502 branch instructions)
http://jsfiddle.net/4h5YD/22/ (http://jsfiddle.net/4h5YD/22/)
Title: Re: js - Relative Jump Calculator
Post by: Streetwalrus on July 11, 2014, 05:10:26 am
Nice app Keoni, as always ! :D
Title: Re: js - Relative Jump Calculator
Post by: Sorunome on July 11, 2014, 09:54:12 am
Haha, nice one!
Luckily assemblers do this for you, though :P
Still useful if you are xeda program in hex :)
Title: Re: js - Relative Jump Calculator
Post by: Xeda112358 on July 11, 2014, 09:56:49 am
Pssh, I just either memorize how many bytes there are between jumps or quickly add it up >_>
/me runs


EDIT: Oh, this was @Sorunome


@Keoni: Honestly, this can be handy at times.
Title: Re: js - Relative Jump Calculator
Post by: Keoni29 on July 11, 2014, 12:44:46 pm
I wrote this for myself because the assembler on the power cartridge for my commodore64 does not support labels. It's a one-line assembler: assembles a line after you type it and hit return.
Title: Re: js - Relative Jump Calculator
Post by: Keoni29 on July 12, 2014, 10:31:55 am
Oops there was a typo in that jsfiddle. Updated version: http://jsfiddle.net/4h5YD/20/
Title: Re: js - Relative Jump Calculator
Post by: Sorunome on July 12, 2014, 11:39:29 am
Suggestion: allow the $ prefix
Title: Re: js - Relative Jump Calculator
Post by: Keoni29 on July 12, 2014, 12:17:12 pm
Good idea. I was thinking about that actually. I am going to implement it in the regex which will also get rid of inputs like: Derp and asdf, cause javascript just parses the hexadecimal number until it sees a character that is not valid and spits out the result.
Title: Re: js - Relative Jump Calculator
Post by: Keoni29 on August 18, 2014, 10:13:29 am
Just fixed a tiny bug. I want to host this on my server if enough people find this useful.
http://jsfiddle.net/4h5YD/22/
Title: Re: js - Relative Jump Calculator
Post by: Sorunome on August 18, 2014, 07:38:31 pm
It are just a few KB, so why not host it on your server anyways so that you have all your stuff centralized?
Title: Re: js - Relative Jump Calculator
Post by: Keoni29 on August 19, 2014, 06:16:58 am
There you go:
http://8times8.eeems.me:81/app/jump/
The /app directory will contain all of my applications soon.
http://8times8.eeems.me:81/app will have a list of links to all applications.
Title: Re: js - Relative Jump Calculator
Post by: Sorunome on August 19, 2014, 01:17:33 pm
Also, it's awesome to see how far you got with js in such a short time :)
Title: Re: js - Relative Jump Calculator
Post by: Keoni29 on August 19, 2014, 01:19:16 pm
Thank you :)