HLA中的函數及調用

program procedureDemo;

#include ("stdlib.hhf")

static 
    inputString: string;

    procedure sayHelloWorld( hello:string );

        begin sayHelloWorld;

            stdout.put("hello, ", hello, nl);
    
        end sayHelloWorld;

begin procedureDemo;
    
    str.alloc( @size(char) * 80 );
    mov(eax, inputString);


    stdout.put("What's your name: ");

    stdin.readLn();
    stdin.gets( inputString );

    stdin.flushInput();

    sayHelloWorld( inputString ); 

    str.free( inputString );
end procedureDemo;

發佈了212 篇原創文章 · 獲贊 71 · 訪問量 22萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章