PL/I CAN 16
From: robin (robin_v_at_bigpond.mapson.com)
Date: 12/30/03
- Next message: robin: "PL/I CAN 18"
- Previous message: robin: "PL/I CAN 11"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Dec 2003 06:06:21 GMT
> 16. CANT output bitfield DIRECTLY from integer value in 1 statement
FALSE. FRANK WAS SHOWN THIS A WEEK OR SO AGO.
PUT (SUBSTR(VALUE, M, N));
The corresponding declaration is:
DCL VALUE FIXED BINARY (31) INIT ('12345678'XN);
> ! ----------------------
> program output_bits ! from bitfield n:m
> integer :: value = #12345678 ! hex constant
> integer :: n = 3, m = 25
> write (*,'(99i0)') ishft(value,[-m:-n]).and.1
> end program
> Output: 10001101000101011001111
> 2 3 4 5 6 7 8
- Next message: robin: "PL/I CAN 18"
- Previous message: robin: "PL/I CAN 11"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|