Here you go, I missed the topic the first time around:
Code: Start:
;First we move the contents of X to the accumulator
bcall(_zerooop1)
ld hl,op1+1
ld (hl),'X' ;or any other var
bcall(_rclvarsym) ;op1 / op2 -> value
bcall(_convop1)
ld a,e
;in theory you'll want to use the accumulator now
;now archive program ABC
ld hl,ProgABC
rst 20h ;mov9tooop1
bcall(_chkfindsym)
ret c ;if carry is set, does not exist
ld a,b
or a ;is it in RAM?
bcallz(_arc_unarc) ;only archive if not already archived
;now unarchive program DEF
ld hl,ProgDEF
rst 20h ;mov9tooop1
bcall(_chkfindsym)
ret c ;if carry is set, does not exist
ld a,b
or a ;is it in RAM?
bcallnz(_arc_unarc) ;only unrchive if not already in RAM
;now execute program DEF.
;I'm giving you a much, much simpler version of this than DCS uses
ld hl,ProgDEF
rst 20h ;mov9tooop1
bcall(_getK) ;this eliminates any residual keypresses
bit ProgExecuting,(iy+NewDispf)
push af
set ProgExecuting,(iy+NewDispf)
bcall(_parseImp) ;Run the program!
pop af
jr nz,FinishExec
res ProgExecuting,(iy+NewDispf)
FinishExec: ;all done running the BASIC program!
ret
Prog_ABC:
.db 5,"ABC",0
Prog_DEF:
.db 5,"DEF",0