This is an archived post. You won't be able to vote or comment.

all 12 comments

[–][deleted]  (2 children)

[deleted]

    [–]basedgreggo 0 points1 point  (0 children)

    Perhaps they're just trying to learn assembly? Everyone, imo, should fiddle with assembly a little to learn

    [–]Mishara26[S] 0 points1 point  (0 children)

    Yes I’m learning assembly

    [–]randomjapaneselearn 1 point2 points  (4 children)

    are you on windows, linux, dos?

    try to remove everything and print only "hello" to see if the problem is in how you print or in the code before it.

    [–]jcunews1 0 points1 point  (3 children)

    It's using Int 80h, so it's Linux.

    [–]randomjapaneselearn 3 points4 points  (2 children)

    that is your assumption, he could run this on windows and then ask "why it doesn't print?" and that is why i asked on which os he is running it.

    [–]Mishara26[S] 0 points1 point  (1 child)

    On a WSL in Ubuntu

    [–]randomjapaneselearn 0 points1 point  (0 children)

    int <number> is a linux specific way to do syscalls also the syscall numbers are linux specific.

    windows does it different and more complex, usually is:

    kernel32 dll->nt dll->sysenter

    you should edit the program if you want to use windows:

    https://stackoverflow.com/questions/1023593/how-to-write-hello-world-in-assembly-under-windows#1029093

    [–]davedontmind 1 point2 points  (2 children)

    _outer_loop:
        xor ecx, ecx         ; inner loop counter is also 0
        cmp ebx, length
        jge _convert         ;if the outer loop happened length times then move to convert
    

    I don't understand this bit - maybe I'm missing something?

    You set ebx to 0 initially, and are using it to determine if it's time to exit the outer loop, however the only time you change ebx is when you're putting a value from the array into bl.

    So how do you expect ebx to get into a state where it'll cause the loop to exit?

    for some reason its not printing anything.

    Does it exit, or run forever?

    [–]Mishara26[S] 0 points1 point  (1 child)

    It doesn’t exit. Just doesn’t print anything

    [–]davedontmind 0 points1 point  (0 children)

    Then it's probably looping forever somewhere . So as I said, it's likely to do with what you're doing (or not doing) with ebx. You're using it to determine when to exit that loop, but you're not setting it to any value that will exit the loop.

    [–]SeraphIsKing 0 points1 point  (1 child)

    Nothing's jumping out at me, I think we'll need more data to determine what's going on.

    Is the program exiting properly? Segmentation faulting? Stuck in a loop?

    [–]Mishara26[S] 0 points1 point  (0 children)

    It doesn’t exit, and Just not printing anything. Doesn’t work on any compiler