Rev 836 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 836 | Rev 1145 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | ; C-equivalent of the following code: |
39 | ; C-equivalent of the following code: |
40 | ; for (;;) |
40 | ; for (;;) |
41 | ; { |
41 | ; { |
42 | ; con_write_asciiz("Enter string (empty for exit): "); |
42 | ; con_write_asciiz("Enter string (empty for exit): "); |
43 | ; con_gets(s,256); |
43 | ; if (!con_gets(s,256)) break; |
44 | ; if (s[0] == '\n') break; |
44 | ; if (s[0] == '\n') break; |
45 | ; con_write_asciiz("You entered: "); |
45 | ; con_write_asciiz("You entered: "); |
46 | ; con_write_asciiz(s); |
46 | ; con_write_asciiz(s); |
47 | ; } |
47 | ; } |
48 | mainloop: |
48 | mainloop: |
49 | push str1 |
49 | push str1 |
50 | call [con_write_asciiz] |
50 | call [con_write_asciiz] |
51 | push 256 |
51 | push 256 |
52 | push s |
52 | push s |
53 | call [con_gets] |
53 | call [con_gets] |
- | 54 | test eax, eax |
|
- | 55 | jz done |
|
54 | cmp [s], 10 |
56 | cmp [s], 10 |
55 | jz done |
57 | jz done |
56 | push str2 |
58 | push str2 |
57 | call [con_write_asciiz] |
59 | call [con_write_asciiz] |
58 | push s |
60 | push s |