inicio mail me! sindicaci;ón

Tomasz Wysocki - dziennik internetowy

Otchłań mojego umysłu…

Hello world!

My “Hello world!” in assembler language:
section .text                   ; program section

global _start                   ; ld is reported about _start

_start:                         ; from this label program starts

        mov eax, 4              ; 4 - write command
        mov ebx, 1              ; 1 - stdout
        mov ecx, hello          ; hello - our text
        mov edx, size           ; size - text size
        int 0x80                ; 0x80 - system call

        mov eax, 1              ; 1 - exit command
        mov ebx, 0              ; 0 - program exit state
        int 0x80                ; 0x80 - system call




section .data                   ; data section
        hello db 'Hello, world!', 0x0a ; our text
        size equ $ - hello      ; text size ([current address] - [text address])
I may write something more interesting soon.
Moje “Hello world!” w assemblerze:
section .text                   ; sekcja programu

global _start                   ; informuje ld o _start

_start:                         ; etykieta wykonywana na starcie programu

        mov eax, 4              ; 4 - polecenie write
        mov ebx, 1              ; 1 - stdout
        mov ecx, hello          ; hello - nasz tekst
        mov edx, size           ; size - dlugość tekstu
        int 0x80                ; 0x80 - wywołanie przerywania systemowego

        mov eax, 1              ; 1 - polecenie exit
        mov ebx, 0              ; 0 - status poprawnego zakończenia programu
        int 0x80                ; 0x80 - wywołanie przerywania systemowego




section .data                   ; sekcja danych
        hello db 'Hello, world!', 0x0a ; nasz napis
        size equ $ - hello      ; długość napisu ([aktualny adres] - [adres napisu])
Niedługo postaram się umieścić coś ciekawszego.

1 komentarz »

  yoshi314 wrote @ wrzesień 22nd, 2006 at 5:38 pm

http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html

zobacz to, moze cie natchnie :]

Dodaj komentarz

Zostaw puste:

HTML-Tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>