No Subject


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

No Subject




I have some zasmload questions:
Look for my questions, they start with this  >-->

;
;   input : 'Ans' contanis a string with the name of the ASM program to 
load
;
;
    org     9327h
;
    call    _zeroop1
    ld      a,tans
    ld      (op1+1),a
    call    _findsym
    jp      c,_errundefined  ; error if not there
;
;   de = ptr to data
;
    and     1fh
    cp      strngobj
    jp      nz,_errsyntax
;
    ld      hl,op1
    ld      (hl),progobj
    inc     hl
    ld      a,(de)           ; get size of name
    ld      c,a
    ld      b,0
    inc     de
    inc     de               ; (de) = 1st byte of prog name
    ex      de,hl
    ldir                     ; name to op1
;
;   op1 = name of asm prog to load
;
    call    _chkfindsym      ; look up
    jp      c,_errundefined
;
    ex      de,hl
    call    _ldhlind         ; HL = SIZE of prog to load
    PUSH    HL
    ld      de,insert_start-9327h

>--> Why insert start?  What's so special about that label >-->

    or      a
    sbc     hl,de            ; hl = amount to insert
    push    hl
    CALL    _ERRNOTENOUGHMEM   ; ERROR IF NOT ENOUGH MEM
;

>--> What does ERRNOTENOUGHMEM do here? It's called unconditionally!

    POP     HL               ; amount to insert
    push    hl
;
    LD      DE,insert_start   ; START OF INSERT
    CALL    _INSERTMEM        ; INSERT MEM, ADJUST PTRS

>--> I could use a big explanation of _INSERTMEM >-->

    POP     HL               ; AMOUNT INSERTTED
    push    hl
;
    ld      de,(usermem_offset)
    add     hl,de                       ; new total insertted
    LD      (USERMEM_OFFSET),HL   ; SAVE AMOUNT SO CAN CLEAN UP LATER
;

>--> USERMEM_OFFSET? >-->

    pop     hl
    ld      de,insert_start
    add     hl,de            ; loader here
    jp      (hl)
;
insert_start:

>--> Here's that "insert_start" again. >-->

    call    _chkfindsym      ; look up
    jp      c,_errundefined
;
    ex      de,hl
    inc     hl
    inc     hl               ; start of asm compiled
    ld      de,9327h
    pop     bc               ; # bytes
    ldir                     ; copy asm
    jp      9327h


Thanks!!!

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com