5 ;WARNING! THIS MUST BE PAGE-ALIGNED!
6 ACCS: defs 256 ;STRING ACCUMULATOR
8 $ERROR "ACCS must be page-aligned!"
14 PC: defw #C000 ;PROGRAM COUNTER
15 OC: defw #C000 ;ORIGIN of CODE
16 ;LISTON: defb #ff ;LISTO & OPT FLAG
17 LISTON: defb #10 ;LISTO & OPT FLAG
20 ;Bit 0 controls the listing. If it is set, a listing is displayed.
22 ;Bit 1 controls the error reporting. If it is set, errors are reported.
25 COUNT: defb 0 ;PRINT POSITION
83 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
85 ; this puts 0 integer number into the corresponding registers
98 ; this stores 4-byte integer at IX
99 ; used inly once, to store label value
100 ; number is H'L'HL (HL is high bytes_
105 ;GETVAR - GET LOCATION OF VARIABLE, RETURN IN HL & IX
106 ; Inputs: IY addresses first character.
107 ; Outputs: Carry set and NZ if illegal character.
108 ; Z-flag set if variable found, then:
109 ; A = variable type (0,4,5,128 or 129)
110 ; HL = IX = variable pointer.
112 ; If Z-flag & carry reset, then:
113 ; HL, IY set for subsequent PUTVAR call.
114 ; Destroys: everything
123 jr nc,error_identifier_expected
148 ; flags doesn't matter
151 msg_getvar: defx "GETVAR:<"
168 ;LANGUAGE-INDEPENDENT CONTROL SECTION:
169 ; Outputs: A=delimiter, carry set if syntax error.
180 ld ix,(PC) ;PROGRAM COUNTER
184 ld ix,(OC) ;ORIGIN of CODE
204 ex de,hl ;DE= NO. OF BYTES
209 ld (PC),hl ;UPDATE PC
214 ld (OC),hl ;UPDATE OC
215 ASSEM5: pop hl ;OLD PC
229 call nc,TABIT ;NEXT LINE
265 ;PROCESSOR-SPECIFIC TRANSLATION SECTION:
267 ;REGISTER USAGE: B - TYPE OF MOST RECENT OPERAND
268 ; C - OPCODE BEING BUILT
269 ; D - (IX) OR (IY) FLAG
270 ; E - OFFSET FROM IX OR IY
271 ; HL - NUMERIC OPERAND VALUE
272 ; IX - CODE DESTINATION
273 ; IY - SOURCE TEXT POINTER
274 ; Inputs: A = initial character
275 ; Outputs: Carry set if syntax error.
292 ; this code seems to be for tokenized input
293 ; we don't have tokenizer
303 ld d,0 ;CLEAR IX/IY FLAG
305 ;GROUP 0 - TRIVIAL CASES REQUIRING NO COMPUTATION
306 ;GROUP 1 - AS GROUP 0 BUT WITH "ED" PREFIX
314 ;GROUP 2 - BIT, RES, SET
315 ;GROUP 3 - RLC, RRC, RL, RR, SLA, SRA, SRL
327 ;GROUP 4 - PUSH, POP, EX (SP)
335 ;GROUP 5 - SUB, AND, XOR, OR, CP
336 ;GROUP 6 - ADD, ADC, SBC
430 TOOFAR: jp nz,error_out_of_range
542 ;MISC - DEFB, DEFW, DEFM
591 ret z ;REJECT LD (HL),(HL)
692 ; this code seems to be for tokenized input
693 ; we don't have tokenizer
742 ; this entry point is used by FIND
745 ; this entry point is used to skip blanks
746 ; note that comma and right paren are considered blanks too
747 ; as a consequence, operands may be delimited by spaces, or
757 ; used by FIND and SKIP
759 ld a,(iy) ;ASSEMBLER DELIMITER
767 ; entry point for SKIP
769 cp ';' ;ASSEMBLER TERMINATOR
774 ; also used by assembler to check for command separator
775 ; the assembler itself does nothing with separators
777 cp ':' ;ASSEMBLER SEPARATOR
972 ;k8: for some reason i cannot remove this
1050 OPRNDS: defb 'B'+80H