Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 1996 06:19:25 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        luigi@labinfo.iet.unipi.it, wpaul@skynet.ctr.columbia.edu
Cc:        hackers@FreeBSD.org, sos@FreeBSD.org
Subject:   Re: splash-page on bootup..
Message-ID:  <199610202019.GAA17009@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>There are a couple of downsides here:
>
>- The logo displayer image would need quite a bit of assembly language
>  code to make it work. Well, hey: life sucks and then you die, okay?
>  Deal with it.

Nah.  life(1) takes only a small amount of assembly language:

---
Article 20377 of comp.lang.asm.x86:
Newsgroups: comp.lang.asm.x86
Path: phaedrus.kralizec.net.au!news.syd.connect.com.au!news.mel.connect.com.au!munnari.OZ.AU!harbinger.cc.monash.edu.au!nntp.coast.net!oleane!jussieu.fr!math.ohio-state.edu!howland.erols.net!mcsun!EU.net!sun4nl!news.eur.encompass.com!Leiden.NL.net!news
From: "Vladislav Kaipetsky" <slavik@pluto.cs.cyco.nl>
Subject: Re: Optimisation contest - 72 bytes
X-Nntp-Posting-Host: pc35.cs.cyco.nl
Message-ID: <01bb9660$b8b02900$63aa4ec1@slavik.cs.cyco.nl>
Sender: news@inter.NL.net (News at newsldn)
Organization: CSD
X-Newsreader: Microsoft Internet News 4.70.1155
References: <Pine.SOL.3.91.960819120646.24509A-100000@granby> <32189ddb.31728668@snews2.zippo.com> <01bb8ee0$1adf9760$63aa4ec1@slavik.cs.cyco.nl> <4victe$1um@texas.nwlink.com> <01bb90f1$aa008720$63aa4ec1@slavik.cs.cyco.nl> <4vkkkm$gfk@texas.nwlink.com> <3222bd61.4745138@snews2.zippo.com> <3222c3c4.6380503@snews2.zippo.com> <50100j$dhh@hermes.louisville.edu> <5046jd$5h1@texas.nwlink.com>
Date: Fri, 30 Aug 1996 10:43:36 GMT
Lines: 74

; Life simulator, 67 bytes  - Vladislav Kaipetsky
; based on 72 bytes version by Tenie Remmel

; It came to me that we don't have to keep
; off-screen field any more.
; This version performs all updates right
; in video memory. It's slow, but it shows
; only current generation (no garbage),
; so IMHO suits the rules.

Ideal
Model Tiny
P386
CodeSeg
Org 100h

Start:
	mov	al,13h		;Set mode 13h
	int	10h

; we don't trust fs == 0 at startup!
	mov	ds,ax		;Seed RNG with clock
	mov	ax,[033Ch]

	push	0A000h		;DS = video memory
	pop	ds
				;BX is already zero
RandLoop:
	add	ax,ax		;Generate random number
	setc	[bx]
	jnc	RandSkip
	xor	al,45
RandSkip:
	dec	bx
	jnz	RandLoop

; BX will not be equal to 3 on the first iteration, but
; it will be for all other times. As SI = 0100h and
; DI = FFFEh on startup, SI - DI will be equal to 258.

LifeLoop:
	xchg	cx,ax
AccLoop:
	add	cl,[di+bx-64]	;Add in this column
	add	cl,[si+bx-2]
	add	cl,[si+bx+318]
	dec	bx		;Loop back
	jnz	AccLoop

	lodsb			;Get center cell, set pixel
	stc			;3 = birth, 4 = stay (tricky):
	rcr	al,cl		; 1.00?0000x --> 0.0x100?00 (rcr 3)
	and	al,20h		; ^carry   |         ^
				;          +---> 0.00x100?0 (rcr 4)
	or	[si-1],al	;Add in new cell     ^
	shr	[byte di-65],5	;Shift previous value

	mov	bl,3		;3 iterations in AccLoop
	inc	di		;Loop while not zero
	jnz	LifeLoop

	mov	ah,1		;Check for key
	int	16h
	jz	LifeLoop	;Loop if no key

	xchg	ax,bx		;Set text mode
	int	10h
	ret			;Return

End Start

;Sincerely,
;Vladislav
---

>- When I tried to turn our second stage boot into a standalone image,
>  I realized that the current boot program actually consumes much of
>  the 64K alotted to it even though it contains such a small amount of
>  actual code. The UFS filesystem groking code creates several large
>  buffers which chew up a lot of the 64K segment. So even though
>  you can take the boot program and make it into a standalone image
>  that doesn't have to worry about the 7k file size limit anymore,
>  I don't think it's possible to graft the logo displayer program
>  onto it...

Actually, it shouldn't take much more space than life(1).  Just put
the screen in 320x200 graphics mode, then load a file on top of the
screen using the read_file() code that I posted recently (plus some
buffering code).  read_file() is required anyway for reading config
files.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610202019.GAA17009>