First post, by llm
hello.exe that should get executed by exeload.exe
hello.asm
.model small.stack 200hdseg segment 'DATA'hello db 'hello',0dh,0ah,'$'dseg endscseg segment 'CODE'assume cs:csegstart:mov ax,dsegmov ds,axmov dx,offset hellomov ah,09hint 21hmov ax,4C00hint 21hcseg endsend start
build with masm/uasm or wasm
exeload.asm
.model small.stack 200hdseg segment 'DATA'filename db 'hello.exe',0commandline db ' ',0dhparams:dw 0 ; copy caller environment if 0dw offset commandlinedw seg commandlinedw 0ffffh,0ffffh ; fcb1dw 0ffffh,0ffffh ; fcb2error_msg db 'exec failed$',0dh,0ahdseg endscseg segment 'CODE'assume cs:csegstart:mov ax,dsegmov ds,axmov es,axmov dx,offset filenamemov bx,offset paramsmov ax,4B00hpush ds ; save ds for returnpush es ; save es for return; seems to be needed for old dos versionsmov cs:[stk_seg],ss ; save stack seg andmov cs:[stk_ptr],sp ; stack pointer in csegint 21hjnc execute_ok; ax = 8 = Insufficient memorymov dx,offset error_msgmov ah,09hint 21hjmp exitexecute_ok:climov ss,cs:[stk_seg]mov sp,cs:[stk_ptr]pop espop dsstiexit:mov ax,4C00hint 21hstk_ptr dw 0stk_seg dw 0
cseg endsend start
build with masm,uasm,wasm
the call to int 21h ah=4B00h returns with cf = 1 and ax = 8 => insufficent memory
i though exe program do not allocate the complete free ram like com programs - am im wrong - can find any references