[Nasm-devel] BIOS int 0x16 not working in Windows 10 NASM DOSBOX

nasm at tponet.net nasm at tponet.net
Thu Sep 21 15:52:34 PDT 2023


I typed in your program and compiled it in FreeDOS 1.3 using nasm 2.16.01 and it worked fine.

I compiled it on DOSBox running on MacOS and with nasm 2.15.05 and it worked fine.

I don’t have a Windows 10  machine to test it on.

Hers is what I entered

org 0x100

start:
    xor ax, ax
    mov es, ax
    sti
l1:
    mov ah, 0
    int 0x16
    cmp al, 27
    jne l1

    mov ax, 0x4c00
    int 0x21


Tyson Oswald



maybe try and remove the [ ] around  org 0x100?

> On Jul 7, 2023, at 2:53 AM, muhammad shamaas <muhammad.shamaas.skipq at gmail.com> wrote:
> 
> Hello, 
> I am trying to read keyboard input using int 0x16 in Windows 10 NASM DOSBOX but it is not working. Can you tell me what the problem is?
> 
> [org 0x0100] 
> 
> jmp start 
> 
> 
> 
> start: xor ax, ax 
> 
> 	mov es, ax ; point es to IVT base 
> 
> 	sti ; enable interrupts 
> 
> l1: 	mov ah, 0 ; service 0 – get keystroke 
> 
> 	int 0x16 ; call BIOS keyboard service 
> 
> 	cmp al, 27 ; is the Esc key pressed 
> 
> 	jne l1 ; if no, check for next key 
> 
> 
> 
> mov ax, 0x4c00 ; terminate program 
> 
> int 0x21 
> 
> 
> _______________________________________________
> Nasm-devel mailing list
> Nasm-devel at nasm.us
> https://lists.nasm.us/nasm-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.nasm.us/archives/nasm-devel/attachments/20230921/6617adeb/attachment-0001.htm>


More information about the Nasm-devel mailing list