home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY1 / EQUIP.ZIP / EQUIP.ASM next >
Assembly Source File  |  1990-04-11  |  2KB  |  45 lines

  1. Code Segment Byte        ;Make it a code segment
  2. public equipment        ;MUST be PUBLIC for PB to see
  3. ; Call Equipment(ConvMem%,Printers%,ComPorts%,GameAdapters%)
  4. ;  offsets =         18       14         10        6
  5. ;     in hex         12h      0Eh        0Ah       6h
  6. equipment    proc far    ;MUST be a FAR Procedure
  7.     PUSH    BP          ;save
  8.     MOV    BP,SP
  9.     INT    12h        ;get conventional memory
  10.     LDS    BX,[BP+18]    ;point to ConvMem%
  11.     MOV    DS:[BX],AX    ;Place value in ConvMem%
  12.     XOR    DX,DX        ;clear DX for useage
  13.     INT    11h        ;Get Equipment
  14.     MOV    AL,AH        ;just look at top 8 bits
  15.                 ;save them in AH
  16.                 ;use AL to manipulate
  17.     MOV    CL,06        ;Dump bits 8-13,                                  
  18.     SHR    AL,CL        ; and move 14 & 15 to lower posn's
  19.     AND    AL,03        ;mask any other positions
  20.     MOV    DL,AL        ;Move Printers%
  21.     LDS    BX,[BP+14]    ;Point to Printers%
  22.     MOV    DS:[BX],DX    ;And store in Printers%
  23.     MOV    AL,AH        ;Get top 8 bits again
  24.     SHR    AL,1        ;This time look at bits 9,10&11
  25.     AND    AL,07        ; by masking for 3 bits
  26.     MOV    DL,AL        ;And move ComPorts to DL
  27.     LDS    BX,[BP+10]    ;Point to ComPorts%
  28.     MOV    DS:[BX],DX    ;and store in ComPorts%
  29.     MOV    AL,AH        ;Again, get top 8 bits (8 thru 15)
  30.     MOV    CL,04        ;And look at bit 12
  31.     SHR    AL,CL        ; by shifting to that posn
  32.     AND    AL,01        ;and masking for 1 bit
  33.     MOV    DL,AL        ;Now, move GamePorts% to DL
  34.     LDS    BX,[BP+06h]    ;point to GamePorts%
  35.     MOV    DS:[BX],DX    ;and store the value in GamePorts%
  36.     POP    BP        ;restore BP
  37.     RETF    000Fh        ;and fix stack.. we used 16 locations
  38.                 ; with the values passed
  39. equipment    endp        ;End the proc
  40.                 ;other procs can go here
  41.                 ; and then,
  42.     code    ends        ;end the code seg
  43.     end            ;and the assembly
  44.  
  45.