home *** CD-ROM | disk | FTP | other *** search
- e
- _ Program to list lazy greenius assembler programs
-
- _ Define a start location
-
- org $1350
-
- _ define the storage locations used
-
- loadaddr = $2000
- bsout = $ffd2
- po = $fa
- lo = $fc
- en res 2
- ct res 2
- cb res 2
- savepo res 2
-
- _ Code start
- _ input is A=filename length
- _ X=filename address low
- _ Y=filename address high
- _ bank will have been set before this program was called
-
- £ $ffbd _ set name
- ¥ #0
- ₧ #0
- £ $ff68 _ set bank
- ¥ #0
- ₧ #8
- ƒ #0
- £ $ffba _ set lfs
- ¥ #0
- ₧ #>loadaddr
- ƒ #<loadaddr
- £ $ffd5 _ load
- ä error
- ░ en
- ▒ en+1
- ¢ display
- error ¬ _ return error in A
-
- _
- _ Now we display the screen
- _
- display equ *
- ¥ #147
- £ bsout
- ₧ #1
- ¥ #>loadaddr
- » po
- » ct
- ¥ #<loadaddr
- » po+1
- » ct+1
- ƒ #0
- dispscr equ *
- ¥ [po],y
- æ #13
- ê nocheck
- Ö
- Æ #26
- à exitline
- nocheck equ *
- £ outchar
- ÿ po
- ê noinc9
- ÿ po+1
- noinc9 equ *
- ¥ po+1 _ assume that there is at least one character
- æ en+1 _ in the file and that en is the position
- ê dispscr _ after this character so po could equal en
- ¥ po _ at some point if we reach the end before
- æ en _ before the end of the screen
- ê dispscr
- exitline equ * _ end of file or last CR would mean 26th line
- ¥ po
- ì
- Ç #1
- » cb
- ¥ po+1
- Ç #0
- » cb+1
- _
- _ control the input
- _
- loopkey equ *
- ₧ #3
- loopdel1 equ *
- ƒ #0
- loopdel2 equ *
- û
- ê loopdel2
- ò
- ê loopdel1
- ¥ $d4
- æ #83
- à scrdown
- æ #84
- à scrup
- æ #7
- à shift
- æ #41
- à prt
- æ #57
- ê loopkey
- ¥ #0
- ¬
- shift ¥ $d3
- à scrup
- æ #1
- à scrdown
- ê loopkey
- prt ¢ print
- scrup equ *
- ¥ cb+1 _ if cb < en then scroll up
- æ en+1
- à extra3
- ä loopkey
- ¢ scrollup
- extra3 ¥ cb
- æ en
- ä loopkey
- ¢ scrollup
- _
- _ do the scroll down logic
- _
- scrdown equ * _ if ct > loadaddr then continue
- ¥ ct+1
- æ #<loadaddr
- â loopkey _ if ct(high) < loadaddr then ct < loadaddr
- à possible _ if ct(high) = loadaddr then possible
- ä dodown _ definite
- possible equ *
- ¥ #>loadaddr
- æ ct
- ä loopkey
- dodown equ *
- ¥ #27
- £ bsout
- ¥ #87
- £ bsout _ scroll the screen down
- ¥ #19 _ home the cursor
- £ bsout
- _
- _ start of the logic to scan for the previous line
- _
- ¥ ct
- ¼
- ½ #2
- » po
- » savepo
- ¥ ct+1
- ½ #0
- » po+1 _ po=ct-2 point past last cr
- » savepo+1 _ save ct-2
- ƒ #0
- loopup1 equ * _ locate the start of the line
- ¥ [po],y
- æ #13 _ have we found a CR
- à fndup1 _ yes so stop
- ö po _ po=po-1
- ¥ po
- æ #$ff
- ê nodec1
- ö po+1
- nodec1 equ *
- ¥ po+1 _ if po <= loadaddr then stop
- æ #<loadaddr
- â setstart
- à extra1
- ä loopup1
- extra1 equ *
- ¥ po
- æ #>loadaddr
- ä loopup1
- setstart equ *
- ¥ #>loadaddr
- » po
- ¥ #<loadaddr
- » po+1
- ¢ noinc1
-
- fndup1 equ * _ found either the CR or start of text
- ÿ po _ point to next char if CR found
- ê noinc1 _ if start of text then we would have gone
- ÿ po+1 _ gone past the start by 1 so increment
- _
- _ if po > ct-2 then all we found was a carriage return on the last line
- _ so don't display anything
- _
- noinc1 equ *
- ¥ po
- » ct
- ¥ po+1
- » ct+1 _ this will be the new current top
- ¥ savepo+1
- æ po+1
- â leave1
- à extra2
- ¢ disp
- extra2 equ *
- ¥ savepo
- æ po
- â leave1
- disp equ *
- ¥ [po],y
- £ outchar
- ¥ po
- æ savepo
- ê incpo
- ¥ po+1
- æ savepo+1
- à leave1
- incpo equ *
- ÿ po
- ê disp
- ÿ po+1
- ê disp
- _
- _ displayed the line if >40 then we would have had to scroll down twice
- _
- leave1 equ *
- _
- _ This logic just looks for the current bottom start of line
- _
- ¥ cb
- ¼
- ½ #2
- » po
- ¥ cb+1
- ½ #0
- » po+1 _ po=ct-2 point past last cr
- ƒ #0
- loopup2 equ * _ locate the start of the line
- ¥ [po],y
- æ #13
- à fndup2
- ö po
- ¥ po
- æ #$ff
- ê loopup2
- ö po+1
- ê loopup2
- fndup2 equ *
- ÿ po
- ê noinc2
- ÿ po+1
- noinc2 equ *
- ¥ po
- » cb
- ¥ po+1
- » cb+1
- ¢ loopkey
-
- _
- _ here is the logic to scroll up.
- _
- scrollup equ *
- ¥ #27
- £ bsout
- ¥ #86
- £ bsout _ scroll up
- ¥ #19
- £ bsout _ home cursor
- ₧ #24 _ 24 cursor downs
- ¥ #17
- loopcur equ *
- £ bsout
- ò
- ê loopcur
- _
- _ here we go...
- _
- ¥ cb
- » po
- ¥ cb+1
- » po+1
- ƒ #0
- loopit equ *
- ¥ [po],y
- æ #13
- à leave4
- £ outchar
- ÿ po
- ê check2
- ÿ po+1
- check2 equ *
- ¥ po+1
- æ en+1
- â loopit
- à extra4
- ä leave4
- extra4 equ *
- ¥ po
- æ en
- â loopit
- leave4 equ *
- ÿ po
- ê noinc4
- ÿ po+1
- noinc4 equ *
- ¥ po
- » cb
- ¥ po+1
- » cb+1
- _
- _ line now displayed so lets locate the current top
- _
- ¥ ct
- » po
- ¥ ct+1
- » po+1
- loop5 equ *
- ¥ [po],y
- ÿ po
- ê forward
- ÿ po+1
- forward equ *
- æ #13
- ê loop5
- ¥ po
- » ct
- ¥ po+1
- » ct+1
- ¢ loopkey
- _
- _ Now output characters and convert the tokens
- _
- outchar equ *
- ░ savex
- ▒ savey
- æ #128
- ä convert
- £ bsout
- exitchar equ *
- ₧ savex
- ƒ savey
- ¬
- convert equ *
- ¼
- ½ #128
- ▓
- ¥ #>table
- » lo
- ¥ #<table
- » lo+1
- Æ #0
- à outit
- loop9 equ *
- ¥ lo
- ì
- Ç #3
- » lo
- ¥ lo+1
- Ç #0
- » lo+1
- ò
- ê loop9
- outit equ *
- ƒ #0
- loop8 equ *
- ¥ [lo],y
- £ bsout
- ä exitchar
- Ü
- ô #3
- â loop8
- ì _ set a good return code
- ¢ exitchar
- table equ *
- db "adcandaslbccbcsbeqbitbmibnebplbrkbvcbvsclccldcliclvcmpcpxcpy"
- db "decdexdeyeorincinxinyjmpjsrldaldxldylsrnoporaphaphpplaplprol"
- db "rorrtirtssbcsecsedseistastxstytaxtaytsxtxatxstya"
- savex res 1
- savey res 1
-
- _
- _ routine to print from loadaddr to en
- _
- print equ *
- ¥ #0 _ set length to zero
- £ $ffbd
- ¥ #1
- ₧ #4
- ƒ #7
- £ $ffba _ set LFS
- £ $ffc0 _ open the file
- â prtcont1
- prterror1 equ *
- ¢ loopkey
- prtcont1 equ *
- ₧ #1
- £ $ffc9 _ BSOUT routed the logical file number def
- â prtcont2
- prterror2 equ *
- ¥ #1
- £ $ffc3 _ close the LA
- ¢ prterror1
- prtcont2 equ *
- ¥ #>loadaddr
- » po
- ¥ #<loadaddr
- » po+1
- ƒ #0
- loopprt equ *
- ¥ po
- æ en
- ê incloop
- ¥ po+1
- æ en+1
- à prtfin
- incloop equ *
- ¥ [po],y
- £ outchar
- ä prtfin
- ¥ $d4
- æ #13 _ s key pressed ?
- à prtfin
- ÿ po
- ê loopprt
- ÿ po+1
- ê loopprt
- prtfin equ *
- £ $ffcc _ reset the channels
- ¢ prterror2 _ reset bsout and close the file and exit
-
-
- o