; Actual program loading. Use the DOS interrupt. mov ax, 4B01h ; load program mov dx, DTA ; offset of file to load mov bx, execblk ; parameter block int 21h ; load it jc ll16 ; if error mov ax, sp sub ax, [SPSAV] cmp ax, 80h jb ll15 ; if in range mov ax, 80h ll15: mov word [spadjust], ax les si, [execblk.sssp] es lodsw ; recover ax mov word [reg_eax], ax mov word [reg_esp], si mov word [reg_ss], es les si, [execblk.csip] mov word [reg_eip], si mov word [reg_cs], es push ss pop es call getpsp xchg ax, bx ; ax = PSP, clobber bx mov word [pspdbe], ax clropt [internalflags], attachedterm mov di, reg_ds stosw scasw stosw ; reg_es push ax call setpspdbg ; Finish up. Set termination address. mov ax, 2522h ; set interrupt vector 22h mov dx, int22 ; ds => lDEBUG_DATA_ENTRY int 21h pop ds mov word [TPIV], dx mov word [TPIV+2], ss ; => lDEBUG_DATA_ENTRY push ss pop ds