flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > mov al,[si]

Author
Thread Post new topic Reply to topic
Just me



Joined: 10 Jun 2006
Posts: 14
Just me 10 Jun 2006, 20:35
Hi all Very Happy
I'am not to sure if this is a bug or not Confused
Code:
format binary
org 0x0000
use16
                        ;;; Set default screen mode [effect clear screen]
                        mov ah,0
                        mov al,3
                        int 0x10
                        mov ax,0x1000
                        cli
                        mov ds,ax
                        mov es,ax
                        sti
                        call DrawScreen
                        jmp $

DrawScreen:             ;;; Display loader title
                        mov ah,2
                        xor bh,bh
                        mov dh,0
                        mov dl,3
                        int 0x10
                        mov di,TitleBar
                        call DisplayString
                        ret

DisplayString:          ;;; Enter with SI ptr to string to display
                        mov al,[si]   ;;; POSSIBLE PROBLEM
                        mov ah,0x0a
                        xor bx,bx
                        mov cx,1
                        int 0x10

ExitDisplayString:      ret

TitleBar:               db 'OS 1 [Build 0001] loader',0x00
    

Now if I put a value directly in the al register it prints, but if not it displays
nothing. The code I have used is pretty much the same as used for
my boot sector. The loader is loaded at [0x1000:0000] and then a jump
made to that location. I just seems a bit wierd that a value used direct works but not if I use a ptr. I have tried other bios routines but with
the same effect!
Any help would be appreciated. Very Happy
Post 10 Jun 2006, 20:35
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8390
Location: Kraków, Poland
Tomasz Grysztar 10 Jun 2006, 20:45
You can check the generated code with some disassembler if you don't trust the assembler. Unless you're really sure of a bug I suggest posting in other forum, more appropriate for your problem ("OS Development" perhaps in this case).
Post 10 Jun 2006, 20:45
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 10 Jun 2006, 21:26
Code:
                        mov di,TitleBar 
                        call DisplayString 
    
Code:
DisplayString:          ;;; Enter with SI ptr to string to display, but you passed it in DI though
                        mov al,[si]   ;;; POSSIBLE PROBLEM
    
Post 10 Jun 2006, 21:26
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.