kolibrios/programs/other/outdated/cmd/trunk/examples/HELLO.ASM

71 lines
1.5 KiB
NASM
Raw Normal View History

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