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
53 ; print line to assemble
72 push ix ; save code destination
73 push iy ; we'll need it for listing
75 ;call EXPR_STACK_RESET
101 ld (DISZ80.EMIT_CB),hl
107 ; HL: address to disasm
127 msg_disasm: defm 13,13,"--------",13,"DISASSEMBLY",13,"--------",13+#80
131 call LABMAN_DEFINE_LABEL
132 jr c,bad_label_name_error
134 ; if terminator, don't try to assemble more
140 jr list_and_error_no_label_check
143 bad_label_name_error:
144 ld a,BZ80ASM.EXPR_ERR_INVALID_LABEL_NAME
145 jp BZ80ASM.PARSE_EXPR_ERROR_A
149 ld a,(BZ80ASM.ASM_BAD_B)
153 list_and_error_no_label_check:
157 pop hl ; current position in text buffer
158 pop de ; initial position
163 ; de: print from here
198 errline: defx "---------"
205 defm "label cp 69",13
206 defm "call 0BEEFh",13
209 defm "djnz label3",13
213 defm "ld e,427%10",13
214 defm "ld bc,2+3*5",13
215 defm "ld bc,0+(2+3)*5",13
216 defm "ld bc,[2+3]*5",13
217 defm "ld bc,(2+3)*5",13
218 defm "label3 ld hl,16384",13
219 defm "ld hl,#4001",13
220 defm "ld a,(ix-2)",13
222 defm "ld de,$1234",13
223 defm "ld bc,0x5b02",13
224 defm "ld a,0b1001",13
226 defm "ld ix,-1234",13
227 defm "ld iy,-0x602a",13
231 defm "defb 7&$c,1|2,1|(3^1),1<<15",13
233 defm "defm '012','34'",13
239 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
242 ;; extracted from assembler code, because we don't need it there
245 ;; IY: current position in text buffer
246 ;; IX: current position in code buffer
247 ;; BC: starting position in text buffer
248 ;; DE: starting position in code buffer
253 ;COUNT: defb 0 ;PRINT POSITION
255 ; calculate code length
265 ; calculate original PC
278 ; print code bytes (if there are any)
283 ; do not print code if more than 4 bytes (long strings and dbs)
286 ; do not print code if more than 4 bytes (long strings and dbs)
316 ; print source line, from BC to IY (exclusive)
317 ; calculate string length
343 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
345 ;; print byte in hex with the trailing space
353 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
375 LABMAN_FIRST_LABEL: defw $+2