]> cloudbase.mooo.com Git - z180-stamp.git/blob - z180/z180.lib
env.c needs getopt-min.h
[z180-stamp.git] / z180 / z180.lib
1 .xlist
2 ;;
3 ;; Z180 / HD64180 MACRO LIBRARY
4 ;;
5
6 IFNDEF SLP
7
8 ;;
9 ;;
10 ;; HD64180 instructions:
11 ;;
12 ;; SLP ; Enter SLEEP mode
13 ;; MLT RR ; 8 bit multiply with 16 bit result
14 ;; IN0 R,P ; Input from internal port
15 ;; OUT0 P,R ; Output to internal port
16 ;; OTIM ; Block output, increment
17 ;; OTIMR ; Block output, increment and repeat
18 ;; OTDM ; Block output, decrement
19 ;; OTDMR ; Block output, decrement and repeat
20 ;; TSTIO P ; Non destructive AND, I/O port and A
21 ;; TST R ; Non destructive AND, reg and A
22 ;; TST ID ; Non destructive AND, immediate data and A
23 ;; TST (HL) ; Non destructive AND, (HL) and A
24 ;;
25 ;;
26
27 ??BC EQU 0 ; Double-register definitions
28 ??DE EQU 1
29 ??HL EQU 2
30 ??SP EQU 3
31
32 ??A EQU 7 ; Single-register defintions
33 ??B EQU 0
34 ??C EQU 1
35 ??D EQU 2
36 ??E EQU 3
37 ??H EQU 4
38 ??L EQU 5
39
40 SLP MACRO
41 DEFB 0EDH,76H
42 ENDM
43
44 MLT MACRO ?R
45 DB 0EDH,4CH+(??&?R AND 3) SHL 4
46 ENDM
47
48 IN0 MACRO ?R,?P
49 DB 0EDH,(??&?R AND 7) SHL 3, ?P
50 ENDM
51
52 OUT0 MACRO ?P,?R
53 DB 0EDH,1+(??&?R AND 7) SHL 3,?P
54 ENDM
55
56 OTIM MACRO
57 DB 0EDH,83H
58 ENDM
59
60 OTIMR MACRO
61 DB 0EDH,93H
62 ENDM
63
64 OTDM MACRO
65 DB 0EDH,8BH
66 ENDM
67
68 OTDMR MACRO
69 DB 0EDH,9BH
70 ENDM
71
72 TSTIO MACRO ?P
73 DB 0EDH,74H,?P
74 ENDM
75
76 TSTR MACRO ?R
77 DB 0EDH,4+(??&?R AND 7) SHL 3
78 ENDM
79
80 TSTD MACRO ?P
81 DB 0EDH,64H,?P
82 ENDM
83
84 TSTP MACRO
85 DB 0EDH,34H
86 ENDM
87
88 TST MACRO ?R
89 ?D: SET 0
90 IRPC ?X,?R
91 ?D: SET ?D+1 ; Count # chars in "?R"
92 ENDM
93 IF ?D EQ 1 ; IF # chars = 1
94 IRPC ?X,ABCDEHL ; Look up the character
95 IF ??&?X EQ ??&?R
96 DB 0EDH,4+(??&?R AND 7) SHL 3
97 EXITM
98 ENDIF
99 ENDM
100 DB 0EDh,64h,?R
101 EXITM
102 ENDIF
103 IF (?R = 2) & (?D = 4)
104 ?D: SET 0
105 IRPC ?X,?R
106 IFIDN <?X>,<(>
107 DB 0EDh,34h
108 EXITM
109 ENDIF
110 ?D: SET ?D + 1
111 ENDM
112 ENDIF
113 IF ?D NE 0
114 DB 0EDH,64H,?R
115 ENDIF
116 ENDM
117
118 ENDIF ;/* IFNDEF SLP /
119 .list
120