name numlock
page 58,132
title NUMLOCK.COM
;
;
; NUMLOCK.COM Version 1.00
;
; Copyright (C) Dan Obstbaum 1989
;
;
; Program toggles Num Lock ON.
;
;
; To assemble, link, and convert this program into
; a .COM file, follow these steps:
;
;
; C>masm numlock;
; C>link numlock;
; C>exe2bin numlock.exe numlock.com
; C>del numlock.exe
; C>del numlock.obj
;
;
; Ignore the message "Warning: no stack segment" from the Linker.
;
cseg segment para public 'code'
org 100h ;.COM
assume cs:cseg,ds:cseg,es:cseg,ss:cseg
toggle proc near
push ds ;save DS
mov ax,40h ;BIOS data segment
mov ds,ax
mov bx,[ds:17h] ;get Shift Status byte
or bx,00100000b ;Num Lock bit to 1
mov [ds:17h],bx ;Num Lock is now toggled ON
pop ds ;restore
mov ah,4ch ;exit back to MS-DOS
mov al,00h ;with a "return code" of zero
int 21h
toggle endp
cseg ends
end toggle