%if 0 MCP menu timeout example 2026 by E. C. Masloch Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument. DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. %endif %include "lmacros3.mac" cpu 8086 org 256 start: mov bh, 20 mov dh, 9 call showtime1 mov ax, 40h mov es, ax .resetloop: xor di, di mov cx, word [es:6Ch] .loop: mov ah, 01h int 16h jnz .keyin test bh, bh jz .timedout cmp word [es:6Ch], cx jne @F .next: sti hlt jmp .loop @@: inc di cmp di, 18 jb .next dec bh call showtime1 jmp .resetloop .timedout: .enter: mov al, dh add al, '0' jmp @F .keyin: xor ax, ax int 16h @@: mov ax, 4C00h int 21h showtime1: push si push cx mov al, 13 mov cx, 40 @@: call dispal1 mov al, 32 loop @B mov si, msg1.default.1 call display1 mov al, dh add al, '0' call dispal1 mov si, msg1.default.2.inf cmp bh, -1 je @F mov si, msg1.default.2 call display1 mov dl, 3 xor ax, ax mov al, bh call disp_ax_dec_width_dl mov si, msg1.default.3 @@: call display1 pop cx pop si retn display1: push ax .loop: cs lodsb test al, al jz .ret call dispal1 jmp .loop .ret: pop ax retn dispal1: push bx push bp mov ah, 0Eh mov bx, 7 int 10h pop bp pop bx retn disp_ax_dec_width_dl: push ax push bx push cx push dx mov bx, dx mov bh, 0 mov cx, 10 mov dx, -1 push dx .loop1: xor dx, dx div cx push dx inc bh test ax, ax jnz .loop1 sub bl, bh jbe .loop2 @@: mov al, 32 call dispal1 dec bl jnz @B .loop2: pop ax add al, '0' jc .end call dispal1 jmp .loop2 .end: pop dx pop cx pop bx pop ax retn msg1: .default.1: asciz 13,"Will choose default " .default.2: asciz " in " .default.2.inf: asciz " if Enter pressed " .default.3: asciz " seconds "