home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / TP-UTIL.ARK / REGPACK.DEF < prev    next >
Text File  |  1986-01-06  |  2KB  |  33 lines

  1. {->>>>Register Types Definition<<<<----------------------------}
  2. {                                                              }
  3. { Filename : REGPACK.DEF -- Last Modified 10/20/85             }
  4. {                                                              }
  5. { These two types should be declared (via this include file)   }
  6. { anywhere you will be making either software interrupt calls  }
  7. { or DOS calls.  Using a free union variant record construct,  }
  8. { a register may be accessed as either a complete 16-bit       }
  9. { register (Word) or two 8-bit register halves (HiByte and     }
  10. { LoByte.)  Assume a variable Registers of type Regpack.  To   }
  11. { access an entire register, do this:                          }
  12. {                                                              }
  13. { Registers.AX.Word := $4406;   (Loads the whole AX register)  }
  14. {                                                              }
  15. { To access one half of a register, do this:                   }
  16. {                                                              }
  17. { Registers.AX.HiByte := $10;   (Loads AH only!)               }
  18. {                                                              }
  19. { And don't forget...you CAN'T include this file inside        }
  20. { another include file!                                        }
  21. {--------------------------------------------------------------}
  22.  
  23. TYPE
  24.   Reg     = RECORD
  25.               CASE Boolean OF
  26.                 False : (Word : Integer);
  27.                 True  : (LoByte,HiByte : Byte)
  28.             END;
  29.  
  30.   Regpack = RECORD
  31.               AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Reg
  32.             END;
  33. { Here we copy