cpu 8086 org 256 start: mov ah, 4Ah mov bx, 1000h int 21h mov di, array xor cx, cx loopalloc: mov ah, 48h mov bx, 1000h int 21h jc endalloc stosw inc cx jmp loopalloc endalloc: cmp cx, 4 jb errorinit mov si, array mov cx, 4 loopfree: lodsw mov es, ax mov ah, 49h int 21h loop loopfree mov ah, 48h mov bx, 3000h int 21h jc errorexit mov dx, msg.success mov ah, 09h int 21h mov ax, 4C00h int 21h errorexit: mov dx, msg.errorexit jmp error errorinit: mov dx, msg.errorinit error: mov ah, 09h int 21h mov ax, 4C01h int 21h msg: .errorinit: db "Too small initial allocation!",13,10,36 .errorexit: db "Failed last allocation!",13,10,36 .success: db "Success!",13,10,36 align 2 array: