On 14 Jul 00, rednuht@... wrote:
> could some of the people who have successfully used ASM for the vmu
> have a look at this please.
First off, *FOR GOD'S SAKE* make sure that the code you post (*INCLUDING*
the width added by the tabulator chars!) will not exceed 73 chars a line!
It looks like SHIT when it's viewed on an 80x25 chars display! And you
others, when you _quote_ source code, then please make sure that the
quoted lines stay readable and aren't split over multiple lines! *cough*
edit by hand if necessary *cough*
Anyway, the following is a short routine that I occasionally use in my
programs:
FindLine:
;
; takes a line-number in ACC (0 - 31)
;
; returns line-start in ACC ($80, $86, $90, $96 etc.)
; and sets XBNK-register to required value (0 or 1)
;
; no other registers will be affected
;
rol ; multiply with 8
rol
rol
;
bn acc,3,.fl_l1
sub #2 ; line start correction, if uneven line number
.fl_l1:
mov #0,xbnk ; default: bank 0
bn acc,7,.fl_l2
inc xbnk ; select bank 1 if line-number was 16 or more
.fl_l2:
or #%10000000 ; add $80 (start of XRAM)
;
ret
Hope this helps.
Bye
Alessandro
---
You get what anyone gets. You get a lifetime.