Author Topic: js - Relative Jump Calculator  (Read 6134 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
js - Relative Jump Calculator
« 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/
« Last Edit: August 19, 2014, 06:04:54 am by Keoni29 »
If you like my work: why not give me an internet?








Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: js - Relative Jump Calculator
« Reply #1 on: July 11, 2014, 05:10:26 am »
Nice app Keoni, as always ! :D

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: js - Relative Jump Calculator
« Reply #2 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 :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

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: js - Relative Jump Calculator
« Reply #3 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 >_>
* Xeda112358 runs


EDIT: Oh, this was @Sorunome


@Keoni: Honestly, this can be handy at times.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: js - Relative Jump Calculator
« Reply #4 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.
If you like my work: why not give me an internet?








Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: js - Relative Jump Calculator
« Reply #5 on: July 12, 2014, 10:31:55 am »
Oops there was a typo in that jsfiddle. Updated version: http://jsfiddle.net/4h5YD/20/
If you like my work: why not give me an internet?








Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: js - Relative Jump Calculator
« Reply #6 on: July 12, 2014, 11:39:29 am »
Suggestion: allow the $ prefix

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: js - Relative Jump Calculator
« Reply #7 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.
If you like my work: why not give me an internet?








Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: js - Relative Jump Calculator
« Reply #8 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/
If you like my work: why not give me an internet?








Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: js - Relative Jump Calculator
« Reply #9 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?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: js - Relative Jump Calculator
« Reply #10 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.
If you like my work: why not give me an internet?








Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: js - Relative Jump Calculator
« Reply #11 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 :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: js - Relative Jump Calculator
« Reply #12 on: August 19, 2014, 01:19:16 pm »
Thank you :)
If you like my work: why not give me an internet?