The following code when assembled gives no output on console. Copied code from inet. Seek help to correct code error.
-> Under 'Addressing Memory', 'source code or here'.
CODE:
%OUT-------------------------------------------------------------------------
%OUT Written by Ferdi Smit for use with the "ASM Tutorial Part 2" -
%OUT-------------------------------------------------------------------------
; To compile: TASM examp2.asm -
; TLINK examp2.obj -
;----------------------------------------------------------------------------
.model small
.stack 10
.data
value_one db 0
value_two dw 0
value_three db 0
value_four db "everybody","$"
value_five db 3 dup ("!")
video_segment dw 0B800h
.code
_main proc
mov ax,seg value_one
mov ds,ax
mov es,[video_segment]
mov [value_one],"H"
mov byte ptr [value_two],"e"
mov byte ptr [value_two + 1],"l"
mov byte ptr [value_three],"l"
mov byte ptr [value_three + 1],"o"
mov word ptr [value_three + 2],2020h
lea di,value_four
inc byte ptr [di]
;----------------------
xor di,di
lea si,value_one
mov cx,19
mov ah,07h
cld
print_loop:
lodsb
stosw
loop print_loop
;----------------------
mov ax,0C07h
int 21h
mov ax,4c00h
int 21h
_main endp
end _main
-x
-> Under 'Addressing Memory', 'source code or here'.
CODE:
%OUT-------------------------------------------------------------------------
%OUT Written by Ferdi Smit for use with the "ASM Tutorial Part 2" -
%OUT-------------------------------------------------------------------------
; To compile: TASM examp2.asm -
; TLINK examp2.obj -
;----------------------------------------------------------------------------
.model small
.stack 10
.data
value_one db 0
value_two dw 0
value_three db 0
value_four db "everybody","$"
value_five db 3 dup ("!")
video_segment dw 0B800h
.code
_main proc
mov ax,seg value_one
mov ds,ax
mov es,[video_segment]
mov [value_one],"H"
mov byte ptr [value_two],"e"
mov byte ptr [value_two + 1],"l"
mov byte ptr [value_three],"l"
mov byte ptr [value_three + 1],"o"
mov word ptr [value_three + 2],2020h
lea di,value_four
inc byte ptr [di]
;----------------------
xor di,di
lea si,value_one
mov cx,19
mov ah,07h
cld
print_loop:
lodsb
stosw
loop print_loop
;----------------------
mov ax,0C07h
int 21h
mov ax,4c00h
int 21h
_main endp
end _main
-x