R0 stores the sum, initialized to zero. R1 is the address of the current word under consideration. Registers R2 and R3 store constants.

        CLR R0
        MOV #10000, R1
        MOV #40, R2
        MOV #14000, R3
 LOOP:  MOV@ R1, R4
        CMP R4, R2
        BNE CONT
        INC R0
 CONT:  INC R1
        CMP R3, R1
        BLT LOOP
        HALT


[on to problem #2]