What does âjmp *â mean in 6502 assembly?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Right now I am learning 6502 assembly. Currently I am using the MADS assembler to program for the Atari 800. This program is just a small tutorial program that came with the assembler zip file I downloaded. The only piece of this program I did't understand is the jmp *
operation, what does the '*' mean? Full program:
sm_ptr = $58
ch = $2f4
chr = $2400
rom_chr = $e000
org $2000
.proc main
mva #>chr ch
ldx #0
copy_loop
mva rom_chr,x chr,x
mva rom_chr+$100,x chr+$100,x
mva rom_chr+$200,x chr+$200,x
mva rom_chr+$300,x chr+$300,x
inx
bne copy_loop
ldx #0
space_loop
mva charset.space,x chr,x
inx
cpx #8
bne space_loop
ldy #0
loop
tya
sta (sm_ptr),y
iny
bne loop
jmp *
.local charset
space
.byte %01000100
.byte %00101000
.byte %01111100
.byte %01010100
.byte %11111110
.byte %10101010
.byte %10111010
.byte %00000000
.endl
.endp
run main
assembly 6502 atari-800
New contributor
add a comment |Â
up vote
1
down vote
favorite
Right now I am learning 6502 assembly. Currently I am using the MADS assembler to program for the Atari 800. This program is just a small tutorial program that came with the assembler zip file I downloaded. The only piece of this program I did't understand is the jmp *
operation, what does the '*' mean? Full program:
sm_ptr = $58
ch = $2f4
chr = $2400
rom_chr = $e000
org $2000
.proc main
mva #>chr ch
ldx #0
copy_loop
mva rom_chr,x chr,x
mva rom_chr+$100,x chr+$100,x
mva rom_chr+$200,x chr+$200,x
mva rom_chr+$300,x chr+$300,x
inx
bne copy_loop
ldx #0
space_loop
mva charset.space,x chr,x
inx
cpx #8
bne space_loop
ldy #0
loop
tya
sta (sm_ptr),y
iny
bne loop
jmp *
.local charset
space
.byte %01000100
.byte %00101000
.byte %01111100
.byte %01010100
.byte %11111110
.byte %10101010
.byte %10111010
.byte %00000000
.endl
.endp
run main
assembly 6502 atari-800
New contributor
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Right now I am learning 6502 assembly. Currently I am using the MADS assembler to program for the Atari 800. This program is just a small tutorial program that came with the assembler zip file I downloaded. The only piece of this program I did't understand is the jmp *
operation, what does the '*' mean? Full program:
sm_ptr = $58
ch = $2f4
chr = $2400
rom_chr = $e000
org $2000
.proc main
mva #>chr ch
ldx #0
copy_loop
mva rom_chr,x chr,x
mva rom_chr+$100,x chr+$100,x
mva rom_chr+$200,x chr+$200,x
mva rom_chr+$300,x chr+$300,x
inx
bne copy_loop
ldx #0
space_loop
mva charset.space,x chr,x
inx
cpx #8
bne space_loop
ldy #0
loop
tya
sta (sm_ptr),y
iny
bne loop
jmp *
.local charset
space
.byte %01000100
.byte %00101000
.byte %01111100
.byte %01010100
.byte %11111110
.byte %10101010
.byte %10111010
.byte %00000000
.endl
.endp
run main
assembly 6502 atari-800
New contributor
Right now I am learning 6502 assembly. Currently I am using the MADS assembler to program for the Atari 800. This program is just a small tutorial program that came with the assembler zip file I downloaded. The only piece of this program I did't understand is the jmp *
operation, what does the '*' mean? Full program:
sm_ptr = $58
ch = $2f4
chr = $2400
rom_chr = $e000
org $2000
.proc main
mva #>chr ch
ldx #0
copy_loop
mva rom_chr,x chr,x
mva rom_chr+$100,x chr+$100,x
mva rom_chr+$200,x chr+$200,x
mva rom_chr+$300,x chr+$300,x
inx
bne copy_loop
ldx #0
space_loop
mva charset.space,x chr,x
inx
cpx #8
bne space_loop
ldy #0
loop
tya
sta (sm_ptr),y
iny
bne loop
jmp *
.local charset
space
.byte %01000100
.byte %00101000
.byte %01111100
.byte %01010100
.byte %11111110
.byte %10101010
.byte %10111010
.byte %00000000
.endl
.endp
run main
assembly 6502 atari-800
assembly 6502 atari-800
New contributor
New contributor
edited 3 hours ago
Brian Tompsett - 汤è±æ©
573212
573212
New contributor
asked 4 hours ago
user115898
476
476
New contributor
New contributor
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
MADS uses *
in three ways (See MADS "Manual")
- Using the current assembly address for calculation of an address, i.e. the one the actual statement is assembled to.
- Multiplying in expressions.
- Mark the beginning of a comment (until line end)
In above listing it will be interpreted as the address the JMP
instruction is assembled to, so it will form an infinite loop, effectively halting the machine until Reset.
add a comment |Â
up vote
3
down vote
I suspect the *
means the current instruction/location, as it does in some other assemblers, like PDP-8. Often it would be used in an expression like *-label
in the data section to get something's size, or *+3
perhaps, in code.
If that's the case for 6502 assembly, then jmp *
means branch to self, or, infinite loop, which would be a form of halting the program.
This makes some sense as it comes at the end of main, which presumably has nothing to return to for a bare metal program.
Some assemblers (e.g. masm, Microsoft's x86 assembler) use $ for the same meaning.
It could, it doesn't seem to effect the main program. I'll test that hypothesis right now.
â user115898
4 hours ago
Thanks, it is correct that it is an infinite loop that just loops back the the same line.
â user115898
3 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
MADS uses *
in three ways (See MADS "Manual")
- Using the current assembly address for calculation of an address, i.e. the one the actual statement is assembled to.
- Multiplying in expressions.
- Mark the beginning of a comment (until line end)
In above listing it will be interpreted as the address the JMP
instruction is assembled to, so it will form an infinite loop, effectively halting the machine until Reset.
add a comment |Â
up vote
4
down vote
accepted
MADS uses *
in three ways (See MADS "Manual")
- Using the current assembly address for calculation of an address, i.e. the one the actual statement is assembled to.
- Multiplying in expressions.
- Mark the beginning of a comment (until line end)
In above listing it will be interpreted as the address the JMP
instruction is assembled to, so it will form an infinite loop, effectively halting the machine until Reset.
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
MADS uses *
in three ways (See MADS "Manual")
- Using the current assembly address for calculation of an address, i.e. the one the actual statement is assembled to.
- Multiplying in expressions.
- Mark the beginning of a comment (until line end)
In above listing it will be interpreted as the address the JMP
instruction is assembled to, so it will form an infinite loop, effectively halting the machine until Reset.
MADS uses *
in three ways (See MADS "Manual")
- Using the current assembly address for calculation of an address, i.e. the one the actual statement is assembled to.
- Multiplying in expressions.
- Mark the beginning of a comment (until line end)
In above listing it will be interpreted as the address the JMP
instruction is assembled to, so it will form an infinite loop, effectively halting the machine until Reset.
edited 3 hours ago
Michael Kjörling
1,3811825
1,3811825
answered 3 hours ago
Raffzahn
38.1k485153
38.1k485153
add a comment |Â
add a comment |Â
up vote
3
down vote
I suspect the *
means the current instruction/location, as it does in some other assemblers, like PDP-8. Often it would be used in an expression like *-label
in the data section to get something's size, or *+3
perhaps, in code.
If that's the case for 6502 assembly, then jmp *
means branch to self, or, infinite loop, which would be a form of halting the program.
This makes some sense as it comes at the end of main, which presumably has nothing to return to for a bare metal program.
Some assemblers (e.g. masm, Microsoft's x86 assembler) use $ for the same meaning.
It could, it doesn't seem to effect the main program. I'll test that hypothesis right now.
â user115898
4 hours ago
Thanks, it is correct that it is an infinite loop that just loops back the the same line.
â user115898
3 hours ago
add a comment |Â
up vote
3
down vote
I suspect the *
means the current instruction/location, as it does in some other assemblers, like PDP-8. Often it would be used in an expression like *-label
in the data section to get something's size, or *+3
perhaps, in code.
If that's the case for 6502 assembly, then jmp *
means branch to self, or, infinite loop, which would be a form of halting the program.
This makes some sense as it comes at the end of main, which presumably has nothing to return to for a bare metal program.
Some assemblers (e.g. masm, Microsoft's x86 assembler) use $ for the same meaning.
It could, it doesn't seem to effect the main program. I'll test that hypothesis right now.
â user115898
4 hours ago
Thanks, it is correct that it is an infinite loop that just loops back the the same line.
â user115898
3 hours ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
I suspect the *
means the current instruction/location, as it does in some other assemblers, like PDP-8. Often it would be used in an expression like *-label
in the data section to get something's size, or *+3
perhaps, in code.
If that's the case for 6502 assembly, then jmp *
means branch to self, or, infinite loop, which would be a form of halting the program.
This makes some sense as it comes at the end of main, which presumably has nothing to return to for a bare metal program.
Some assemblers (e.g. masm, Microsoft's x86 assembler) use $ for the same meaning.
I suspect the *
means the current instruction/location, as it does in some other assemblers, like PDP-8. Often it would be used in an expression like *-label
in the data section to get something's size, or *+3
perhaps, in code.
If that's the case for 6502 assembly, then jmp *
means branch to self, or, infinite loop, which would be a form of halting the program.
This makes some sense as it comes at the end of main, which presumably has nothing to return to for a bare metal program.
Some assemblers (e.g. masm, Microsoft's x86 assembler) use $ for the same meaning.
answered 4 hours ago
Erik Eidt
882311
882311
It could, it doesn't seem to effect the main program. I'll test that hypothesis right now.
â user115898
4 hours ago
Thanks, it is correct that it is an infinite loop that just loops back the the same line.
â user115898
3 hours ago
add a comment |Â
It could, it doesn't seem to effect the main program. I'll test that hypothesis right now.
â user115898
4 hours ago
Thanks, it is correct that it is an infinite loop that just loops back the the same line.
â user115898
3 hours ago
It could, it doesn't seem to effect the main program. I'll test that hypothesis right now.
â user115898
4 hours ago
It could, it doesn't seem to effect the main program. I'll test that hypothesis right now.
â user115898
4 hours ago
Thanks, it is correct that it is an infinite loop that just loops back the the same line.
â user115898
3 hours ago
Thanks, it is correct that it is an infinite loop that just loops back the the same line.
â user115898
3 hours ago
add a comment |Â
user115898 is a new contributor. Be nice, and check out our Code of Conduct.
user115898 is a new contributor. Be nice, and check out our Code of Conduct.
user115898 is a new contributor. Be nice, and check out our Code of Conduct.
user115898 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f7998%2fwhat-does-jmp-mean-in-6502-assembly%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password