1
0
mirror of https://github.com/wfjm/w11.git synced 2026-02-25 00:37:48 +00:00
Files
wfjm.w11/tools/tests/divtst/rsx/getpsw.mac

78 lines
2.8 KiB
Plaintext

; $Id: getpsw.mac 1266 2022-07-30 17:33:07Z mueller $
; SPDX-License-Identifier: GPL-3.0-or-later
; Copyright 2014-2022 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
;
; Revision History:
; Date Rev Version Comment
; 2014-07-20 570 1.0 Initial version (cloned from 211bsd version)
;
.psect data,d,rw
.even
valpsw::.word 0
.psect
getpsw::bmi cc1xxx ; branch on N=1
beq cc01xx ; branch on N=0,Z=1
bvs cc001x ; branch on N=0,Z=0,V=1
bcs cc0001 ; branch on N=0,Z=0,V=0,C=1
mov #000, valpsw ; here N=0,Z=0,V=0,C=0
return
cc0001: mov #001, valpsw ; here N=0,Z=0,V=0,C=1
return
cc001x: bcs cc0011 ; branch on N=0,Z=0,V=1,C=1
mov #002, valpsw ; here N=0,Z=0,V=1,C=0
return
cc0011: mov #003, valpsw ; here N=0,Z=0,V=1,C=1
return
cc01xx: bvs cc011x ; branch on N=0,Z=1,V=1
bcs cc0101 ; branch on N=0,Z=1,V=0,C=1
mov #004, valpsw ; here N=0,Z=1,V=0,C=0
return
cc0101: mov #005, valpsw ; here N=0,Z=1,V=0,C=1
return
cc011x: bcs cc0111 ; branch on N=0,Z=1,V=1,C=1
mov #006, valpsw ; here N=0,Z=1,V=1,C=0
return
cc0111: mov #007, valpsw ; here N=0,Z=1,V=1,C=1
return
cc1xxx: beq cc01xx ; branch on N=1,Z=1
bvs cc001x ; branch on N=1,Z=0,V=1
bcs cc1001 ; branch on N=1,Z=0,V=0,C=1
mov #010, valpsw ; here N=1,Z=0,V=0,C=0
return
cc1001: mov #011, valpsw ; here N=1,Z=0,V=0,C=1
return
cc101x: bcs cc1011 ; branch on N=1,Z=0,V=1,C=1
mov #012, valpsw ; here N=1,Z=0,V=1,C=0
return
cc1011: mov #013, valpsw ; here N=1,Z=0,V=1,C=1
return
cc11xx: bvs cc111x ; branch on N=1,Z=1,V=1
bcs cc1101 ; branch on N=1,Z=1,V=0,C=1
mov #014, valpsw ; here N=1,Z=1,V=0,C=0
return
cc1101: mov #015, valpsw ; here N=1,Z=1,V=0,C=1
return
cc111x: bcs cc1111 ; branch on N=1,Z=1,V=1,C=1
mov #016, valpsw ; here N=1,Z=1,V=1,C=0
return
cc1111: mov #017, valpsw ; here N=1,Z=1,V=1,C=1
return
.end