Skip to content

[basm] Syntax error in macros does not print the appropriate lines number #61

@rgiot

Description

@rgiot

This is probably related to bug #60

I have this code

;;
;; common.asm contains macros that would be usefull with any demo system.



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;          MEMORY HANDLING          ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	macro DS_PRODUCE_CRC16_SUM_ROUTINE
ds_crc16_sum
	DS_CRC16_SUM()
	ret
	endm

;; Compute the CRC16 sum of a data block.
;; Input:
;; - HL: pointer to the data block
;; - BC: length of the data block
;; Output:
;; - DE: CRC16 sum of the data block
;; Clobbers:
	macro DS_CRC16_SUM
		ld de, 0
@loop

		ld a, (hl) : inc hl
		add e
		ld a, d : adc a, 0: ld e, a

		dec bc
		ld a, b
		cp c
		jr nz @loop
	endm 

That displays the following error

error: error: error: Error in macro call DS_PRODUCE_CRC16_SUM_ROUTINE (defined in ../linking/src/demosystem/common.asm:10:2)
   ┌─ ../linking/src/load_outer_space.asm:68:2
   │
68 │     DS_PRODUCE_CRC16_SUM_ROUTINE()
   │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


error: error: Syntax error
   ┌─ ../linking/src/demosystem/common.asm:23:2 > MACRO DS_CRC16_SUM::12:1
   │
12 │         jr nz @loop
   │ ^^^^^^^^^^^^^^^^^^^ Unknown error


  ┌─ ../linking/src/demosystem/common.asm:10:2 > MACRO DS_PRODUCE_CRC16_SUM_ROUTINE::3:2
  │
3 │     DS_CRC16_SUM()
  │     ^^^^^^^^^^^^^^

68 is w wrong number, it should be 10
12 is the relative line inside the macro, it should be 34
3 is the relative line instide the macro, it should be 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions