summaryrefslogtreecommitdiff
path: root/programs/forg.s
blob: 3e6aea1be1d3db80cd5e0f71f1e8341bc2b76fab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
forg:
	iny		; Increment offset.
	lda buf, y
	jsr iswhite
	bcs forg	; Reset y, if we hit the null terminator.
	cmp #$2E	; Is this character a '.'?
	bne forg_exit	; No, so return.
	sty org		; Yes, so store the origin.
forg_end:
	iny		; Increment offset.
	lda buf, y
	jsr istoken
	bcs forg_end
	dey
	sty scr_col
forg_exit:
	rts		; End of forg.