Hi,

I have been trying to write a simple Hello World boot loader using assembly language.
I tried my first program to print a character 'A' on the screen by writing to the VDU memory. The code is as shouwn below :

entry start
start:
mov ax,#0xb800
mov es,ax
seg es
mov [0],#0x41
seg es
mov [1],#0x1f
loop1: jmp loop1

reference : http://linuxgazette.net/issue77/krishnakumar.html

It worked fine.

But when i tried the below code using bios interrupt, It is not displaying the string but the ascii representation only.

entry start
start:
mov ah,#0x03
xor bh,bh
int 0x10

mov cx,#26
mov bx,#0x0007
mov bp,#mymsg
mov ax,#0x1301
int 0x10

loop1: jmp loop1

mymsg:
.byte 13,10
.ascii "Hello World"


reference : http://linuxgazette.net/issue79/krishnakumar.html

Could anyone please help in finding out how to display a string just as it is.

Thanks in advance,
Jawahar.

Very simple reason: When you use mov bp,#mymsg you load the pointer to that string into bp. Use MOV BP,[#mymsg] instead. For the looping see PM.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.