[TI ASM] parserhook

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

[TI ASM] parserhook

Post by King Harold »

I thought of this wonderful way to access the arguments passed by the parser.. But the code is not exactly nice/clean.. Have a look at it, write your own version, tell me what's wrong with it, etc.

It's short and I would think it's pretty much self-explanatory (at least for some of us)

If you don't get the point of this code, it should make all the arguments into a list (downside is that you can't push on the FPS without corrupting the data)

Code: Select all

	.db $83
	or a
	ret z
	cp 1
	jr z,{+}
-:	cp a
	ret
+:	push hl
	ld hl,$8A8A
	sbc hl,bc
	pop hl
	jr nz,{-}
	ld (Appbackupscreen),hl
	dec hl
	ld de,(FPS)
	push de
	bcall(_DeallocFPS)
	pop hl
	push hl
	ld de,(FPS)
	or a
	sbc hl,de
	ld b,h
	ld c,l
	pop hl
	ld d,h
	ld e,l
	inc de
	inc de
	push de
	lddr		;move everthing 2 bytes up
	pop de
	inc de
	ld hl,op1
	ld bc,9
	ldir		; "push" op1 on the FPstack
	ld de,(appBackUpScreen)	;number of arguments
	ld hl,(FPS)
	ld (hl),e
	inc hl
	ld (hl),d
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

well, what do we think about this? am I on the right track here?
Post Reply