1 ;WARNING! THIS MUST BE PAGE-ALIGNED!
2 ACCS: defs 256 ;STRING ACCUMULATOR
4 $ERROR "ACCS must be page-aligned!"
10 PC: defw #C000 ;PROGRAM COUNTER
11 OC: defw #C000 ;ORIGIN of CODE
12 ;LISTON: defb #ff ;LISTO & OPT FLAG
13 LISTON: defb #10 ;LISTO & OPT FLAG
16 ;Bit 0 controls the listing. If it is set, a listing is displayed.
18 ;Bit 1 controls the error reporting. If it is set, errors are reported.
21 COUNT: defb 0 ;PRINT POSITION
31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
33 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34 ;; this puts 0 integer number into the corresponding registers
35 ;; called exactly once to clear result of VAR
49 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
51 ;; LANGUAGE-INDEPENDENT CONTROL SECTION:
52 ;; Outputs: A=delimiter, carry set if syntax error.
64 ld ix,(PC) ;PROGRAM COUNTER
68 ld ix,(OC) ;ORIGIN of CODE
90 ex de,hl ;DE= NO. OF BYTES
100 ld (OC),hl ;UPDATE OC
117 call nc,TABIT ;NEXT LINE
161 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
163 ;; PROCESSOR-SPECIFIC TRANSLATION SECTION:
165 ;; REGISTER USAGE: B - TYPE OF MOST RECENT OPERAND
166 ;; C - OPCODE BEING BUILT
167 ;; D - (IX) OR (IY) FLAG
168 ;; E - OFFSET FROM IX OR IY
169 ;; HL - NUMERIC OPERAND VALUE
170 ;; IX - CODE DESTINATION
171 ;; IY - SOURCE TEXT POINTER
172 ;; Inputs: A = initial character
173 ;; Outputs: Carry set if syntax error.
192 ; this code seems to be for tokenized input
193 ; we don't have tokenizer
203 ld d,0 ;CLEAR IX/IY FLAG
206 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
208 ;; GROUP 0 - TRIVIAL CASES REQUIRING NO COMPUTATION
209 ;; GROUP 1 - AS GROUP 0 BUT WITH "ED" PREFIX
218 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
220 ;; GROUP 2 - BIT, RES, SET
221 ;; GROUP 3 - RLC, RRC, RL, RR, SLA, SRA, SRL
235 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
237 ;; GROUP 4 - PUSH, POP, EX (SP)
248 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
250 ;; GROUP 5 - SUB, AND, XOR, OR, CP
251 ;; GROUP 6 - ADD, ADC, SBC
288 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
290 ;; GROUP 7 - INC, DEC
311 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
341 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
343 ;; GROUP 10 - JR, DJNZ
365 jp nz,error_out_of_range
371 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
392 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
408 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
424 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
707 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
711 ; main table search entry point
718 ; this code seems to be for tokenized input
719 ; we don't have tokenizer
768 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
776 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
777 ;; this entry point is used by FIND
780 ; this entry point is used to skip blanks
781 ; note that comma and right paren are considered blanks too
782 ; as a consequence, operands may be delimited by spaces, or
792 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
793 ;; used by FIND and SKIP
795 ld a,(iy) ;ASSEMBLER DELIMITER
803 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
804 ;; entry point for SKIP
806 cp ';' ;ASSEMBLER TERMINATOR
811 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
812 ;; also used by assembler to check for command separator
813 ;; the assembler itself does nothing with separators
815 cp ':' ;ASSEMBLER SEPARATOR
821 $printf "assembler size: %d", csizeend-csizestart
823 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
824 ;; various tables -- mnemonics, operands...
965 ;k8: for some reason i cannot remove those two
1123 $printf "assembler tables size: %d", csizeend-csizestart