; Test PDP Program for subset assembler ; ; PRINT=9230 ; Should give bad oct. INPUT=3772 ; ok .start 1000 move R1, r2 ; move instead of mov mov sp ,r0 ; spaces mov #go, r4 ; immediate has to be a number mov r4 , pc ; that's a jump! !Login: mov r0,r0 ; invalid label name .go ; .go instead of go: cmp (r3),(r4) ; mode 1 **Extra** add (sp)+ , ; no 2nd param movb (r4,r5) ; no ) before , cmp r7,r8 ; reg out of range add @(r3)+(r5) ; no comma mov r4,-r6 ; no ( mov #!5,r4 ; ! instead of 1 cmp (Q1),r5 ; Bad defered register mov @(r1),r2 ; should be @(r1)+ or @-(r1) mov r7,-(sp) mov @jim(R4),r5 ; Undeclared label ; now single operand instructions clr r4 tst (r3) clr @(R5 ; no ) tst @(r1) ; no + or - tstb jim(R2 dec sp ; ; Now reg,dst ie jsr HERE: jsr there jsr pc,go_back jsr pc,fred ; this should give 'undef label' mov r9,r0 mov fred,r0 jsr r4,j7fred ; undefined label jsr (r4),fred ; reg??? jsr r7 go ; no comma ; now just reg is rts rts ; no reg rst pc rts r7 rts r3 ; pop to r3 (?) rts product ; starts with 'p', might be pc rts spare ; starts with 's', might be sp ; now branches bgt fred bne ; no label bne fred,jim ;? add ,r4 ; Now some instructions with no errors ; two operands: mov r3,(r4) ; mode 0, mode 1 add (sp)+,@(r1)+ ; mode 2, mode 3 cmp -(r4),@-(r0) ; mode 4, mode 5 ;.... mov block(r0),r1 ; mode 6 mov @block(r0),r1 ; mode 7 mov r2,block(r0) ; mode 6 mov r3,@block(r0) ; mode 7 ;.... movb block(R0),@block2(R1) ; mode 6, mode 7 mov #2,r1 ; immediate - mode 2, reg 7 add r2,@#block ; absolute - mode 3, reg 7 cmp block,r4 ; relative - mode 6, reg 7 movb r1,@block2 ; relative defered - mode 7, reg 7 ; one operand: clr r4 tst (r5) tstb (r2)+ dec @(sp)+ ; jsr/rts jsr pc,go2 rts pc rts r0 ; that does a pop doesn't it? jsr r1,block ; push r1, then jump to block ; branches bne go2 bgt block2 ; labels: go2: tstb r0 block: tstb r0 block2: tstb r0 .end