forked from KolibriOS/kolibrios
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><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> CMDIPC.INC
|
|||
|
|
|||
|
START:
|
|||
|
call initipc ; <20><><EFBFBD>樠<EFBFBD><E6A8A0><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> CMD
|
|||
|
|
|||
|
mov eax,26 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|||
|
mov ebx,hello_text ; <20><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><>ப<EFBFBD>
|
|||
|
call print ; <20>뢥<EFBFBD><EBA2A5><EFBFBD> <20><>ப<EFBFBD>
|
|||
|
|
|||
|
again:
|
|||
|
call getkey ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> key
|
|||
|
|
|||
|
cmp byte [key],'Y' ; <20><><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>㦭. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
je goodday
|
|||
|
cmp byte [key],'y'
|
|||
|
je goodday
|
|||
|
cmp byte [key],'N'
|
|||
|
je goodmorning
|
|||
|
cmp byte [key],'n'
|
|||
|
je goodmorning
|
|||
|
|
|||
|
jmp again ; <20> <20>㦭. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
goodday: ; <20>뢥<EFBFBD><EBA2A5><EFBFBD> <20>ਢ<EFBFBD><E0A8A2><EFBFBD>⢨<EFBFBD> Good Day, World!
|
|||
|
call eol ; <20>ய<EFBFBD><E0AEAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|||
|
|
|||
|
mov eax,16
|
|||
|
mov ebx,text4
|
|||
|
call print
|
|||
|
|
|||
|
call eol ; <20>ய<EFBFBD><E0AEAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|||
|
|
|||
|
jmp endipc ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
|||
|
|
|||
|
goodmorning: ; <20>뢥<EFBFBD><EBA2A5><EFBFBD> <20>ਢ<EFBFBD><E0A8A2><EFBFBD>⢨<EFBFBD> Good Morning, World!
|
|||
|
call eol
|
|||
|
|
|||
|
mov eax,20
|
|||
|
mov ebx,text5
|
|||
|
call print
|
|||
|
|
|||
|
call eol
|
|||
|
|
|||
|
jmp endipc ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
|||
|
|
|||
|
hello_text db 'Is it after 12 noon? [Y\N]?'
|
|||
|
|
|||
|
text4 db 'Good day, World!'
|
|||
|
text5 db 'Good morning, World!'
|
|||
|
|
|||
|
I_END:
|