
;;; gcc for m6809 : Apr  3 2025 06:14:16
;;; 4.6.4 (gcc6809lw pl9)
;;; ABI version 1
;;; -mint16
	.module	life.c

	.area	.text
_ComputeLife:
	pshs	y,u
	leas	-22,s
	stx	12,s
	ldx	28,s
	stx	16,s
	ldy	#0
	jmp	L2
L6:
	ldu	6,s
	leax	-1,u
	tfr	x,d
	anda	#0
	andb	#63
	aslb
	rola
	aslb
	rola
	aslb
	rola
	aslb
	rola
	aslb
	rola
	std	2,s
	ldd	12,s
	addd	2,s
	std	,s
	leax	-1,y
	tfr	x,d
	anda	#0
	andb	#31
	std	2,s
	leax	1,y
	stx	14,s
	tfr	x,d
	anda	#0
	andb	#31
	std	10,s
	ldd	8,s
	addd	12,s
	std	18,s
	tfr	u,d
	addd	#1
	std	6,s
	anda	#0
	andb	#63
	aslb
	rola
	aslb
	rola
	aslb
	rola
	aslb
	rola
	aslb
	rola
	tfr	d,u
	ldd	12,s
	leax	d,u
	tfr	x,d
	leau	d,y
	stu	4,s
	ldd	,s
	leau	d,y
	stu	20,s
	ldu	4,s
	ldb	,u
	ldu	20,s
	addb	,u
	stb	20,s
	ldd	2,s
	addd	,s
	tfr	d,u
	ldb	20,s
	addb	,u
	ldu	,s
	exg	d,u
	addd	10,s
	exg	d,u
	addb	,u
	ldu	18,s
	exg	d,u
	addd	2,s
	exg	d,u
	addb	,u
	ldu	18,s
	exg	d,u
	addd	10,s
	exg	d,u
	addb	,u
	stb	20,s
	ldd	2,s
	leau	d,x
	ldb	20,s
	addb	,u
	stb	20,s
	ldd	10,s
	leau	d,x
	ldb	20,s
	addb	,u
	stb	20,s
	ldd	12,s
	leau	d,y
	ldd	8,s
	leau	d,u
	stu	2,s
	ldd	16,s
	ldu	8,s
	leax	d,u
	ldu	2,s
	ldb	,u
	beq	L3
	ldb	20,s
	addb	#-2
	stb	10,s
	ldb	#1
	stb	2,s
	ldb	10,s
	cmpb	#1	;cmpqi:
	bls	L4
	clr	2,s
L4:
	ldb	2,s
	stb	,x
	bra	L5
L3:
	ldb	20,s
	eorb	#3
	clra		;zero_extendqihi: R:b -> R:d
	std	2,s
	addd	#-1
	tfr	a,b
	clra		;zero_extendqihi: R:b -> R:d
	rolb
	rolb
	andb	#1
	stb	,x	;movlsbqihi: R:d -> ,x
L5:
	ldd	8,s
	addd	#32
	std	8,s
	ldd	6,s
	cmpd	#64	;cmphi:
	lbne	L6
	ldd	16,s
	addd	#1
	std	16,s
	ldx	14,s
	cmpx	#32	;cmphi:
	beq	L1
	leay	,x
L2:
	ldd	#0
	std	8,s
	std	6,s
	jmp	L6
L1:
	leas	22,s
	puls	y,u,pc
_DisplayLife:
	pshs	y,u
	leas	-7,s
	stx	5,s
	ldd	#0
	std	3,s
	ldy	#15872
	jmp	L10
L15:
	ldb	#35
	stb	,x
	ldb	#-120
	stb	,s
	ldb	,u
	bne	L11
	ldb	#-128
	stb	,s
L11:
	ldb	32,u
	beq	L12
	ldb	,s
	addb	#4
	stb	,s
L12:
	ldb	1,u
	beq	L13
	ldb	,s
	addb	#2
	stb	,s
L13:
	ldb	33,u
	beq	L14
	inc	,s
L14:
	ldb	,s
	stb	,x+
	ldd	1,s
	addd	#-1
	std	1,s
	leau	64,u
	cmpd	#0	;cmphi:
	bne	L15
	leay	32,y
	ldd	3,s
	addd	#2
	std	3,s
	cmpy	#16384	;cmphi:
	beq	L9
L10:
	ldd	5,s
	ldx	3,s
	leau	d,x
	leax	,y
	ldd	#32
	std	1,s
	jmp	L15
L9:
	leas	7,s
	puls	y,u,pc
_loop:
	pshs	u
	ldx	#_board
	jsr	_DisplayLife
	ldu	#_board+2048
	pshs	u
	ldx	#_board
	jsr	_ComputeLife
	inc	_generation+1
	bne	__IL294
	inc	_generation
	__IL294:
	leax	,u
	jsr	_DisplayLife
	ldx	#_board
	stx	,--s
	leax	,u
	jsr	_ComputeLife
	inc	_generation+1
	bne	__IL302
	inc	_generation
	__IL302:
	leas	4,s
	puls	u,pc
LC0:
	.ascii "hello life\0"

	.area	.text.startup

	.globl	_main
_main:
	pshs	y,u
	leas	-7,s
;----- asm -----
;  5 "../nekot1/game_postlude.h" 1
	.globl __n1pre_entry
;--- end asm ---
	ldx	#__n1pre_entry
	stx	0
;----- asm -----
;  8 "../nekot1/game_postlude.h" 1
	.globl __n1pre_final
;--- end asm ---
	ldx	#__n1pre_final
	stx	0
;----- asm -----
;  11 "../nekot1/game_postlude.h" 1
	.globl __n1pre_final_startup
;--- end asm ---
	ldx	#__n1pre_final_startup
	stx	0
	ldb	#1
	ldx	#15872
	jsr	_gTextScreen
	ldx	#LC0
	jsr	_gNetworkLog
	ldu	#_board
	ldd	#0
	std	1,s
	bra	L21
L22:
	tfr	u,d
	leay	d,x
	clr	2048,y
	clr	,y
	leax	32,x
	cmpx	#2048	;cmphi:
	bne	L22
	ldd	1,s
	addd	#1
	std	1,s
	leau	1,u
	cmpd	#32	;cmphi:
	lbeq	L29
L21:
	ldx	#0
	bra	L22
L27:
	ldd	3,s
	stb	5,s	;movlsbqihi: R:d -> 5,s
	tfr	y,d	;movlsbqihi: R:y -> R:b
	andb	5,s
	stb	5,s
	ldb	_gReal+1
	addb	_gReal
	stb	1,s
	ldb	_gReal+3	;movlsbqihi: msb:_gReal+2 -> R:b
	addb	1,s
	stb	1,s
	ldx	#8
	ldb	#1
	stb	,s
L25:
	ldb	,s
	andb	5,s
	beq	L24
	inc	1,s
L24:
	asl	,s
	leax	-1,x
	cmpx	#0	;cmphi:
	bne	L25
	ldb	1,s
	clra		;zero_extendqihi: R:b -> R:d
	std	1,s
	anda	#0
	andb	#3
	tfr	d,x
	cmpx	#1	;cmphi:
	bne	L26
	leau	_board,y
	ldd	3,s
	aslb
	rola
	aslb
	rola
	aslb
	rola
	aslb
	rola
	aslb
	rola
	std	1,s
	leau	d,u
	tfr	x,d
	stb	,u	;movlsbqihi: R:d -> ,u
L26:
	ldd	3,s
	addd	#1
	std	3,s
	cmpd	#48	;cmphi:
	lbne	L27
	leay	1,y
	cmpy	#24	;cmphi:
	bne	L23
	bra	L33
L29:
	ldy	#2
L23:
	ldd	#2
	std	3,s
	jmp	L27
L33:
	ldx	#__n1pre_final_startup
	stx	,--s
	ldx	#__n1pre_final
	stx	,--s
	ldx	#_loop
	jsr	_xAfterSetup
	ldx	#0
	leas	11,s
	puls	y,u,pc

	.area	.bss
_generation:	.blkb	2

	.area	.data
_TRUE:
	.byte	1

	.area	.text.entry
__n1pre_entry:
	.byte	126
	.word	_main

	.area	.final
__n1pre_final:
	.word	-20754

	.area	.final.setup
__n1pre_final_startup:
	.word	-20753

	.area	.data.more
_board:
	zmb	4096	;skip space
  .area .absolute
  .globl  _gAlloc64
_gAlloc64            EQU  $0BDC
  .globl  _gConfig
_gConfig             EQU  $0607
  .globl  _gFatal
_gFatal              EQU  $0ABC
  .globl  _gFatalFIRQ
_gFatalFIRQ          EQU  $0B5F
  .globl  _gFatalNMI
_gFatalNMI           EQU  $0B75
  .globl  _gFatalSWI1
_gFatalSWI1          EQU  $0BB9
  .globl  _gFatalSWI2
_gFatalSWI2          EQU  $0BA3
  .globl  _gFatalSWI3
_gFatalSWI3          EQU  $0B8C
  .globl  _gFree64
_gFree64             EQU  $07AC
  .globl  _gIrqRestore
_gIrqRestore         EQU  $07A1
  .globl  _gIrqSaveAndDisable
_gIrqSaveAndDisable  EQU  $0794
  .globl  _gKern
_gKern               EQU  $0048
  .globl  _gModeScreen
_gModeScreen         EQU  $0A85
  .globl  _gNetworkLog
_gNetworkLog         EQU  $0DBD
  .globl  _gPMode1Screen
_gPMode1Screen       EQU  $0A6A
  .globl  _gReal
_gReal               EQU  $0022
  .globl  _gReceiveCast64
_gReceiveCast64      EQU  $084B
  .globl  _gScore
_gScore              EQU  $060B
  .globl  _gSendCast
_gSendCast           EQU  $0DF0
  .globl  _gTextScreen
_gTextScreen         EQU  $09A8
  .globl  _gWall
_gWall               EQU  $0026
  .globl  _memcpy
_memcpy              EQU  $08C1
  .globl  _memcpy_words
_memcpy_words        EQU  $0868
  .globl  _memset
_memset              EQU  $089B
  .globl  _memset_words
_memset_words        EQU  $0880
  .globl  _strlen
_strlen              EQU  $08E3
  .globl  _xAfterSetup
_xAfterSetup         EQU  $07CC
  .globl  _xSendControlPacket
_xSendControlPacket  EQU  $0DD6
