forked from KolibriOS/kolibrios
630234432f
git-svn-id: svn://kolibrios.org@109 a494cfbc-eb01-0410-851d-a64ba20cac60
72 lines
1.4 KiB
NASM
72 lines
1.4 KiB
NASM
; Hello, World! - Programm example for CMD shell
|
||
; Compile with FASM for Menuet
|
||
;
|
||
; You must run this program from CMD shell only
|
||
;
|
||
|
||
use32
|
||
|
||
org 0x0
|
||
|
||
db 'MENUET01'
|
||
dd 0x01
|
||
dd START
|
||
dd I_END
|
||
dd 0x100000
|
||
dd 0x7fff0
|
||
dd 0x0
|
||
dd 0x0
|
||
|
||
include "lang.inc"
|
||
include "cmdipc.inc" ; <20>®¤ª«îç¨âì ä ©« CMDIPC.INC
|
||
|
||
START:
|
||
call initipc ; ¨¨æ¨ «¨§¨à®¢ âì ¤«ï à ¡®âë á CMD
|
||
|
||
mov eax,26 ; „«¨ áâப¨
|
||
mov ebx,hello_text ; “ª § ⥫ì áâபã
|
||
call print ; ‚뢥á⨠áâபã
|
||
|
||
again:
|
||
call getkey ; Ž¦¨¤ âì ¦ â¨ï ª« ¢¨è¨ ¨ áç¨â âì ¥¥ ¢ key
|
||
|
||
cmp byte [key],'Y' ; ’ãâ ¯à®£à ¬¬ ¯à®¢¥àï¥â, ¦ â «¨ ã¦. ª« ¢¨è
|
||
je goodday
|
||
cmp byte [key],'y'
|
||
je goodday
|
||
cmp byte [key],'N'
|
||
je goodmorning
|
||
cmp byte [key],'n'
|
||
je goodmorning
|
||
|
||
jmp again ; …᫨ ã¦. ª« ¢¨è ¥ ¦ â , â® áç¨â âì ª« ¢¨èã
|
||
; § ®¢®
|
||
goodday: ; ‚뢥á⨠¯à¨¢¥âá⢨¥ Good Day, World!
|
||
call eol ; <20>யãáâ¨âì áâபã
|
||
|
||
mov eax,16
|
||
mov ebx,text4
|
||
call print
|
||
|
||
call eol ; <20>யãáâ¨âì áâபã
|
||
|
||
jmp endipc ; ‡ ¢¥àè¨âì ¯à®£à ¬¬ã
|
||
|
||
goodmorning: ; ‚뢥á⨠¯à¨¢¥âá⢨¥ Good Morning, World!
|
||
call eol
|
||
|
||
mov eax,20
|
||
mov ebx,text5
|
||
call print
|
||
|
||
call eol
|
||
|
||
jmp endipc ; ‡ ¢¥àé¨âì ¯à®£à ¬¬ã
|
||
|
||
hello_text db 'Is it after 12 noon? [Y\N]?'
|
||
|
||
text4 db 'Good day, World!'
|
||
text5 db 'Good morning, World!'
|
||
|
||
I_END:
|