<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 22 Mar 2005 22:57:00 +0000
From   : jgh@... (Jonathan Graham Harston)
Subject: Re: Assembler bug

Greg Cook <debounce@...> wrote:
> same 'bug' with references to the greater address space.)  Personally
> though, using precious ZP memory for code is a terrible waste...
 
A very useful *CLOSE runs in zero page:
 
00A8 A9 00      LDA #0
00AA A8         TAY
00AB 4C CE FF   JMP OSFIND
 
And the Tube Host code runs in zero page ;)
 
0000 00          .    BRK   ; Control block
 
.PollError
0016 A9 FF       .    LDA #&FF
0018 20 73 06     s.  JSR &0673
001B AD E3 FE         LDA &FEE3   ; TubeReg1
001E A9 00       .    LDA #&00
0020 20 68 06     h.  JSR &0668   ; Send &00
0023 A8               TAY
0024 B1 FD            LDA (&FD),Y
0026 20 68 06     h.  JSR &0668   ; Send error code
0029 C8               INY
002A B1 FD            LDA (&FD),Y
002C 20 68 06     h.  JSR &0668   ; Send error string
002F AA               TAX
0030 D0 F7            BNE &0029
.PollStart
0032 A2 FF       .    LDX #&FF    ; Initialise stack
0034 9A          .    TXS
0035 58          X    CLI
.PollLoop
0036 2C E0 FE    ,    BIT &FEE0   ; TubeSt0
0039 10 06       ..   BPL &0041   ; No char
003B AD E1 FE         LDA &FEE1   ; TubeReg0
003E 20 EE FF     .   JSR OSWRCH  ; Print it
0041 2C E2 FE    ,    BIT &FEE2   ; TubeSt1
0044 10 F0       .    BPL &0036   ; No command, loop back
0046 2C E0 FE    ,    BIT &FEE0   ; TubeSt0
0049 30 F0       0    BMI &003B   ; Another char, get it
004B AE E3 FE         LDX &FEE3   ; TubeReg1
004E 86 51       .Q   STX &51     ; Store in JMP
0050 6C 02 05    l..  JMP (&0502) ; Jump to command routine
 
0053 00          .    BRK         ; Address block
0054 80          .    EQUB &80
0055 00          .    BRK
0056 00          .    BRK
0057 4C 00 00    L..  JMP &0000
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
Badly formed email is deleted unseen as spam
Sheffield Boundary Review at http://mdfs.net/User/JGH/Docs/Politics/ParlReview
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>