Add a new .cap pseudo function to the assembler that allows to check for
certain capabilities of the CPU or target system.
This commit is contained in:
39
test/asm/listing/110-capabilities.s
Normal file
39
test/asm/listing/110-capabilities.s
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
; Error: Arguments to .CAPABILITY must be identifiers
|
||||
.if .cap()
|
||||
.endif
|
||||
|
||||
; Error: Arguments to .CAPABILITY must be identifiers
|
||||
; Error: ')' expected
|
||||
.if .cap(
|
||||
.endif
|
||||
|
||||
; Error: Not a valid capability name: CPU_HAS_BR
|
||||
.if .cap(cpu_has_br)
|
||||
.endif
|
||||
|
||||
; Error: ')' expected
|
||||
; Error: Unexpected trailing garbage characters
|
||||
.if .cap(cpu_has_bra8 cpu_has_bra8)
|
||||
.endif
|
||||
|
||||
; Ok
|
||||
.if .cap(cpu_has_bra8, CPU_HAS_PUSHXY, CPU_HAS_STZ, CPU_HAS_INA)
|
||||
.endif
|
||||
|
||||
.setcpu "65SC02"
|
||||
.if !.cap(cpu_has_bra8)
|
||||
.error "Assembler says 65SC02 has no 8 bit bra"
|
||||
.endif
|
||||
.if !.cap(cpu_has_PUSHXY)
|
||||
.error "Assembler says 65SC02 has no phx"
|
||||
.endif
|
||||
.if !.cap(cpu_has_STZ)
|
||||
.error "Assembler says 65SC02 has no stz"
|
||||
.endif
|
||||
.if !.cap(cpu_has_INA)
|
||||
.error "Assembler says 65SC02 has no ina"
|
||||
.endif
|
||||
|
||||
|
||||
|
||||
0
test/asm/listing/control/110-capabilities.err
Normal file
0
test/asm/listing/control/110-capabilities.err
Normal file
6
test/asm/listing/ref/110-capabilities.err2-ref
Normal file
6
test/asm/listing/ref/110-capabilities.err2-ref
Normal file
@@ -0,0 +1,6 @@
|
||||
110-capabilities.s:3: Error: Arguments to .CAPABILITY must be identifiers
|
||||
110-capabilities.s:8: Error: Arguments to .CAPABILITY must be identifiers
|
||||
110-capabilities.s:8: Error: ')' expected
|
||||
110-capabilities.s:12: Error: Not a valid capability name: CPU_HAS_BR
|
||||
110-capabilities.s:17: Error: ')' expected
|
||||
110-capabilities.s:17: Error: Unexpected trailing garbage characters
|
||||
Reference in New Issue
Block a user