linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* please help me
@ 2006-04-24 10:11 Tu Ha
  2006-04-24  4:11 ` Frank Kotler
  0 siblings, 1 reply; 5+ messages in thread
From: Tu Ha @ 2006-04-24 10:11 UTC (permalink / raw)
  To: linux-assembly

Hi,
I am a beginner writing a boot loader. I use gas to write it and got a
weird issue. The following code just try to show out the screen the
symbol "1" ten times

.code16
.section .text
.globl _start
_start:
        movw    $STACK_SEGMENT, %sp
        movw    %sp, %ss
        movw    $STACK_SIZE, %sp
        pushw   %cs
        popw    %ds
        pushw   $SCREEN_SEGMENT
        popw    %es
        jmp     show_banner
 
show_banner:
        movb    $0x07, %ah #white on black
        movb    char, %al  #show this char
        movw    $10,  %cx  #show this char 10 times
        movw    $0, %di    #show at 0,0
run_banner:
        movw    %ax, %es:(%di)
        inc     %di
        inc     %di
        loop    run_banner
 
die:    jmp     die
 
#.section .data
char:   .ascii "1"
.org 510
boot_flag:      .word 0xAA55
                                                                                                                             
#constants
.equ STACK_SEGMENT     , 0x9000      # Top of conventional memory
.equ STACK_SIZE        , 0xffff      # 64K - 1 bytes of stack
.equ SCREEN_SEGMENT    , 0xb800



However, when running, it shows out a symbol in the extend ascii table
instead of "1" !!!?
It seems I cannot reference to the "char" memory location. Why?

How can I debug the binary?

Any help is appreciated.

Tuha.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-05-10 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <000101c6734a$573086d0$c41e1ec7@TuThuyHa>
2006-05-09 16:17 ` please help me Frank Kotler
2006-05-10 14:05   ` httu
2006-04-24 10:11 Tu Ha
2006-04-24  4:11 ` Frank Kotler
2006-04-24 12:09   ` Tu Ha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).