Im very new in this assembly language can you guys help me
.model small
.stack
.code
org 100h
start:
main proc
mov cx,1; how many times to loop
h
Since you are writing to port 0x378, I am guessing you have eight LED's, one each attached to eight data pins and eight ground pins on your PARALLEL PORT. This tells me you have an older machine and probably are running TRUE DOS. Is this correct? (If so, be very careful of the current being drawn from the LEDs that you don't damage your parallel port. A current limiting resister is highly recommended.)
You are using the Small model, which is designed to create a .OBJ file for a linker to create an .EXE file. However, you then place the ORG 100h directive which is designed to create a .OBJ file for a linker to create an .COM file, or create it directly without the linker.
If you are creating an .EXE and running this .EXE, yes, you will get an illegal instruction at some point in time, with the way you have coded this (labels will be 100h bytes away from where they should be).
If you aren't already, you need to convert the .EXE to a .COM file. The .EXE extension (along with a signature) will tell the OS to load a stack, data, and code segment. The .COM extension (with the missing signature) will tell the OS to simply load the binary file and jump to offset 100h, period.
To read that value, you will have to set up a segment register and a base/index register to point to that physical address. If you don't know what I mean, you will need to read about 16-bit segmented addressing.