Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
"Hello world" in assembler
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: "Hello world" in assembler

Hybrid View

  1. #1

    "Hello world" in assembler

    Since this was requested, I'll make a little "hello world" program in assembler. Note that it's designed for Nasm. Different compilers have subtle differences in syntax.

    Code:
    SEGMENT .data
    message db "Hello world."   # our message
    db 0Ah
    db 0Dh   # return carriage and line feed
    
    SEGMENT .text
    mov eax,04h   # eax = 4 for system call to write to file
    mov ebx,01h   # file descriptor, in this case 1 for stdout
    mov ecx,message   # address of message
    mov edx,0Eh   # number of bytes long
    int 080h   # call linux
    mov eax,0h   # system call to exit
    int 080h

  2. #2

    Re: "Hello world" in assembler

    is that x86?

  3. #3

    Re: "Hello world" in assembler

    Yes, of course. I only know the x86 and z80 processors and it's definitely not z80 code.

  4. #4
    Mentor
    Join Date
    Jun 2001
    Posts
    1,672

    Re: "Hello world" in assembler

    Yes, of course. I only know the x86 and z80 processors and it's definitely not z80 code.
    Z80, aye? Now that brings back distant memories ... ;D

  5. #5

    Re:

    Here's the same in MIPS assembly:
    Code:
     * .text
     * .globl __start
    __start:
    
     * la * $a0, hello
     * li * $v0, 4
     * syscall
    
     * li * $v0, 10
     * syscall
    
     * .data
    hello: * .asciiz "Hello World!\n"

  6. #6

    Re: "Hello world" in assembler

    Yes, of course. I only know the x86 and z80 processors and it's definitely not z80 code.
    how could i have missed that on your resume


    pretty cool man.

  7. #7

    Re: "Hello world" in assembler

    So you guys have any questions or want any other examples? This one only uses two commands and is kind of dull.

  8. #8

    Re: "Hello world" in assembler

    Where is there a good tutorial on writing assembly for x86 platforms?

  9. #9

    Re: "Hello world" in assembler

    sure - how about moving "Hello World" out through the UART.

  10. #10

    Re: "Hello world" in assembler


    So you guys have any questions or want any other examples? This one only uses two commands and is kind of dull.
    I don't know, maybe I am just a dumb goof, but that looks incredibly hard for such a simple proggy. I need to learn assembly, but it is such a different way of thinking than I am used to...from the looks of it it is obviously going to take a lot of time...

    Aragorn

Similar Threads

  1. "Historic" Open Source Victory - GPL is legally valid and enforcable!
    By beezlebubsbum in forum Linux - General Topics
    Replies: 0
    Last Post: 02-22-2010, 11:33 PM
  2. "MicroHat" "SoftRed"
    By Fatal Error in forum General Chat
    Replies: 0
    Last Post: 05-12-2005, 09:03 PM
  3. "groupadd" and "tree" utilities are nowhere??
    By aromes in forum Redhat / Fedora
    Replies: 1
    Last Post: 10-05-2003, 03:50 AM
  4. error installing packages "krb5-libs" ; AND NVIDIA troubles
    By SaTaNcLaUz in forum Linux - General Topics
    Replies: 23
    Last Post: 11-14-2002, 09:26 PM
  5. Xlib:  extension "GLX" missing on display ":0.0".
    By ph34r in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 12-06-2001, 04:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •