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 "***************"
237 defm "or c:inc a ; comment",13
240 defm "label cp 69",13
241 defm "call 0BEEFh",13
244 defm "djnz label3",13
248 defm "ld e,427%10",13
249 defm "ld bc,2+3*5",13
250 defm "ld bc,0+(2+3)*5",13
251 defm "ld bc,[2+3]*5",13
252 defm "ld bc,(2+3)*5",13
253 defm "label3 ld hl,16384",13
254 defm "ld hl,#4001",13
255 defm "ld a,(ix-2)",13
257 defm "ld de,$1234",13
258 defm "ld bc,0x5b02",13
259 defm "ld a,0b1001",13
261 defm "ld ix,-1234",13
262 defm "ld iy,-0x602a",13
266 defm "defb 7&$c,1|2,1|(3^1),1<<15",13
268 defm "defm '012','34'",13
274 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
277 ;; extracted from assembler code, because we don't need it there
280 ;; IY: current position in text buffer
281 ;; IX: current position in code buffer
282 ;; BC: starting position in text buffer
283 ;; HL: starting position in code buffer
289 ;COUNT: defb 0 ;PRINT POSITION
293 ret z ; no code -- nothing to do
300 ; calculate original PC
312 ; print code bytes (if there are any)
317 ; do not print code if more than 4 bytes (long strings and dbs)
320 ; do not print code if more than 4 bytes (long strings and dbs)
350 ; print source line, from BC to IY (exclusive)
351 ; calculate string length
377 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
379 ;; print byte in hex with the trailing space
387 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
409 LABMAN_FIRST_LABEL: defw $+2