.TITLE Sys_Btest .PSECT _Sys_Btest, EXE, NOWRT, RD .ENTRY Sys_Btest, ^M<> ;++ ; ; Author: Jonathan Welch ; ; Functional description: ; ; The bit specified by the position and base operands is tested and ; its state is returned. ; ; Calling sequence: ; ; State = Sys_Btest(Bitposition, Base) ; ; Formal arguments: ; ; Bitposition ; VMS Usage : longword_unsigned ; type : longword (unsigned) ; access : read only ; mechanism : by value ; ; An offset from the base operand specifying which bit to test. ; ; Base ; VMS Usage : address ; type : longword (unsigned) ; access : read only ; mechanism : by reference ; ; Base address to offset "Bitposition" bits from. ; ; Implicit Inputs: ; ; none ; ; Implicit Outputs: ; ; none ; ; Routine value: ; ; 0 if the specified bit is off. ; 1 if the specified bit is on. ; ;-- Bitpos = 4 Base = 8 MOVL #0, R0 ; assume bit is off. BBC Bitpos(AP), @Base(AP), Exit ; it is, exit. MOVL #1, R0 ; it's set, return 1. Exit: RET .END