mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-24 07:36:48 +03:00
de447bcec4
git-svn-id: svn://kolibrios.org@3497 a494cfbc-eb01-0410-851d-a64ba20cac60
71 lines
1.5 KiB
NASM
71 lines
1.5 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 "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:
|