-tail_em.a
+libem_s.a
aaru.s
aar.s
aar2.s
# $Header$
-install:
- ../../install tail_em.a tail_em
- ../../install tail.s end_em
+MACH=z80
+all: libem_o.a end.o
-cmp:
- -../../compare tail_em.a tail_em
- -../../compare tail.s end_em
+install: all
+ ../../install end.o end_em
+ ../../install libem_o.a tail_em
-clean :
+
+cmp: all
+ -../../compare end.o end_em
+ -../../compare libem_o.a tail_em
+
+libem_o.a: libem_s.a
+ ASAR=aal ; export ASAR ;\
+ march . libem_o.a
+
+end.o: end.s
+ $(MACH) -I../../../h -c end.s
+
+clean:
+ rm -f *.o libem_o.a
opr :
- make pr | opr
+ make pr | opr
pr:
- @arch pv tail_em.a | pr -h `pwd`/tail_em.a
- @pr `pwd`/tail.s
+ @pr `pwd`/end.s
+ @arch pv libem_s.a | pr -h `pwd`/libem_s.a
.define .aar
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! use .mli2
! 2-byte descriptor elements
.define .aar2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! special case aar: element size = 2 (statically known)
! parameters:
.define .aaru
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! AAR NOT DEFINED
.define .and
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! auxiliary size 'and'
! parameters:
.define .cii
+.define .cuu
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! cii: convert integer to integer
! parameters:
-.define .cuu
! cuu: convert unsigned to unsigned
! parameters:
.define .cms
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! any size sets
! parameters:
.define .cmu
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! parameters:
! hl : size (#bytes)
.define .cmu4
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! 4 byte cmu and cmi routine
! parameters:
inc hl
ld sp,hl
jp (ix)
-.data
-savesp: .word 0
+.sect .data
+savesp: .data2 0
.define .csa
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! this is not a subroutine, but just a
! piece of code that computes the jump-
.define .csb
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! this is not a subroutine, but just a
! piece of code that computes the jump-
.define .dvi2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! 16-bit signed division
! parameters:
.define .dvi4
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! 4-byte divide routine for z80
! parameters:
push bc
push de
jp (ix)
-.data
- .flag1: .byte 0
- .flag2: .byte 0
- retaddr:.word 0
- .savebc: .word 0
- .savede: .word 0
+.sect .data
+ .flag1: .data1 0
+ .flag2: .data1 0
+ retaddr:.data2 0
+ .savebc: .data2 0
+ .savede: .data2 0
.define .dvu2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! 16-bit divide
! parameters:
.define .dvu4
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! 4-byte divide routine for z80
! parameters:
ld hl,(.retaddr)
jp (hl) ! return
-.data
-.flag: .byte 0
-.low: .word 0
-.iysave: .word 0
-.retaddr: .word 0
-.result: .word 0
+.sect .data
+.flag: .data1 0
+.low: .data2 0
+.iysave: .data2 0
+.retaddr: .data2 0
+.result: .data2 0
+.sect .text; .sect .rom; .sect .data; .sect .bss
.define endtext,enddata,endbss
.define _end,_etext,_edata
- .text
+ ! $Header$
+ .sect .text
endtext:
_etext:
.align 2
- .data
+ .sect .data
enddata:
_edata:
.align 2
- .bss
+.sect .endsect
_end:
endbss:
.align 2
.define .exg
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
.exg:
pop ix
pop de
.define .gto
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
.gto:
ld e,(hl)
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
loop = 100
dvi4:
xor a
push hl
push de
jp (iy)
-.data
- .flag1: .byte 0
- .flag2: .byte 0
+.sect .data
+ .flag1: .data1 0
+ .flag2: .data1 0
.define .inn
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! use .unimpld
! any size sets
.define .ior
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! auxiliary size 'ior'
! parameters:
.define .lar
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! use .mli2
! 2-byte descriptor elements
.define .lar2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! special case lar: element size = 2 (statically known)
! parameters:
.define .laru
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! LAR NOT DEFINED
.define .los
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
.define .mli2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! 16 bit multiply
! parameters:
.define .mli4
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! 32-bit multiply routine for z80
! parameters:
! on stack! put return address in hl
push ix ! least sign. 2 bytes of result
jp (hl) ! return
-.data
-.flag: .byte 0
+.sect .data
+.flag: .data1 0
.mplier: .space 4
+.define .nop
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
-.define .nop
! NOP
! changed into output routine to print linenumber
.define outdec
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! output contents of HL as a sequence
! of decimal digits
outdec:
pop bc
ret
table:
- .short 10000
- .short 1000
- .short 100
- .short 10
+ .data2 10000
+ .data2 1000
+ .data2 100
+ .data2 10
+.define pstrng
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
-.define pstrng
! print a string of characters to the console
! entry: DE points to string
! string terminator is 0x00
.define .rck
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
.rck:
pop bc
pop ix
.define .rmi2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! 16-bit signed remainder
! parameters:
.define .sar
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! use .mli2
! use .trp.z
.define .sar2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! special case sar: element size = 2 (statically known)
! parameters:
.define .saru
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! SAR NOT DEFINED
.define .sdf
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! store double offsetted
.define .sdl
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! store double local at any offset
! parameters:
.define .set
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! use .unimpld
! any size sets
.define .strhp
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
.strhp:
pop ix
.define .sts
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! use trp.z
! object size given by 2-byte integer on
.define .trp.z
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! changed into output routine to print errornumber
.define unimpld, e.mon, e.rck, .trp.z, .unimpld
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
.unimpld:
unimpld: ! used in dispatch table to
.define .xor
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
! auxiliary size 'xor'
! parameters: