Category : Assembly Language Source Code
Archive   : CMOSSAVE.ZIP
Filename : CMOSGET.ASM

 
Output of file : CMOSGET.ASM contained in archive : CMOSSAVE.ZIP
PAGE ,132 ; (CTRL-OH) IBM PC PRINTER CONDENSED MODE
TITLE CMOSGET - READ CMOS MEMORY AND SAVE TO A FILE VIA REDIRECTION
; SYNTAX = CMOSGET > CMOS.DAT
CSEG SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:CSEG,DS:CSEG,SS:CSEG,ES:CSEG ;ALREADY SET BY DOS LOADER

ORG 100H ;COM FILE FORMAT, SKIP TO END OF THE PSP

CMOS_ADR EQU 70H ;ADDRESS PORT OF CMOS
CMOS_DATA EQU 71H ;DATA PORT OF CMOS
NUM_BYTES EQU 64 ;NUMBER OF BYTES IN CMOS

MAIN PROC NEAR

MOV CX,NUM_BYTES ;NUMBER OF CMOS BYTES

GET_NEXT_BYTE:

MOV AL,NUM_BYTES ;CALCULATE
SUB AL,CL ; BYTE TO FETCH
CLI ;NO INTERRUPTS
OUT CMOS_ADR,AL ;ASK FOR THIS BYTE
JMP SHORT $+2 ;DELAY FOR SLOW OUTPUT PORTS
IN AL,CMOS_DATA ;READ BYTE
STI ;ALLOW INTERRUPTS
MOV AH,2 ;WRITE TO STDOUT
MOV DL,AL ; BYTE IN DL
INT 21H ; THRU DOS
LOOP GET_NEXT_BYTE ;REPEAT UNTIL DONE

RET ;NEAR RETURN TO DOS
MAIN ENDP
CSEG ENDS
END MAIN


  3 Responses to “Category : Assembly Language Source Code
Archive   : CMOSSAVE.ZIP
Filename : CMOSGET.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: http://www.os2museum.com/wp/mtswslnk/