0

I have a table of 20 counts. How can I get a value "20" and display on console?

section .text
global _start

_start:
        mov     eax,4
        mov     ebx,1
        mov     ecx,length
        mov     edx,[length]

        mov     eax,1
        int     80h

section .data
variable times 20  db      0
length  dd $-variable

I thought about something like upper, but it doesn't work.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Plusce
  • 117
  • 2
  • 14
  • 1
    [Convert the number to a string](http://stackoverflow.com/questions/25064565/a-should-be-simple-program-with-nasm-doesntt-work/25065047#25065047), then print the string. – Michael Jan 14 '15 at 10:31
  • OK, thank you man. I will use it. – Plusce Jan 20 '15 at 12:52

1 Answers1

0

At least call the function prior to exiting!

mov     eax,4
mov     ebx,1
mov     ecx,length
mov     edx,[length]
int     80h    ; <== Forgotten
mov     eax,1
int     80h
Fifoernik
  • 9,779
  • 1
  • 21
  • 27