-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure subtracting SizeRanges results in valid SizeRange.
- Loading branch information
Showing
2 changed files
with
111 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
arguments --create-library --target 45gs02 a.s | ||
file a.s <inline> | ||
.define YES | ||
.section code | ||
test { | ||
lda drive | ||
bne skip | ||
lda #8 | ||
sta drive | ||
skip: | ||
rts | ||
} | ||
test2 { | ||
store_word $5678, drive | ||
lda drive | ||
bne skip | ||
store_word $abcd, drive | ||
skip: | ||
rts | ||
} | ||
test3 { | ||
.if .defined(NO) { | ||
.repeat $80 { | ||
nop | ||
} | ||
} | ||
.if .defined(YES) { | ||
jsr $5678 | ||
} | ||
store_word $5678, drive | ||
lda drive | ||
bne skip | ||
store_word $abcd, drive | ||
skip: | ||
rts | ||
} | ||
.macro store_word value, address { | ||
lda #<(value) | ||
sta address | ||
lda #>(value) | ||
sta address + 1 | ||
} | ||
drive = $1234 | ||
end-of-inline-data | ||
file a.lib {} <inline> | ||
.format_version 1.0 | ||
.target "45gs02" | ||
.constant drive { | ||
visibility: private | ||
value: $1234 | ||
} | ||
.macro store_word { | ||
visibility: private | ||
arguments: value, address | ||
body < | ||
.data $a9, <value:1 | ||
.if .in_range($00, $ff, address) { | ||
.data $85, address:1 | ||
} | ||
.else { | ||
.data $8d, address:2 | ||
} | ||
.data $a9, >value:1 | ||
.if .in_range($00, $ff, (address+$01)) { | ||
.data $85, (address+$01):1 | ||
} | ||
.else { | ||
.data $8d, (address+$01):2 | ||
} | ||
> | ||
} | ||
.object test { | ||
visibility: private | ||
section: code | ||
body < | ||
.data $ad, $1234, $d0, $05:-1, $a9, $08, $8d, $1234, $60 | ||
> | ||
} | ||
.object test2 { | ||
visibility: private | ||
section: code | ||
body < | ||
.scope { | ||
.data $a9, $78, $8d, $1234, $a9, $56, $8d, $1235 | ||
} | ||
.data $ad, $1234, $d0, $0a:-1 | ||
.scope { | ||
.data $a9, $cd, $8d, $1234, $a9, $ab, $8d, $1235 | ||
} | ||
.data $60 | ||
> | ||
} | ||
.object test3 { | ||
visibility: private | ||
section: code | ||
body < | ||
.data $20, $5678 | ||
.scope { | ||
.data $a9, $78, $8d, $1234, $a9, $56, $8d, $1235 | ||
} | ||
.data $ad, $1234, $d0, $0a:-1 | ||
.scope { | ||
.data $a9, $cd, $8d, $1234, $a9, $ab, $8d, $1235 | ||
} | ||
.data $60 | ||
> | ||
} | ||
end-of-inline-data |