Jump to content

Loops/Downward for: Difference between revisions

m
No edit summary
Line 102:
Code is called as a subroutine, i.e. "JSR ForLoop." OS/Hardware specific printing subroutines are unimplemented here.
<lang 68000devpac>ForLoop:
MOVE.BW #10,D0
MOVE.W #9,D1 ;DBcc operates at word length so we need to clear the upper byte of the word.
loop:
JSR Print_D0_As_Ascii ;some routine that converts the digits of D0 into ascii characters and prints them to screen.
DBRA D1D0,loop ;repeat until D1D0.W = $FFFF
SUBQ.B #1,D0
DBRA D1,loop ;repeat until D1.W = $FFFF
rts</lang>
 
1,489

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.