1
0
mirror of https://github.com/PDP-10/stacken.git synced 2026-03-07 11:17:06 +00:00
Files
Lars Brinkhoff 6e18f5ebef Extract files from tape images.
Some tapes could not be extracted.
2021-01-29 10:47:33 +01:00

131 lines
4.0 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%title 'Macros for field definition'
! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED
! OR COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
!
! COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1983, 1986.
! ALL RIGHTS RESERVED.
!++
! .CHAPTER FIELDS -- Field Definitions assistance
!
! FACILITY: DIX
!
! Abstract: This file defines macros to help in defining fields and
! working with field definitions made in terms of masks, positions and
! offsets, and etc.
!
! ENVIRONMENT: Transportable library
!
! AUTHOR: David Dyer-Bennet, Creation Date: 11-Jun-82
!--
%sbttl 'Edit History' ! [7] Add this entire subsection
!++
! .hl 1 Edit History
!
! The edit history/version number information in this file is
! present only as comments. Sinve VERSION uses FIELDS in setting
! up its version numbers, it seemed a lot safer that way.
!--
! ; .autotable
!++
! new_version (1, 0)
!
! edit (7, '23-Aug-82', 'David Dyer-Bennet')
! %( Change version and revision standards everywhere.
! Files: All. )%
!
! Edit (%O'30', '19-Jan-83', 'David Dyer-Bennet')
! %( Update copyright notices, add mark at end of edit histories.
! )%
!
! Edit (%O'35', '8-June-83', 'Charlotte L. Richardson')
! %( Declare version 1 complete. All modules.
! )%
!
! new_version (1, 1)
!
! new_version (2, 0)
!
! Edit (%O'36', '11-Apr-84', 'Sandy Clemens')
! %( Put all Version 2 DIX development files under edit control. Some of
! the files listed below have major code edits, or are new modules. Others
! have relatively minor changes, such as cleaning up a comment.
! )%
!
! Edit (%O'50', '8-Oct-84', 'Sandy Clemens')
! %( Add new format of COPYRIGHT notice. FILES: ALL )%
!
! new_version (2, 1)
!
! Edit (%O'53', '3-Jul-86', 'Sandy Clemens')
! %( Add remaining sources to V2.1 area. Update copyright notices. )%
!
! **EDIT**
! .autoparagraph
!--
!++
! .hl 1 Macros for field definition
!
! These macros make it easy to work with fields defined by masks,
! positions, or etc. Thanks to Scott Robinson and TENDEF for the algorithms
! used.
!--
MACRO
make_mask ! \.hl 2 \
!++
! Make a mask for a field given the bit position within the word, and
! the length of the field.
!
! Formals:
!--
( ! ;.s 1.list 1
pos, ! \.le;\: Bit position in normal
! ; BLISS notation
lng ! \.le;\: Length in bits
) = ! ;.end list
((1^lng - 1)^pos)%,
field_position ! \.hl 2\
!++
! Given a mask, return the field position (bit number of the LO bit).
!
! Formals:
!--
( ! ;.s 1.list 1
mask ! \.le;\: The mask
) = ! ;.end list
(%NBITSU (mask AND - mask) - 1) %,
field_length ! \.hl 2\
!++
! Given a mask, return the field length in bits.
!
! Formals:
!--
( ! ;.s 1.list 1
mask ! \.le;\: The mask
) = ! ;.end list
! %BPVAL - %NBITSU ( NOT (mask^(%BPVAL - %NBITSU (MASK))))
! %NBITSU (mask) - (%NBITSU (mask AND - mask) - 1)
(%NBITSU (mask) - field_position (mask)) % ,
position_field ! \.hl 2 \
!++
! Given a value and a mask, put the value in that position within the
! word (and restrict its size).
!
! Formals:
!--
( ! ;.s 1.list 1
mask, ! \.le;\: Mask
val ! \.le;\: Value
) = ! ;.end list
((val^field_position(mask)) AND mask) % ;