[A83] Re: Executing programs from and other programs...


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

[A83] Re: Executing programs from and other programs...




> well... if i do:
>
> ld  hl,<<progstart>>
> ld  de,9D95h
> ld  bc,<<proglenght>>
> ldir
>
> --> how can i find the program's size with codes...?

The size is stored in a word at the beginning of the data, so if you ran
through chkfindsym, you can load those 2 bytes directly into bc.


[...]
  bcall(_chkfindsym) ; start of data in DE
  ex    de,hl        ; start of data in HL
  ld    c,(hl)       ; load 1st byte of size in C
  inc   hl           ; goto 2nd byte
  ld    b,(hl)       ; load 2nd byte of size in B
  inc   hl           ; goto actual program start
  inc   hl           ; and skip the AsmPrgm token
  inc   hl           ;
  ld    de,9d95h     ;
  ldir               ;





References: