files
kolibrios-gitea/programs/develop/examples/hello/hello.asm
Andrew 396ea0f059 develop/examples/hello: Post-SVN tidy
- Move source code from `trunk` into program root directory.
- Update build files and ASM include paths.
2025-05-23 00:18:50 +01:00

78 lines
1.5 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.

; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
; Hello, World! - Programm example for CMD shell
; Compile with FASM
;
; 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: