fork download
  1. .section .data
  2. anzahl: .long 0x0
  3. text: .ascii "Hello World!"
  4. counter: .byte 0x0
  5. .section .text
  6. .globl _start
  7. _start:
  8. # Wie oft soll <text> ausgegeben werden?
  9. movl $3, %eax
  10. movl $0, %ebx
  11. movl $anzahl, %ecx
  12. movl $2, %edx
  13. int $0x80
  14. # <counter> wird später mit der Benutzereingabe verglichen.
  15. # Aus diesem Grund wird er mit dem ASCII-Wert für 1
  16. # (Hexadezimal 0x31) initialisiert.
  17. movb $0x31, (counter)
  18. loop_begin:
  19. # Nun vergleich wir den
  20. # Benutzer eingegebenen
  21. movl $0, %eax
  22. movb (counter), %bh
  23. cmpb anzahl(, %eax, 1),
  24. # Größer? Dann beenden,
  25. jg exit
  26. Zählerstand (<counter>) mit der vom
  27. Zahl.
  28. %bh
  29. <text> wurde oft genug ausgegeben.
  30. # Andernfalls geben wir <text> aus...
  31. movl $4, %eax
  32. movl $1, %ebx
  33. movl $text, %ecx
  34. movl $13, %ecx
  35. int $0x80
  36. # ...inkremieren den counter...
  37. movb (counter), %ah
  38. inc %ah
  39. movb %ah, (counter)
  40. # ... und springen wieder zum Schleifenbeginn.
  41. jmp loop_begin
  42. movl $1, %eax
  43. movl $0, %ebx
  44. int $0x80
  45.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.s: Assembler messages:
prog.s:23: Error: expecting operand after ','; got nothing
prog.s:26: Error: invalid character (0xc3) in mnemonic
prog.s:27: Error: no such instruction: `zahl.'
prog.s:28: Error: junk at end of line, first unrecognized character is `%'
prog.s:29: Error: junk at end of line, first unrecognized character is `<'
stdout
Standard output is empty