Program termination: Difference between revisions
no edit summary
Puppydrum64 (talk | contribs) No edit summary |
|||
Line 15:
<lang 11l>I problem
exit(1)</lang>
=={{header|6502 Assembly}}==
This mostly depends on the hardware, but typically home computers would boot in BASIC and <code>JSR</code> to the starting address on the disk. This means that the return address for BASIC is on top of the stack, and an <code>RTS</code> instruction will exit the program and return to BASIC, provided that execution is not inside one of the disk's subroutines.
<lang 6502>;assuming this is not a subroutine and runs inline.
LDA $DC01 ;read player 1's joystick
and #%00010000 ;fire button
bne JoyNotFire
rts ;returns to basic if the return address of BASIC is on top of the stack.
JoyNotFire:
;check the other buttons</lang>
=={{header|AArch64 Assembly}}==
|