0 Members and 2 Guests are viewing this topic.
Disp((2*x+1)*6+x)Disp((27*x+1)*4+x)
ld hl,(var_x) add hl,hl \ inc l ld b,h \ ld c,l \ add hl,hl \ add hl,bc \ add hl,hl ld de,(var_x) add hl,de call disp_uint16 ld de,27 ld hl,(var_x) call mulHLDE inc hl add hl,hl \ add hl,hl ld de,(var_x) add hl,de call disp_uint16
Disp | + / \ / \ ++ + | / \ x / \ y x
Looks pretty cool Xeda. Somewhat unrelated, but I was looking up info on Game Boy programming (the Game Boy uses a Z80 clone +/- some things) and apparently you can do C on it via SDCC (or so I've read). Not sure how efficient it is or fast, but it's a thing.
ld hl,(x) inc hl add hl,hl add hl,hl add hl,hl call disp_uint16
ld hl,(x) inc hl ld bc,(x) inc bc sla c rl b add hl,bc add hl,hl add hl,hl call disp_uint16
ld de,(x) inc de ld hl,(x) inc hl add hl,hl add hl,de add hl,hl add hl,hl call disp_uint16
ld hl,(x) inc hl ld b,h ld c,l add hl,hl add hl,bc add hl,hl add hl,hl call disp_uint16
#Convert the code to an intermediate representationpython sy.py test.txt#Convert the intermediate representation to Z80 assembly, with the ti-83+ family headerpython compile.py test.ir -TI8X -MAX_PATHS=150#Compilespasm test.asm bin/test.8xp -I inc -I routines
3->x6->yDisp(3*(2*x+y*3)+9*(x+y))Disp(1337)Disp(3*(x+y)+9*(x+y))
I'm excited to see where you go with this
4->k0->x1->ylbl0: x+y->z x+1->x y+1->y Disp(10*z) k-1->k GotoIf(lbl0,k!=0)2->xDisp(x)
#include "jq.inc"#include "ti83plus.inc"scrap = 8000hvar_k = scrap+0var_x = scrap+2var_y = scrap+4var_z = scrap+6.db $BB,$6D.org $9D95 ld hl,4 ld (var_k),hl ld hl,0 ld (var_x),hl ld hl,1 ld (var_y),hllbl0: ld hl,(var_x) ld de,(var_y) add hl,de ld (var_z),hl ld hl,(var_x) inc hl ld (var_x),hl ld hl,(var_y) inc hl ld (var_y),hl ld hl,(var_z) add hl,hl add hl,hl ld de,(var_z) add hl,de add hl,hl call disp_uint16 ld hl,(var_k) dec hl ld (var_k),hl ld a,h or l jqnz(lbl0 ) ld hl,2 ld (var_x),hl#include "disp_uint16.z80"