Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Hello everybody!

For those who use Sublime Text 2/3 for their asm needs I present you a package (addon) that brings syntax highlighting for z80 asm and a few build scripts with it
Additionally I integrated FunkLibrary, a collection of macros and functions, that I use for all my projects instead of doing #include "ti83plus.inc" and getting tired...

Let me show you a few things:

I used to do this:

Code:
#include "ti83plus.inc"

      .org  progstart - 2
      .db   t2ByteTok, tAsmCmp

start:
      b_call(_ClrLCDFull)
      ld    de, 0
      ld    (PenCol), de
      ld    hl, msg
      b_call(_PutS) ; Display the text
      b_call(_NewLine)
      ret

msg:
    .db   "Hello TI83P!", 0


but now I can do this:

Code:
start
   bcal   _ClrLCDFull
   text  24, 30, "Hello Funk,", true
   text  30, 33, "you rock!", true
   quit


And how would you make this a two page app?
All I have to do is:

Code:
start
   bcal   _ClrLCDFull
   text  24, 30, "Hello Funk,", true
   pcal   hello_page2
   wait
   quit

.nextpage

hello_page2
   text  30, 33, "you rock!", true
   ret


Graphics (*.bmp files) are auto included from a funk_graphics folder and can be called as easy as the text above. I also added many routines like fastcopy, largesprite, shuffle, random, rectangle and I can add more if you like (I would love to add linking). All routines are added on demand and are not in your program if you don't call them.

Works on Linux and Windows, Cygwin (shell scripts, batch files) but the Sublime package is only tested on Windows 7. Simply hit Ctrl+B to compile the first example. The App example should be compiled via the menu (z80asm / Build Funk App) or you can insert a config file... etc.

The FunkLibrary can also be used without Sublime Text! Just call the build scripts manually. They are funk/build.sh for linux and funk/build.bat for windows. Oh and SPASM is already in the package.

Old screenshot from my setup:


Download: http://revsoft.tifreakware.net/phpBB3/download/file.php?id=286

Other thread: http://revsoft.tifreakware.net/phpBB3/viewtopic.php?f=4&t=41


What do you guys think?

PS: I could add DoorsCS, right now I only have MirageOS, ION and APP. What do I have to do? Very Happy

PPS: Wizards also compiles with Funk: http://revsoft.tifreakware.net/phpBB3/viewtopic.php?p=1284#p1284 Smile

Edit: Grammar
Oh wow, this looks awesome. It'd be great if you added DoorsCS, and especially great if you added CSE support to it, as well.
This looks pretty neat! So to program, does one still need to play with registers as well?
Yeah I will have a look into the DoorsCS API later.

I've seen some of you guys do

Code:
my_variable1 = ram+1
my_variable2 = ram+2
my_variable2 = ram+4

and I hate doing this and when something changes I hate everything and I must copy and paste it around.

With Funk I do

Code:
 .locate ram
 .var "my_variable1"
 .var "my_variable2", word
 .var "my_variable3"


Often times I also have tables like this:


Code:
something:
 ld hl, table
 ld   de, 2 ; add sprite pointer offset
 add hl, de
 ld a, (hl)
 inc hl
 ld   l, (hl)
 ld   h, a
 call something_else
 ret

table:
 ; first element
 .db 3
 .db 15
 .dw SPRITE_POINTER
 .dw TEXT_POINTER
 .db 0 ; flags
 ; second element
 ...


but with Funk I do:

Code:

 .module "table"
 .enumStart 0
 .enum "x"
 .enum "y"
 .enum "sprite", word
 .enum "text", word
 .enum "flags"
 .enum 255, "end" ; max table element size = 255, gives error when reached

 something
    ld a, 1 ; first element
    fetch(table.sprite, table, table.end)
    deref ; hl = (hl)
    call something_else
    ret


Very Happy ok?
MateoConLechuga wrote:
This looks pretty neat! So to program, does one still need to play with registers as well?


No, sorry. Only a compiler can analyze program flow and do register spilling. This is a macro library on top of SPASM.

Edit: I forgot to mention how you install this: simply copy the folder to the sublime packages folder. On windows that is "C:\Users\XXXX\AppData\Roaming\Sublime Text 3\Packages". Have fun!
Did anyone try this out? Just curious...
Yes; I actually found it quite useful for organizing my variables in RAM... now I don't have to manually compute the address on each one. Nice work! Smile
I will say that particular feature is already available in brass Wink that being said i have not tried this yet but I love the feature set it has listed and i like that it expands on spasm. Which is definitely a awesome assembler!
is this going to be ported to CSE?
Why not... Smile The source is at github: https://github.com/NanoWar/FunkLibrary/
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement