3) Write an assembly program that:

Load AL by an arbitrary number, if there is parity even, transfer 80H to the Port 0, and if there is parity odd, transfer 01H to the Port 0.

Convert your assembly code to machine code and enter the program into the 8086 trainer.

Assuming that the number we are loading into AL is stored in a memory location labeled "number":

```
LOAD_AL:
MOV AL, [number] ; Load AL with the arbitrary number
MOV BL, 01H ; Set BL to 01H
MOV CL, 0 ; Set CL to 0
PARITY_LOOP:
SHR AL, 1 ; Shift AL one bit to the right
JC PARITY_ODD ; If the least significant bit is 1, jump to PARITY_ODD
INC CL ; Increment CL
CMP CL, 8 ; Compare CL to 8 (the number of bits in a byte)
JL PARITY_LOOP ; If CL is less than 8, jump back to PARITY_LOOP
PARITY_EVEN:
MOV DX, 80H ; Set DX to 80H
JMP PORT_OUT ; Jump to PORT_OUT
PARITY_ODD:
MOV DX, BL ; Set DX to 01H
PORT_OUT:
MOV AL, 0 ; Clear AL
MOV OUT 0, DX ; Output DX to Port 0
RET ; Return from subroutine
```

To convert the assembly code to machine code, we can use an online assembler or use a tool like NASM. The resulting machine code will vary depending on the assembler used. Once we have the machine code, we can enter it into the 8086 trainer and run the program.

Sure! Here's an assembly program that fulfills the given requirements:

```assembly
MOV AH, 0 ; Clear AH register
MOV AL, 17H ; Load AL with an arbitrary number

TEST AL, 1 ; Check the least significant bit to determine parity
JPE EVEN_PARITY ; Jump to EVEN_PARITY if the parity is even

ODD_PARITY:
MOV DX, 80H ; If parity is odd, transfer 01H to Port 0
OUT DX, AL
JMP END

EVEN_PARITY:
MOV DX, 80H ; If parity is even, transfer 80H to Port 0
MOV AL, 80H
OUT DX, AL

END:
HLT ; Halt the program
```

To convert this assembly code to machine code, you can use an assembler like NASM (Netwide Assembler). Here's the machine code equivalent of the above assembly code:

```
B0 00
B0 17
A8 01
74 05
BA 80 00
EE
EB 04
BA 80 00
B8 80 00
EF
F4
```

Please note that the above machine code is specific to the 8086 architecture. You can enter this machine code into the 8086 trainer to run the program.