Re: LF: ASM Question...Help please...


[Prev][Next][Index][Thread]

Re: LF: ASM Question...Help please...





On Mon, 2 Dec 1996, Parham Sabetazm wrote:

> Hi,
> 	I would appreciate it if someone could tell me how to write a for loop
> in 68k Assembly? I have the help card and the PDF file from Motorolla
> and they don't really help me that much. If you can, can you convert the
> following TI-BASIC program into 68k Assembly? Thanks!
> 	By the way, I would also appreciate it if you could attach the asm file
> of the program below with comments in it. Thanks alot!
> 	I am sorry if this is a really stupid question, but I am new to 68k
> assembly...
> 
> tester()
> Prgm
> ClrHome		(Or ClrDraw, whichever clears the screen in Asm)
> For x,1,500
>   Disp x
>   Pause
> EndFor
> DelVar x
> EndPrgm
> 
> 
> -Parham Sabetazm
> Chairman and CEO of ESI
> Member: Microsoft Sitebuilder Network Level 2
> Member: Team Gates
> 
> *******************************************************
> http://www.geocities.com/SiliconValley/5541
> parhams@geocities.com
> parham@juno.com
> parham@america.net
> *******************************************************
> 

	In 68k ASM on the TI-92, this simple program is very difficult to
write indeed!  Here are a couple of things to consider:

1) There exists no easy way to print a number to the screen, ESP. not in
decimal.  Perhaps try sprintf to convert to decimal, and then puttext to
output it to screen.  Still, not trivial.

2) Once you get to the screen, scrolling, if needed, is a pain... As with
No. 1, there is no ROM call that will scroll the screen (I think...).
This is tough...

3) Reading keys is also a bit hard (The Pause statement...)

	For the other, (Correct me if I'm wrong, guys), FOR
loops are relatively simple:

	<Fargo setup info, etc>

	EVEN			; Protect against "Address Error"
startTester:                    ; Starting line of our Proc

				; Let D3 be our loop counter
				; Note, D0-D7 are choices,
				; But D0, D1 are popular for other things.
	MOVE.L #1, D3		; Move 1 into Data register 3 
Loop1:
	blah blah blah blah
	blah blah blah blah	; Program code to print #, pause.
	blah blah blah blah

	CMP.L #500, D3		; Compare our loop counter to 500
	BLE Loop1		; If it is less, or equal, 
				; go back to D3.
				; (I may have the BLE opcode wrong...)
        
        RTS			; (And, finally, ReTurn from Subroutene)

	If I can help with anything else, ask ... at present, I am still a
novice at this too, though.
	BTW -- Nice Credentials list... What do they mean? (Except CEO...I
know what that means)

	-- Shawn Walker (swalker@joe.math.uga.edu)


Follow-Ups: References: