mirror of
https://github.com/mi57730/a2d.git
synced 2025-08-09 16:25:02 +00:00
Merge remote-tracking branch 'origin/disasm'
This commit is contained in:
@@ -1526,9 +1526,7 @@ draw_title_bar:
|
|||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;; Following proc is copied to $B1
|
;; Following proc is copied to $B1
|
||||||
save_org := *
|
PROC_AT adjust_txtptr_copied, $B1
|
||||||
.proc adjust_txtptr_copied
|
|
||||||
.org $B1
|
|
||||||
dummy_addr := $EA60
|
dummy_addr := $EA60
|
||||||
|
|
||||||
loop: inc TXTPTR
|
loop: inc TXTPTR
|
||||||
@@ -1547,8 +1545,7 @@ loop: inc TXTPTR
|
|||||||
sec
|
sec
|
||||||
sbc #$D0 ; carry set if successful
|
sbc #$D0 ; carry set if successful
|
||||||
end: rts
|
end: rts
|
||||||
.endproc
|
END_PROC_AT
|
||||||
.org save_org + .sizeof(adjust_txtptr_copied)
|
|
||||||
sizeof_adjust_txtptr_copied = .sizeof(adjust_txtptr_copied)
|
sizeof_adjust_txtptr_copied = .sizeof(adjust_txtptr_copied)
|
||||||
|
|
||||||
|
|
||||||
|
24
macros.inc
24
macros.inc
@@ -679,6 +679,30 @@ loop: lda src,x
|
|||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
;;; Placed Procedures
|
||||||
|
;;; ============================================================
|
||||||
|
;;; Usage:
|
||||||
|
;;; PROC_AT relocated_proc, $300
|
||||||
|
;;; .assert * = $300, ...
|
||||||
|
;;; ...
|
||||||
|
;;; END_PROC_AT
|
||||||
|
;;; .assert * = back to normal
|
||||||
|
|
||||||
|
.macro PROC_AT name, addr
|
||||||
|
.proc name
|
||||||
|
saved_org := *
|
||||||
|
.org addr
|
||||||
|
.proc __inner__
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
.macro END_PROC_AT
|
||||||
|
.endproc ; __inner__
|
||||||
|
.org saved_org + .sizeof(__inner__)
|
||||||
|
.endproc
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Flow Control
|
;;; Flow Control
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
@@ -57,14 +57,16 @@ while (<STDIN>) {
|
|||||||
$_ .= ' ' while length($_) % $tab;
|
$_ .= ' ' while length($_) % $tab;
|
||||||
$_ .= ':= ' . $expression . ' ';
|
$_ .= ':= ' . $expression . ' ';
|
||||||
|
|
||||||
} elsif (m/^(\.(?:end)?(?:proc|scope|macro|struct|enum)\b)\s*(.*)$/) {
|
} elsif (m/^(\.(?:end)?(?:proc|scope|macro|struct|enum)\b)\s*(.*)$/ ||
|
||||||
|
m/^(\b(?:END_)?(?:PROC_AT)\b)\s*(.*)$/) {
|
||||||
|
|
||||||
# scope - flush left
|
# scope - flush left
|
||||||
my ($opcode, $arguments) = ($1 // '', $2 // '');
|
my ($opcode, $arguments) = ($1 // '', $2 // '');
|
||||||
|
|
||||||
$_ = $opcode . ' ' . $arguments;
|
$_ = $opcode . ' ' . $arguments;
|
||||||
|
|
||||||
} elsif (m/^(\.(?:if\w*|elseif|else|endif)\b)\s*(.*)$/) {
|
} elsif (m/^(\.(?:if\w*|elseif|else|endif)\b)\s*(.*)$/ ||
|
||||||
|
m/^(\b(?:IF_\w+|ELSE|END_IF)\b)\s*(.*)$/) {
|
||||||
|
|
||||||
# conditional - half indent left
|
# conditional - half indent left
|
||||||
my ($opcode, $arguments) = ($1 // '', $2 // '');
|
my ($opcode, $arguments) = ($1 // '', $2 // '');
|
||||||
|
Reference in New Issue
Block a user