home *** CD-ROM | disk | FTP | other *** search
- ;===================================
- ;Unsquish by Jimmy Conner aka CiGaMiT (timagic@yahoo.com)
- ; I would comment most of this source but seeing that not even I
- ; can understand what the heck I was up to 10 minutes after
- ; I write something, I don't believe I will.
- ; I will help you out as much as possible, just dont try to take my
- ; work and make it yours, otherwise enjoy.
- ;
- ; <ATTENTION!!!>
- ; No calculators were harmed in the making of this program, It was programmed solely on Calc'Em.
- ; </ATTENTION!!!>
- ;===================================
-
-
- .NOLIST
- #define equ .equ
- #define EQU .equ
- #define END .end
- #include "ti83asm.inc"
- #include "tokens.inc"
- .LIST
- .org 9327h
- strngobj .equ 04h
- progobj .equ 05h
- protprogobj .equ 06h
- _errundefined .equ 467Bh
- _errsyntax .equ 466Ch
- _findsym .equ 442Eh
- _INSERTMEM equ 4432h
- _freemem equ 441Ah
- _errnotenoughmem equ 467eh
-
- call _zerooop1
- ld a, tAns
- ld (op1+1), a
- call _findsym
- jp c, _errundefined
- and 1fh
- cp strngobj
- jp nz, _errsyntax
- ld hl, op1
- ld (hl), progobj
- inc hl
- ld a, (de)
- ld c, a
- xor b
- inc de
- inc de
- ex de, hl
- ldir
- call _chkfindsym
- jp c, _errundefined
- ld a, 5
- ld (hl), a
- push de
- ld a, (de)
- ld l, a
- inc de
- ld a, (de)
- ld h, a
- push hl ; HL = Size
- call checkformem
- ld b, h
- ld c, l
- inc de
- unsquish2:
- push bc ; HL is at old data
- inc de ; HL is pointing to the new spot data
- ld hl, 1
- call _insertmem
- dec de
-
- ld a, (de)
- add a, 16
- ld c, -1
- unsquishdata:
- inc c
- add a, -16
- cp 16
- jp nc, unsquishdata
- ld b, a
- ld a, c
- call addtoit
- ld (de), a
- ld a, b
- call addtoit
- inc de
- ld (de), a
- inc de
- pop bc
- dec bc
- ld a, b
- or c
- jp nz, unsquish2
- push de
- ld hl, 9
- call _insertmem
- pop de
- ld hl, ending
- ld bc, 9
- ldir
- pop hl
- pop de
- add hl, hl
- ld bc, 9
- add hl, bc
- ld a, l
- ld (de), a
- inc de
- ld a, h
- ld (de), a
- ret
- addtoit:
- add a, 30h
- cp 3Ah
- ret c
- add a, 7
- ret
-
- checkformem:
- push hl
- push de
- push bc
- ld bc, 9
- add hl, bc
- ex de, hl
- call _freemem
- call _cphlde
- jp c, _errnotenoughmem
- pop bc
- pop de
- pop hl
- ret
-
- ending:
- .db tEnter,tEnd,tEnter,"0000",tEnter,tEnd
- .end
- end