kolibrios-gitea/programs/hello/trunk/hello.asm
Andrey Halyavin (halyavin) 065b8d32b2 programs sources added
git-svn-id: svn://kolibrios.org@31 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-01-03 09:43:31 +00:00

72 lines
1.4 KiB
NASM
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

; 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: