summaryrefslogtreecommitdiff
path: root/frontends/calculator/CEdev/examples/random/obj/main.src
blob: 9aa4a54c9e5eb64db6d781af7e5d850fa6ea42d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
; Zilog eZ80 ANSI C Compiler Release 3.4
; -optsize -noreduceopt -nomodsect -peephole -globalopt
; -localcse -const=ROM 
	FILE	"SRC\MAIN.C"
	.assume ADL=1
	SEGMENT CODE
;    1	#include <stdbool.h>
;    2	#include <stddef.h>
;    3	#include <stdint.h>
;    4	#include <tice.h>
;    5	
;    6	#include <stdio.h>
;    7	#include <stdlib.h>
;    8	#include <string.h>
;    9	
;   10	void main(void) {
_main:
	LD	HL,-3
	CALL	__frameset
;   11	    /* Fill VRAM with random data */
;   12	    uint32_t *lcd_Ram_i, *lcd_Ram_end = (uint32_t *) ((int) lcd_Ram + LCD_SIZE);
;   13	    for (lcd_Ram_i = (uint32_t *) lcd_Ram; lcd_Ram_i < lcd_Ram_end; lcd_Ram_i++) {
	LD	BC,13893632
	LD	(IX+-3),BC
	JR	L_3
L_1:
;   14	        *lcd_Ram_i = random();
	CALL	_random
	LD	IY,(IX+-3)
	LD	(IY),HL
	LD	(IY+3),E
	LEA	IY,IY+4
	LD	(IX+-3),IY
;   15	    }
L_3:
	LD	BC,14047232
	LD	HL,(IX+-3)
	OR	A,A
	SBC	HL,BC
	JR	C,L_1
;   16	
;   17	    /* Wait for a key press */
;   18	    while (!os_GetCSC());
L_5:
	CALL	_os_GetCSC
	OR	A,A
	JR	Z,L_5
;   19	}
	LD	SP,IX
	POP	IX
	RET	


;**************************** _main ***************************
;Name                         Addr/Register   Size   Type
;_os_GetCSC                          IMPORT  -----   function
;_random                             IMPORT  -----   function
;lcd_Ram_i                             IX-3      3   variable


; Stack Frame Size: 9 (bytes)
;       Spill Code: 0 (instruction)


	XREF _os_GetCSC:ROM
	XREF _random:ROM
	XREF __frameset:ROM
	XDEF _main
	END