11 $printf "label manager size: %d", csizeend-csizestart
16 $printf "ouput system size: %d", csizeend-csizestart
19 ;include "output_driver_std.zas"
20 include "output_driver_4x8.zas"
22 $printf "printing driver size: %d", csizeend-csizestart
24 ; so they won't clutter symbol table
34 ld (BZ80ASM.EXPR_ERROR_CB),hl
36 ld hl,expr_error_jrfar_cb
37 ld (BZ80ASM.ASM_JR_TOO_FAR_CB),hl
39 ld hl,LABMAN_FIND_LABEL
40 ld (BZ80ASM.GETLABEL_CB),hl
49 ; print line to assemble
68 push ix ; save code destination
69 push iy ; we'll need it for listing
71 ;call EXPR_STACK_RESET
98 call LABMAN_DEFINE_LABEL
99 jr c,bad_label_name_error
101 ; if terminator, don't try to assemble more
107 jr list_and_error_no_label_check
110 bad_label_name_error:
111 ld a,BZ80ASM.EXPR_ERR_INVALID_LABEL_NAME
112 jp BZ80ASM.PARSE_EXPR_ERROR_A
116 ld a,(BZ80ASM.ASM_BAD_B)
120 list_and_error_no_label_check:
124 pop hl ; current position in text buffer
125 pop de ; initial position
130 ; de: print from here
165 errline: defx "---------"
172 defm "label cp 69",13
173 defm "call 0BEEFh",13
176 defm "djnz label3",13
180 defm "ld e,427%10",13
181 defm "ld bc,2+3*5",13
182 defm "ld bc,0+(2+3)*5",13
183 defm "ld bc,[2+3]*5",13
184 defm "ld bc,(2+3)*5",13
185 defm "label3 ld hl,16384",13
186 defm "ld hl,#4001",13
187 defm "ld a,(ix-2)",13
189 defm "ld de,$1234",13
190 defm "ld bc,0x5b02",13
191 defm "ld a,0b1001",13
193 defm "ld ix,-1234",13
194 defm "ld iy,-0x602a",13
198 defm "defb 7&$c,1|2,1|(3^1),1<<15",13
200 defm "defm '012','34'",13
206 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
209 ;; extracted from assembler code, because we don't need it there
212 ;; IY: current position in text buffer
213 ;; IX: current position in code buffer
214 ;; BC: starting position in text buffer
215 ;; DE: starting position in code buffer
220 ;COUNT: defb 0 ;PRINT POSITION
222 ; calculate code length
232 ; calculate original PC
245 ; print code bytes (if there are any)
250 ; do not print code if more than 4 bytes (long strings and dbs)
253 ; do not print code if more than 4 bytes (long strings and dbs)
283 ; print source line, from BC to IY (exclusive)
284 ; calculate string length
310 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
312 ;; print byte in hex with the trailing space
320 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
342 LABMAN_FIRST_LABEL: defw $+2