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
37 ld (BZ80ASM.EXPR_ERROR_CB),hl
39 ld hl,expr_error_jrfar_cb
40 ld (BZ80ASM.ASM_JR_TOO_FAR_CB),hl
42 ld hl,LABMAN_FIND_LABEL
43 ld (BZ80ASM.GETLABEL_CB),hl
64 ; print line to assemble
83 push ix ; save code destination
84 push iy ; we'll need it for listing
89 ; DE is code length here
90 pop bc ; text starting position
91 pop hl ; code starting position
94 ; check for line terminator
95 ; actually, anything except ':' is line terminator here
96 ; 0 terminates the whole buffer
112 ; check for buffer termination again
120 call LABMAN_ADVANCE_PASS
122 jr c,asm_another_pass
129 ld (DISZ80.EMIT_CB),hl
135 ; HL: address to disasm
155 msg_disasm: defm 13,13,"--------",13,"DISASSEMBLY",13,"--------",13+#80
159 call LABMAN_DEFINE_LABEL
160 jr c,bad_label_name_error
162 ; if terminator, don't try to assemble more
168 jr list_and_error_no_label_check
171 bad_label_name_error:
172 ld a,BZ80ASM.EXPR_ERR_INVALID_LABEL_NAME
173 jp BZ80ASM.PARSE_EXPR_ERROR_A
177 ld a,(BZ80ASM.ASM_BAD_B)
181 list_and_error_no_label_check:
185 pop hl ; current position in text buffer
186 pop de ; initial position
191 ; de: print from here
226 errline: defx "---------"
230 defm "***************",13
234 defx "***************"
241 defm "push af,ix,de,hl",13
242 defm "pop af,iy,de,hl,bc",13
249 defm "or c:inc a ; comment",13
252 defm "label cp 69",13
253 defm "call 0BEEFh",13
256 defm "djnz label3",13
260 defm "ld e,427%10",13
261 defm "ld bc,2+3*5",13
262 defm "ld bc,0+(2+3)*5",13
263 defm "ld bc,[2+3]*5",13
264 defm "ld bc,(2+3)*5",13
265 defm "label3 ld hl,16384",13
266 defm "ld hl,#4001",13
267 defm "ld a,(ix-2)",13
269 defm "ld de,$1234",13
270 defm "ld bc,0x5b02",13
271 defm "ld a,0b1001",13
273 defm "ld ix,-1234",13
274 defm "ld iy,-0x602a",13
278 defm "defb 7&$c,1|2,1|(3^1),1<<15",13
280 defm "defm '012','34'",13
286 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
289 ;; extracted from assembler code, because we don't need it there
292 ;; IY: current position in text buffer
293 ;; IX: current position in code buffer
294 ;; BC: starting position in text buffer
295 ;; HL: starting position in code buffer
301 ;COUNT: defb 0 ;PRINT POSITION
305 ret z ; no code -- nothing to do
312 ; calculate original PC
324 ; print code bytes (if there are any)
329 ; do not print code if more than 4 bytes (long strings and dbs)
332 ; do not print code if more than 4 bytes (long strings and dbs)
362 ; print source line, from BC to IY (exclusive)
363 ; calculate string length
389 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
391 ;; print byte in hex with the trailing space
399 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
421 LABMAN_FIRST_LABEL: defw $+2