home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
messroms.de
/
2007-01-13_www.messroms.de.zip
/
VZ200
/
TOOLS
/
ZCCSRC.ZIP
/
demo.asm
next >
Wrap
Assembly Source File
|
2000-03-08
|
4KB
|
360 lines
; Small C z80;
; Coder (2.5,00/03/03)
; Front End (2.7,84/11/28)
.globl .gchar,.gint,.pchar,.pint,.bool
.globl .sxt
.globl .or,.and,.xor
.globl .eq,.ne,.gt,.le,.ge,.lt,.uge,.ult,.ugt,.ule
.globl .asr,.asl
.globl .sub,.neg,.com,.lneg,.mul,.div,.mod
.globl .case
.module demo.i
.area _CODE
main:
push ix
ld ix, #0
add ix, sp
push bc
push bc
ld hl,#28672
push hl
ld a,#1
call setbase
pop bc
ld hl,#0
push hl
ld a,#1
call mode
pop bc
ld hl,#.0+0
push hl
ld hl,#12 ;6(ix) [argc]
add hl,sp
call .gint
push hl
ld a,#2
call printf
pop bc
pop bc
ld hl,#.0+13
push hl
ld hl,#10 ;4(ix) [argv]
add hl,sp
call .gint
push hl
ld hl,#0
add hl,hl
pop de
add hl,de
call .gint
push hl
ld a,#2
call printf
pop bc
pop bc
ld hl,#.0+26
push hl
ld a,#1
call printf
pop bc
ld a,#0
call getch
.2:
ld a,#0
call inch
ld a,h
or l
j z,.3
j .2
.3:
ld hl,#0
push hl
ld a,#1
call rand
pop bc
ld hl,#2 ;-2(ix) [i]
add hl,sp
push hl
ld hl,#1
pop de
call .pint
.4:
ld hl,#2 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#50
pop de
call .lt
ld a,h
or l
j nz,.6
j .7
.5:
ld hl,#2 ;-2(ix) [i]
add hl,sp
push hl
call .gint
inc hl
pop de
call .pint
dec hl
j .4
.6:
ld hl,#0 ;-4(ix) [j]
add hl,sp
push hl
ld hl,#10000
push hl
ld a,#1
call rand
pop bc
pop de
call .pint
ld hl,#.0+57
push hl
ld hl,#2 ;-4(ix) [j]
add hl,sp
call .gint
push hl
ld hl,#4 ;-4(ix) [j]
add hl,sp
call .gint
push hl
ld a,#1
call sqrt
pop bc
push hl
ld a,#3
call printf
pop bc
pop bc
pop bc
j .5
.7:
ld hl,#.0+26
push hl
ld a,#1
call printf
pop bc
ld a,#0
call getch
.8:
ld a,#0
call inch
ld a,h
or l
j z,.9
j .8
.9:
ld hl,#1
push hl
ld a,#1
call mode
pop bc
ld hl,#2 ;-2(ix) [i]
add hl,sp
push hl
ld hl,#0
pop de
call .pint
.10:
ld hl,#2 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#128
pop de
call .lt
ld a,h
or l
j nz,.12
j .13
.11:
ld hl,#2 ;-2(ix) [i]
add hl,sp
push hl
call .gint
inc hl
pop de
call .pint
dec hl
j .10
.12:
ld hl,#2 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#0
push hl
ld hl,#127
push hl
ld hl,#8 ;-2(ix) [i]
add hl,sp
call .gint
pop de
call .sub
push hl
ld hl,#63
push hl
ld hl,#10 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#3
pop de
call .and
push hl
ld a,#5
call line
ex de,hl
ld hl,#10
add hl,sp
ld sp,hl
ex de,hl
ld hl,#2 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#1
pop de
add hl,de
push hl
ld hl,#8
push hl
ld a,#2
call sound
pop bc
pop bc
j .11
.13:
ld hl,#1
push hl
ld a,#1
call bgrd
pop bc
ld hl,#2 ;-2(ix) [i]
add hl,sp
push hl
ld hl,#0
pop de
call .pint
.14:
ld hl,#2 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#64
pop de
call .lt
ld a,h
or l
j nz,.16
j .17
.15:
ld hl,#2 ;-2(ix) [i]
add hl,sp
push hl
call .gint
inc hl
pop de
call .pint
dec hl
j .14
.16:
ld hl,#0
push hl
ld hl,#4 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#127
push hl
ld hl,#63
push hl
ld hl,#10 ;-2(ix) [i]
add hl,sp
call .gint
pop de
call .sub
push hl
ld hl,#10 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#3
pop de
call .and
push hl
ld a,#5
call line
ex de,hl
ld hl,#10
add hl,sp
ld sp,hl
ex de,hl
ld hl,#2 ;-2(ix) [i]
add hl,sp
call .gint
push hl
ld hl,#1
pop de
add hl,de
push hl
ld hl,#6
push hl
ld a,#2
call sound
pop bc
pop bc
j .15
.17:
ld a,#0
call getch
ld hl,#0
push hl
ld a,#1
call mode
pop bc
ld hl,#0
push hl
ld a,#1
call bgrd
pop bc
ld hl,#0
j .1
.1:
pop bc
pop bc
pop ix
ret
.area _DATA
.0: .db 65,82,71,67,32,32,32,58
.db 32,37,117,10,0,65,82,71
.db 86,91,48,93,58,32,37,115
.db 10,0,45,32,80,82,69,83
.db 83,32,65,78,89,32,75,69
.db 89,32,84,79,32,67,79,78
.db 84,73,78,85,69,32,45,10
.db 0,83,81,82,84,40,37,100
.db 41,32,61,32,37,100,10,0
.area _BSS
.globl etext
.globl edata
.globl main
.globl setbase
.globl mode
.globl printf
.globl getch
.globl inch
.globl rand
.globl sqrt
.globl line
.globl sound
.globl bgrd
;0 error(s) in compilation
; Literal pool:72
; Global pool :416
; Macro pool :36