A86: Finding Program Description
[Prev][Next][Index][Thread]
A86: Finding Program Description
This routine takes the name in OP1 and displays "Asm Program" if it is a
regular asm program, "Basic Program" if it is a Basic program, or is
subposed to display a description if the program has one. Right now, it
displays nothing if the program has a description. Can anyone help me out?
OP1 contains the Program Name
rst 10h
call _checkbasic ;my own name for $46AB
jr z,AsmProgram
BasicProgram:
ld hl,Basic_Str
call _vputs ;this part works fine
jp Get_Size
AsmProgram:
ld h,d
ld l,e
in a,(5)
push af
in a,(6)
push af
ld a,b ;now pointer is in ahl
call _conv_ahl ;put ahl into asic format
ld de,-4000h
add hl,de ;add -4000 to hl (subtract 4000)
sub d ;add 40 to a
out (5),a ;load the first page to port 5
inc a
out (6),a ;load the following to port 6
ld de,$04 ;
add hl,de ;hl = address of the first real program data
push hl ;save it
ld a,(hl) ;move it into a
cp $00 ;if it is zero (a nop)
jp nz,RegAsmProgram ;then jump here
ld de,$07 ;***everything works fine to this point***
add hl,de ;add 7 to hl
ld d,(hl) ;and load what is at hl to d
dec hl ;move back one byte
ld e,(hl) ;and load hl into e
ld h,d ;de now = pointer to Description
ld l,e ;and move that to hl
ld de,$D748 ;we need this as the _asm_exec_ram offset
sbc hl,de ; and subtract de from hl
pop bc ;to get the offset and restore the pointer to
add hl,bc ;the nop at the beggining, and add them
call _vputs ;hl = the pointer to the programs description
pop af ;restore port 6 to original status
out (6),a ;
pop af ;and the same to 5
out (5),a
jp Get_Size ;get the size of the program
RegAsmProgram:
pop hl
pop af
out (6),a ;all this works fine
pop af
out (5),a
ld hl,Asm_Str
call _vputs
Get_Size: ;this is not important
ld hl,$006C ;setup the pencol
ld (_penCol),hl
rst 10h
ld a,b
ex de,hl
call _get_word_ahl ;Get program size
ex de,hl
set 3,(iy+5) ;set reverse video
call DispHL ;display hl routine
res 3,(iy+5) ;reset regular video
call _pop_OP1 ;recall OP1
ret
CHICANE
ICQ: #14727618
chicane on EFNET #ti
Homepage: Under Construction.