MOVPSL

VAX11

 

MOVPSL MOVE FROM PSL

 

Purpose

obtain processor status

Format

opcode dst.wl

Operation

dst ß PSL;

Condition codes

N ß N;

Z ß Z;

V ß V;

C ß C;

Exceptions

none

Opcodes

DC       MOVPSL                    Move from PSL

Description

The destination operand is replaced by the processor status

longword

Notes

 

 

 

Example 1

 

In the following program we put 0 in r0, and then printing it, and printing the PSW.

Then we put -1 in r0 and print the PSW again. PSW will be 4 and then 8 (On the beginning the third bit will be 1, and on the end the fourth bit will be set).

 

.text

 

main: .word 0

      # put 0 in r0. Zero flag will raised

      movl $0, r0

      movpsl r1   # r1 will contains the PSL

      movw r1, r2 # save only the PSW to r2

      pushl r0

      pushl r2

      pushal format

      calls $3, .printf

     

      # put negative number in r0. Neg flag should rised

      movl $-1, r0

      movpsl r1   # r1 will contains the PSL

      movw r1, r2 # save only the PSW to r2

      pushl r0

      pushl r2

      pushal format

      calls $3, .printf

 

      pushl $0

      calls $1, .exit

 

 

format: .asciz "PSW is %d. R0 is %d\n"