Video SEGMENT AT 0400h CmdReg DB ? DataReg DB ? Video ENDS Data SEGMENT Para Public 'Data' Msg DB "etrov" Data ENDS Code SEGMENT byte Public 'Code' ASSUME cs:Code, ds:Data, es:Video Start: mov ax, Video ; initialize ES register mov es, ax mov ax, Data ; initialize DS register mov ds, ax ; Initialize the Display Module,i.e. CLEAR_SCREEN mov cx, 0FFFFh z1: loop z1 ; wait mov CmdReg, 38h ; Function Set mov cx, 0FFFFh z2: loop z2 ; wait mov CmdReg, 0Fh ; Set Display on/off control mov cx, 0FFFFh z3: loop z3 ; wait mov CmdReg, 01h ; Clear Display mov cx, 0FFFFh z4: loop z4 ; wait mov CmdReg, 06h ; Entry mode set mov cx, 0FFFFh z5: loop z5 ; wait ; Move cursor at row DH and column DL, i.e. MOVE_CURSOR mov dh, 0 ; set the row mov dl, 0Ah ; set the column test1: test CmdReg, 80h ; check if Display Module is ready jnz test1 test dh, 0 ; check if chosen row is 0 jnz row1 ; if no then row1 mov bx, 80h jmp clm ; go to get the chosen column row1: mov bx, 0C0h ; if chosen row is 1 then set the right code mov bh, 0 clm: add bx, dx ; set up the addr of the cursor mov CmdReg, bl ; send addr to Display Module test2: test CmdReg, 80h jnz test2 ; Put the character from AL on the display,i.e. PUT_CHAR mov al, 'P' ;set the char mov DataReg, al ; move the char to the Display Module inc bx ; inc to the next addr on the Display test3: test CmdReg, 80h ; check if the Display Module is ready jnz test3 ; Display the rest of the mane,i.e. PUT_ASCIIZ mov cx, 5 ; initialize the loop counter mov si, OFFSET Msg mov di, OFFSET DataReg Rest: test CmdReg, 80h ; check if Displey Module is ready jnz Rest mov CmdReg, bl ; send addr to Display Module test4: test CmdReg, 80h jnz test4 movsb ; move the char to the Dispaly Module dec di ; reset di to point to DataReg inc bx ; inc to the next addr on the Display loop Rest Done: jmp Done ; infinite loop to keep message on Display Code ENDS END Start