I am learning NASM and trying to understand the codes.
I have a code like:
section .data
text: db "Just some text" ;LENGTH = 14.
color: db 181
x: db 0
y: db 0
section .text
global _start
_start:
mov bp, text ;STRING TO DISPLAY.
mov cx, 14 ;STRING LENGTH.
mov [x], byte 50
mov [y], byte 20
call color_string
mov ax,4c00h
int 21h
color_string:
mov ax, ds
mov es, ax
mov ah, 13h
mov bh, 0
mov bl, color
mov dl, x
mov dh, y
int 10h
ret
I am just trying to learn NASM and trying to compile this code.
Here I just want to print the text in different color. But compiling it giving me error.
If anyone also can guide me how to print the text color in loop that would be greeat like print the text 5 times with loop.
I am getting the error like:
color.o: In function `_start':
color.asm:(.text+0x2): relocation truncated to fit: R_386_16 against `.data'
color.o: In function `color_string':
color.asm:(.text+0x2b): relocation truncated to fit: R_386_8 against `.data'
color.asm:(.text+0x2d): relocation truncated to fit: R_386_8 against `.data'
color.asm:(.text+0x2f): relocation truncated to fit: R_386_8 against `.data'
I dont know what is the issue. Help needed.