SmileeTiger
Programmer
Hi I am trying to output some text to the screen using the following routine.. any idea why it won't work?
Is there a better way to do this?
.data
text db "lalala",0
.code
main proc
;This section sets up es to point to the .data section and ds to point to the display
mov ax, @data
mov es,ax ; Moves the ax val to the extra segment
mov ax, 0B800h ; Location for the display
mov ds,ax ; Moves the ax val to the data segment
;end setting up the segments
mov di, offset text
mov bx,30h
mov cx,5h
mov al,0eh
DrawText:
mov ah,es:[di]
mov [bx],ax
add di,1
loop DrawText
Is there a better way to do this?
.data
text db "lalala",0
.code
main proc
;This section sets up es to point to the .data section and ds to point to the display
mov ax, @data
mov es,ax ; Moves the ax val to the extra segment
mov ax, 0B800h ; Location for the display
mov ds,ax ; Moves the ax val to the data segment
;end setting up the segments
mov di, offset text
mov bx,30h
mov cx,5h
mov al,0eh
DrawText:
mov ah,es:[di]
mov [bx],ax
add di,1
loop DrawText