hello.asm

来自「FDOS Operating System」· 汇编 代码 · 共 38 行

ASM
38
字号
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Project 			: 	FDOS 0.0.7
;; Author 			: 	Ottonello, Santiago
;; Webpage 			: 	http://www.visual-opal.de
;; Date 			: 	8.8.2003
;; Caption	 		: 	Echo command
;; Function			:   	Echoes given parameter to Standard Output
;; Filename			: 	hello.asm
;; Compile Syntax 		: 	nasm hello.asm -f bin -I FDOS.INC -o hello.bin
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

%include "FDOS.INC"

;-------------------------------------------------------------------------------
; Main Program Begins Here
;-------------------------------------------------------------------------------                                                                                
		BEGPGM				;Load segment register
    		PRTSTR  Welcome			;Print Buffer
		GETPRM	Buffer			;Get Command Line and Store in Buf
		MOV byte [Buffer+255], 00h	;Zero Terminate Buffer,secures Fnc 1
    		PRTSTR  Buffer                  ;Print Buffer
		PRTSTR  Prompt                  ;Print Prompt
		GETSTR	Name                    ;Read Name
		PRTSTR  Greet			;Print Prompt
		PRTSTR  Name                    ;Print Name
   		ENDPGM				;Bye Bye

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;	Data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Buffer		times 255 db 0
Name  		times 255 db 0
Welcome 	db	"Hello I'm the hello world program", 13, 10, \
				"You have passed the following  parameters ...",13,10,0
Prompt		db 13,10,"Please enter your name ...",0
Greet		db 13,10,"Hello ",0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?