Category : Utilities for DOS and Windows Machines
Archive   : ENABA20.ZIP
Filename : ENABA20.ASM

Output of file : ENABA20.ASM contained in archive : ENABA20.ZIP
; Name EnabA20.Asm
; Description This program enables address line 20 from the 80x86
; processor when making memory references. Default is
; to drive A20 low (dissabled). The line state is
; controlled by the 8042 keyboard controller.
; Synopsis MASM EnabA20;
; LINK EnabA20;
; EXE2BIN EnabA20 EnabA20.Com

COM8042 equ 064h
DAT8042 equ 060h

_CODE segment
assume cs:_CODE, ds:_CODE
org 100h
jmp _MAIN

Msg db 'EnabA20.Com',10,13
db '(C) 1989. Patrick M. Jaques',10,13,10,13
db '64K Extra Memory for DOS Applications '
db 'by enabling address line 20.',10,13
db '$'
Msg1 db 'Was Successful!'
db '$'
Msg2 db 'Failed!'
db '$'

_MAIN proc near
push cs
pop ds

mov ah,9
mov dx,offset Msg
int 21h

cli ; Dissable interrupts
call WaitOn8042 ; Make sure 8042 input buff is empty
jnz MAIN1 ; Leave if command not accepted
mov al,0D1h ; 8042 "Write Output Port" command
out COM8042,al ; Send command to 8042
call WaitOn8042 ; Wait for 8042 to ACK the command
jnz MAIN1 ; Leave if it wasn't
mov al,0DFh ; Grab A20 enable value.
; To dissable, use 0DDh instead
out DAT8042,al ; Send it out
call WaitOn8042 ; Wait for 8042 on last time
mov dx,offset Msg1
jmp MAIN2
mov dx,offset Msg2
sti ; Turn interrupts on
mov ah,9
int 21h
int 20h ; Exit to DOS ( .COM file )
_MAIN endp

WaitOn8042 proc near
xor cx,cx ; Clear timeout counter
in al,COM8042 ; Read 8042 status
and al,02 ; Test for input buffer full
loopnz WaitLoop ; Wait until timeout or OK.
WaitOn8042 endp

_CODE ends
end Start

  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : ENABA20.ZIP
Filename : ENABA20.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: