<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NUL equ 0x00
SETCHAR equ 0x07
VIDEOMEM equ 0xb800
STRINGLEN equ 0xffff

section head align=16 vstart=0
	Size dd ProgramEnd	; 4B 0x00
	SegmentAddr:
	CodeSeg dd section.code.start ;4B 0x04
	DataSeg dd section.data.start ;4B 0x08
	StackSeg dd section.stack.start ;4B 0x0c
	SegmentNum:
	SegNum db (SegmentNum-SegmentAddr)/4 ;æ®µçš„æ€»ä¸ªæ•°ï¼Œ1B 0x10
	Entry dw CodeStart		     ;2B 0x11
		dd section.code.start	     ; 4B 0x13
	
section code align=16 vstart=0
CodeStart:
	mov ax, [DataSeg]
	mov ds, ax
	xor si, si
	call PrintString
	jmp $
PrintString:
	.setup:			;è®¾ç½®ä¸€ä¸ªæ&nbsp;‡å·
	push ax
	push bx
	push cx
	push dx
	mov ax,VIDEOMEM
	mov es,ax
	xor di, di

	mov bh,SETCHAR
	mov cx,STRINGLEN

	.printchar:		;è®¾ç½®æ&nbsp;‡å·
	mov bl,[ds:si]
	inc si
	mov [es:di],bl
	inc di
	mov [es:di],bh
	inc di
	or bl, NUL		;åˆ¤æ–­blæ˜¯å¦ä¸º0ï¼Œå¦‚æžœä¸º0ï¼Œåˆ™zfæ&nbsp;‡å¿—ä½ä¼šè¢«ç½®1
	jz .return		;å¦‚æžœzfä¸º1ï¼Œåˆ™è·³å‡ºå¾ªçŽ¯
	loop .printchar
	.return:
	mov bx, di
	pop dx
	pop cx
	pop bx
	pop ax
	ret


section data align=16 vstart=0
	Hello db 'Hello, I come from program on sector 1, loaded by bootloader!'
	
section stack align=16 vstart=0
	resb 128		;å&nbsp;ç”¨128å­—èŠ‚å¤§å°çš„ç©ºé—´

section end align=16
	ProgramEnd:
</pre></body></html>