Skip to content

Commit

Permalink
Add some register label tests that don't work yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhialto committed Apr 21, 2021
1 parent 9ade850 commit cb331d2
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions tests/test-reg.mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
;;;;;
;
; Test expressions that evaluate to registers.
;
; !!! THIS TEST IS NOT RUN YET BECAUSE MANY OF THE CASES FAIL !!!
;
; All lines not marked "error" should assemble without complaint
; as absolute values (no relocation etc).
;
; Section 3.4 (page 3-8) is a bit vague about the expressions that are allowed
; after a %, but "the digit specifying the register can be replaced by any valid,
; absolute term that can be evaluated during the first assembly pass."
; It specifically mentions %3+1 to be the same as %4.
; For the rest there is no indication where exactly register labels can be used.

A = 1

l1 = %1
l2 = %1+1
l3 = %a
l4 = %a + 1
l5 = %<1+1>
l6 = <%1>+1 ; must be register!
l7 = <%a>+1 ; must be register!
l8 = %1 + %2
l8a = <%1> + <%2> ; must be register!
l9 = %<%1 + %2>

B = rti ; 2

l10 = %B
l11 = %wait ; 1

l12 = %1.
l13 = %7.
l14 = %10 ; error: too large
l15 = %8. ; error: too large

mov #%2,%2 ; must not be a relocatable expression!
mov #l1,%2 ; must not be a relocatable expression!
mov #<%1+%2>,%3 ; must not be a relocatable expression!
mov #<l1+1>,%3 ; must not be a relocatable expression!
mov #<%l1+1>,%3 ; must not be a relocatable expression!

l20 = %l1
l21 = %l20

l22 = l1 ; still a register
l23 = l22 ; still a register

.end

0 comments on commit cb331d2

Please sign in to comment.