All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tu Ha <httu@tma.com.vn>
To: linux-assembly@vger.kernel.org
Subject: please help me
Date: 24 Apr 2006 06:11:31 -0400	[thread overview]
Message-ID: <1145873491.3998.17.camel@gaucon> (raw)

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.


             reply	other threads:[~2006-04-24 10:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24 10:11 Tu Ha [this message]
2006-04-24  4:11 ` please help me Frank Kotler
2006-04-24 12:09   ` Tu Ha
  -- strict thread matches above, loose matches on Subject: below --
2014-09-10 12:01 Please Help Me Alina Yukov
2014-08-20 15:53 PLEASE HELP ME Abdoul Issouf
2014-08-20 15:20 mrissouf issouf
2011-11-26  6:49 Please help me shibin k reeny
2009-12-21  9:15 please " rajkumar
2009-12-21 10:48 ` Emmanuel Florac
2007-01-05  8:01 Please " Debasree Mallick
2007-01-05  8:04 ` Justin Patrin
2007-01-05  8:14   ` Debasree Mallick
2007-01-05  8:43     ` Matthew Palmer
2007-01-05  8:54       ` Marcin Juszkiewicz
2007-01-10  7:13       ` Debasree Mallick
2007-01-11  0:17         ` Justin Patrin
2006-08-28 12:30 Kumar, Satish B
2006-08-28 14:30 ` Mouhammad Tayseer Alquoatli
     [not found] <000101c6734a$573086d0$c41e1ec7@TuThuyHa>
2006-05-09 16:17 ` please " Frank Kotler
2006-05-10 14:05   ` httu
2004-03-30  9:48 Sofia Pujeh
2003-09-19  8:55 Vijay Angelo
2003-09-19  9:45 ` Arvanitis Kostas
1999-12-31  2:29 Please " dony
1999-12-27  8:42 ` Raphael Bossek
2000-01-02  7:23   ` dony
1999-12-30  2:11 ` Brendan J Simon
     [not found]   ` <38701F3A.FAD6263E@huawei.com.cn>
1999-12-30  4:23     ` Brendan J Simon
     [not found]       ` <38704D0B.94438516@huawei.com.cn>
1999-12-30  6:46         ` Brendan J Simon
1999-12-30 13:25           ` Charles Lepple
     [not found] ` <000401bf5016$4757c420$0201a8c0@home>
1999-12-31  8:37   ` dony
     [not found]     ` <000c01bf5086$3e358d80$0201a8c0@home>
2000-01-01  1:58       ` dony
     [not found]         ` <001801bf50e1$6d3ad8a0$0201a8c0@home>
2000-01-01  8:46           ` dony
1999-12-31  8:40   ` dony

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1145873491.3998.17.camel@gaucon \
    --to=httu@tma.com.vn \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.