; $Id: test_0020_expr.mac 501 2013-03-30 13:53:39Z mueller $
|
; $Id: test_0020_expr.mac 501 2013-03-30 13:53:39Z mueller $
|
;
|
;
|
; test assignment and expressions
|
; test assignment and expressions
|
;
|
;
|
.asect
|
.asect
|
|
|
a1 = 100 ;;!! 000100
|
a1 = 100 ;;!! 000100
|
a2 == 110 ;;!! 000110
|
a2 == 110 ;;!! 000110
|
a3 =: 120 ;;!! 000120
|
a3 =: 120 ;;!! 000120
|
a4 ==: 130 ;;!! 000130
|
a4 ==: 130 ;;!! 000130
|
|
|
; unary operators
|
; unary operators
|
|
|
u1 = +200 ;;!! 000200
|
u1 = +200 ;;!! 000200
|
u2 = -300 ;;!! 177500
|
u2 = -300 ;;!! 177500
|
u3 = +-300 ;;!! 177500
|
u3 = +-300 ;;!! 177500
|
u4 = -+-300 ;;!! 000300
|
u4 = -+-300 ;;!! 000300
|
u5 = ^c300 ;;!! 177477
|
u5 = ^c300 ;;!! 177477
|
u6 = ^c-300 ;;!! 000277
|
u6 = ^c-300 ;;!! 000277
|
|
|
; binary operators
|
; binary operators
|
|
|
b1 = 1100 + 100 ;;!! 001200
|
b1 = 1100 + 100 ;;!! 001200
|
b2 = 1311 - 100 ;;!! 001211
|
b2 = 1311 - 100 ;;!! 001211
|
b3 = 400 * 3 ;;!! 001400
|
b3 = 400 * 3 ;;!! 001400
|
b4 = 2000 / 4 ;;!! 000400
|
b4 = 2000 / 4 ;;!! 000400
|
b5 = 1770 & 0077 ;;!! 000070
|
b5 = 1770 & 0077 ;;!! 000070
|
b6 = 1000 ! 100 ;;!! 001100
|
b6 = 1000 ! 100 ;;!! 001100
|
|
|
; radix prefixes and suffixes
|
; radix prefixes and suffixes
|
|
|
r1 = 11 ;;!! 000011
|
r1 = 11 ;;!! 000011
|
r2 = 11. ;;!! 000013
|
r2 = 11. ;;!! 000013
|
r3 = ^b11 ;;!! 000003
|
r3 = ^b11 ;;!! 000003
|
r4 = ^o11 ;;!! 000011
|
r4 = ^o11 ;;!! 000011
|
r5 = ^d11 ;;!! 000013
|
r5 = ^d11 ;;!! 000013
|
r6 = 99. ;;!! 000143
|
r6 = 99. ;;!! 000143
|
r7 = ^d99 ;;!! 000143
|
r7 = ^d99 ;;!! 000143
|
;; r8 = ^x1234
|
;; r8 = ^x1234
|
|
|
; other prefixes
|
; other prefixes
|
|
|
s1 = 'X ;;!! 000130
|
s1 = 'X ;;!! 000130
|
s2 = "XY ;;!! 054530
|
s2 = "XY ;;!! 054530
|
s3 = ^rabc ;;!! 003223
|
s3 = ^rabc ;;!! 003223
|
|
|
; long left-to-right expressions
|
; long left-to-right expressions
|
|
|
e1 = 100 + 20 * 2 + 1 ;;!! 000241
|
e1 = 100 + 20 * 2 + 1 ;;!! 000241
|
e2 = 200 - 100 / 2 ;;!! 000040
|
e2 = 200 - 100 / 2 ;;!! 000040
|
e3 = 777 * 2 & 77 ;;!! 000076
|
e3 = 777 * 2 & 77 ;;!! 000076
|
|
|
; nested expressions
|
; nested expressions
|
|
|
n1 = 400+200 ;;!! 000600
|
n1 = 400+200 ;;!! 000600
|
n2 = <400+200> ;;!! 000600
|
n2 = <400+200> ;;!! 000600
|
n3 = 400+ 2*100 ;;!! 040200
|
n3 = 400+ 2*100 ;;!! 040200
|
n4 = 400+<2*100> ;;!! 000600
|
n4 = 400+<2*100> ;;!! 000600
|
n5 = 400+ 200-100 /2 ;;!! 000240
|
n5 = 400+ 200-100 /2 ;;!! 000240
|
n6 = 400+<<200-100>/2> ;;!! 000440
|
n6 = 400+<<200-100>/2> ;;!! 000440
|
|
|
.end
|
.end
|
|
|