Plan 9 from Bell Labs’s /usr/web/sources/contrib/quanstro/src/realmode/as/hello.s

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


/ init the serial port

	xor	ax, ax
	movb	$0xE3, al	/ 9600N81
	mov	$0, dx
	int	$0x14		/ init port

/ say hello,

	mov	$hello, si
	call	puts

/ si -> null terminated string
puts:
	lodsb
	cmpb	$0, al
	jes	1f
	call	putc
	jmp	puts
1:
	ret

putc:	// write the char in al to both video and serial
	push	dx
	push	cx
	push	bx
	push	ax
	
/ write to video
	push	si
	push	ax
	mov	$7, bx
	movb	$0xe, ah
	int	$0x10
	
/ write to serial port
	pop	ax
	movb	$1, ah
	xor	dx, dx
	int	$0x14
	pop	si

	pop	ax
	pop	bx
	pop	cx
	pop	dx
	ret

hello:
	<\r\n\nCoraid sez hello\r\n\0>

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].