Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

Anonymous

unregistriert

21

24.11.2005, 22:35

Es tut gut zu sehen das du auch mal zurückstecken kannst. :rolleyes: ;) :)

Extra für dich. C64 (Die Zeilennummern sind obligatorisch)

10 Print "Hello World"
run

8)

Ok um 23:00 wird gesäubert, geFAQt und getrennt. Ich schliese daher um 23:00 den thread kurz ab.

Anonymous

unregistriert

22

25.11.2005, 02:03

zur vollständigkeit.
ia32

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.data                   # section declaration

msg:
    .string "Hello, world!\n"
    len = . - msg   # length of our dear string

.text                   # section declaration

                        # we must export the entry point to the ELF linker or
    .global _start      # loader. They conventionally recognize _start as their
                        # entry point. Use ld -e foo to override the default.

_start:

# write our string to stdout

    movl    $len,%edx   # third argument: message length
    movl    $msg,%ecx   # second argument: pointer to message to write
    movl    $1,%ebx     # first argument: file handle (stdout)
    movl    $4,%eax     # system call number (sys_write)
    int     $0x80       # call kernel

# and exit

    movl    $0,%ebx     # first argument: exit code
    movl    $1,%eax     # system call number (sys_exit)
    int     $0x80       # call kernel


ppC64

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
data                       # section declaration - variables only

msg:
    .string "Hello, world!\n"
    len = . - msg       # length of our dear string

.text                       # section declaration - begin code

        .global _start
        .section        ".opd","aw"
        .align 3
_start:
        .quad   ._start,.TOC.@tocbase,0
        .previous

        .global  ._start
._start:

# write our string to stdout

    li      0,4         # syscall number (sys_write)
    li      3,1         # first argument: file descriptor (stdout)
                        # second argument: pointer to message to write

    # load the address of 'msg':

                        # load high word into the low word of r4:
    lis 4,msg@highest   # load msg bits 48-63 into r4 bits 16-31
    ori 4,4,msg@higher  # load msg bits 32-47 into r4 bits  0-15

    rldicr  4,4,32,31   # rotate r4's low word into r4's high word

                        # load low word into the low word of r4:
    oris    4,4,msg@h   # load msg bits 16-31 into r4 bits 16-31
    ori     4,4,msg@l   # load msg bits  0-15 into r4 bits  0-15

    # done loading the address of 'msg'

    li      5,len       # third argument: message length
    sc                  # call kernel

# and exit

    li      0,1         # syscall number (sys_exit)
    li      3,1         # first argument: exit code
    sc                  # call kernel


Faul kopiert von
http://www-128.ibm.com

cu