home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
BASIC
/
POWBASIC
/
LIBRARY1
/
EQUIP.ZIP
/
EQUIP.ASM
next >
Wrap
Assembly Source File
|
1990-04-11
|
2KB
|
45 lines
Code Segment Byte ;Make it a code segment
public equipment ;MUST be PUBLIC for PB to see
; Call Equipment(ConvMem%,Printers%,ComPorts%,GameAdapters%)
; offsets = 18 14 10 6
; in hex 12h 0Eh 0Ah 6h
equipment proc far ;MUST be a FAR Procedure
PUSH BP ;save
MOV BP,SP
INT 12h ;get conventional memory
LDS BX,[BP+18] ;point to ConvMem%
MOV DS:[BX],AX ;Place value in ConvMem%
XOR DX,DX ;clear DX for useage
INT 11h ;Get Equipment
MOV AL,AH ;just look at top 8 bits
;save them in AH
;use AL to manipulate
MOV CL,06 ;Dump bits 8-13,
SHR AL,CL ; and move 14 & 15 to lower posn's
AND AL,03 ;mask any other positions
MOV DL,AL ;Move Printers%
LDS BX,[BP+14] ;Point to Printers%
MOV DS:[BX],DX ;And store in Printers%
MOV AL,AH ;Get top 8 bits again
SHR AL,1 ;This time look at bits 9,10&11
AND AL,07 ; by masking for 3 bits
MOV DL,AL ;And move ComPorts to DL
LDS BX,[BP+10] ;Point to ComPorts%
MOV DS:[BX],DX ;and store in ComPorts%
MOV AL,AH ;Again, get top 8 bits (8 thru 15)
MOV CL,04 ;And look at bit 12
SHR AL,CL ; by shifting to that posn
AND AL,01 ;and masking for 1 bit
MOV DL,AL ;Now, move GamePorts% to DL
LDS BX,[BP+06h] ;point to GamePorts%
MOV DS:[BX],DX ;and store the value in GamePorts%
POP BP ;restore BP
RETF 000Fh ;and fix stack.. we used 16 locations
; with the values passed
equipment endp ;End the proc
;other procs can go here
; and then,
code ends ;end the code seg
end ;and the assembly