[A83] Re: assembly-83 Digest V2 #26


[Prev][Next][Index][Thread]

[A83] Re: assembly-83 Digest V2 #26




> -- Binary/unsupported file stripped by Listar --
> -- Type: application/octet-stream
> -- File: S2P.asm
> -- Desc: S2P.asm (Assembly Source File)

Now that tip of setting the file-type .txt to text/plain sure helps...

Well anyhow here is the source:

; Prog2String - by Henk Poley <>< - 01feb2002
; -----------   -----------------   ---------
; VAT_1 starts with pointer to Prog
; VAT_2 starts with pointer to String

;ROMcalls
LD_HL_MHL     equ $0033
_ZeroOP1      equ $428E
_ChkFindSym   equ $442A
_CreateProg   equ $448A
_DelVar       equ $44AA
_ErrUndefined equ $467B
_ErrBreak     equ $4684

;Memory areas
OP1           equ $8039

;Data types
StrngObj      equ   $04

;Tokens
tVarStrng     equ   $01
tStr1         equ   $00

.org 9329h

	.db	$E7,"9_[V?",5
	
	; You *might* want to add some stuff here that reads from your
	; BASIC program what to do. Untill then, we only convert Str1
	; to prgmABCDEFGH.
	; Just ask me for examples for reading back into the BASIC file

	;Create Program
	ld	hl,ProgramName
	rst	$20
	call	_Chkfindsym
	jp	nc,_ErrBreak

	ld	hl,0
	call	_CreateProg
	ld	(VAT_1),hl

	;Lookup String
	call	_ZeroOP1
	ld	hl,StringName
	ld	de,OP1
	ld	bc,3
	ldir
	call	_ChkFindSym
	jp	c,_ErrUndefined
	ld	(VAT_2),hl
	ld	(Data_2),de

	;Swap datapointers
VAT_1 = $ + 1
	ld	hl,$0000
VAT_2 = $ + 1
	ld	de,$0000
	inc	hl
	inc	de
	ld	b,(hl)
	ld	a,(de)
	ld	(hl),a
	ld	a,b
	ld	(de),a
	inc	hl
	inc	de
	ld	b,(hl)
	ld	a,(de)
	ld	(hl),a
	ld	a,b
	ld	(de),a

	;Delete VAT_2
	ld	hl,(VAT_2)
Data_2 = $ + 1
	ld	de,$0000
	jp	_DelVar

StringName:
	.db	StrngObj,tVarStrng,tStr1

ProgramName = $ - 1
	.db	"ABCDEFGH"




Follow-Ups: