flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Simple OS Print

Author
Thread Post new topic Reply to topic
Sarge



Joined: 04 Nov 2005
Posts: 14
Location: Australia
Sarge
Hi, im trying to get my test to print "Hello World", when i try it in Virtual PC it works but when i restart the computer and make it boot from A: it only prints "d" the last character. I just started about two days ago and i really need help on this,

Code:
org 0x7c00
use16

start:
                mov ax, 0x0000
                mov ds, ax

                mov ah, 0
                mov al, 3

                mov ah, 9
                mov si, msg
                mov bh, 0

                mov bl, 14
                int 10h

.nextchar:
        lodsb
        or al, al
        jz .return
        int 10h
        jmp .nextchar

.return:
        ret

hang:
        jmp hang

msg: db "hello world", 0

times 510-($-$$) db 0
        dw 0AA55h
    


Thanks,
Sarge
Post 02 Feb 2006, 09:35
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1606
Location: Ukraine
shoorick
you have to read well about function first and pass all valid parameters to it. try to pass valid cx value (=1) each time you call int.
Code:
Expects: AH    09H
         AL    character to write (see ASCII T
               Note: Graphics chars > 127 are
         BH    video page number (0-based)
         BL    text modes:     video attribute
               graphics modes: color number
         CX    repeat count
         
Returns: (none)
         
   Info: This writes a character and attribute
         location.

         This is too slow for most apps.  See

      CX To write just one character, set CX=1    

also it seems you try to set current videomode to 3, but wrong Wink
Post 02 Feb 2006, 09:58
View user's profile Send private message Visit poster's website Reply with quote
Sarge



Joined: 04 Nov 2005
Posts: 14
Location: Australia
Sarge
Thank you very much Shoorick for the information and fast reply.

Thanks,
Sarge
Post 02 Feb 2006, 10:13
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.