write an assembly language subordinate count according to these specs: accepts a pointer to an array or signed words in register X. Accepts a word value in register Y, which indicates the number of array elementsl Returns the number (i.e. count) of nonzero array elements in register D. On returnm preserves contents of all registers, other than the result return register.

To create an assembly language subroutine that meets the given specifications, you can follow these steps:

1. First, set up the subroutine's entry and exit code using the appropriate directives or macros specific to the assembly language you are using.

2. Save the contents of all registers that need to be preserved, except for the result register D.

3. Use a loop to iterate through each element of the array pointed to by the X register. You can use the value in the Y register to determine the number of array elements.

4. Inside the loop, load each array element into a temporary register, such as register A.

5. Compare the value in the temporary register with zero to check if it's nonzero. If it is nonzero, increment the count stored in register D.

6. After the loop, restore the contents of all preserved registers.

7. Finally, return from the subroutine.

Here's an example implementation in ARM assembly language:

```assembly
; Subroutine to count nonzero elements in an array
; Inputs:
; - X: Pointer to the array (register X)
; - Y: Number of array elements (register Y)
; Outputs:
; - D: Number of nonzero elements

NONZERO_COUNT:
PUSH {R4, R5, R6, LR} ; Save preserved registers

MOV R6, #0 ; Initialize count to zero

LOOP:
LDR R4, [X], #4 ; Load array element into R4 and increment X by 4
CMP R4, #0 ; Compare array element with zero
BEQ SKIP_INC ; Skip increment if element is zero
ADD R6, R6, #1 ; Increment count

SKIP_INC:
SUBS Y, Y, #1 ; Decrement element count
BNE LOOP ; Repeat loop if there are more elements

MOV D, R6 ; Move count to D

POP {R4, R5, R6, PC} ; Restore preserved registers and return from subroutine
```

Note: This example assumes the use of ARM assembly language. If you're using a different assembly language, the syntax may vary, but the overall logic should remain the same.

To write an assembly language subroutine according to the provided specs, you can follow these steps:

1. First, save the contents of all registers except the result return register (register D) to preserve their values.

2. Set up a loop to iterate through each element of the array. You will need to use a counter to keep track of the number of iterations.

3. Load the value of the array pointer (in register X) into another register (e.g., register R) to use it for accessing array elements.

4. Set the initial value of the counter to 0.

5. Use a loop to iterate through the array:

a. Load the current array element into a register (e.g., register A) using the addressing mode based on the array pointer register (R) and the counter register value.

b. Check if the array element (in register A) is zero. If it is not zero, increment the count register (D) by 1.

c. Increment the counter register by 1 to move to the next array element.

d. Repeat the loop until the counter reaches the total number of array elements (in register Y).

6. After the loop ends, the count of nonzero array elements will be stored in register D.

7. Finally, restore the contents of all registers that were saved in step 1.

Here is an example of assembly language code that implements the mentioned subroutine:

```
; Save the contents of all registers except register D
PUSH R1
PUSH R2
PUSH R3
; ... save other registers if needed

; Set up loop and initialize counter
LD R1, X ; Load array pointer into R1
LD R2, Y ; Load total number of elements into R2
MOV D, #0 ; Initialize count register to zero

; Loop through array elements
Loop:
LDD A, R1+ ; Load current element into A
CPD #0 ; Compare A with zero
BREQ Skip ; Branch to Skip if A is zero

INC D ; Increment count register

Skip:
DEC R2 ; Decrement counter
BNE Loop ; Branch back to Loop if counter is not zero

; Restore the contents of previously saved registers
POP R3
POP R2
POP R1

; Return from subroutine
RET
```

Note: The provided code assumes a certain assembly language syntax and register names. You may need to adjust it based on the specific assembly language you are using.