> ZNOS/S # Source for ZNOS ROM 6502 code  (. v0.01 JGH: Initial source code recreated 2: <7OS_CLI=&FFF7:OSBYTE=&FFF4:OSWORD=&FFF1:OSWRCH=&FFEE F7OSASCI=&FFE3:OSGBPB=&FFD1:OSNEWL=&FFE7:OSFILE=&FFDD P: Z mcode% &400 d P=01 nP%=&8000:O%=mcode% x[OPT P*3+4 .L8000 8CLC:SEI:EQUB &90 :\ Language entry A.L8003 :\ Dual code, 6502 and Z80 7JMP Service :\ Service entry EQUB &EA:EQUB L802F-L8000 .ROMVersion EQUB &65 .ROMTitle ?EQUS "This is FREEWARE: type *HELP ZNOS":EQUB 0:EQUS "1.02" .ROMCopyright .L802F ,EQUB 0:EQUS "(C)1986 SJ Research":EQUB 0 BEQUD &0000B000 :\ CoPro relocation address : EQUS &8050-P%,255)  " ,-\ --------------------------------------- 6-\ Entry point if entered as 6502 language @-\ --------------------------------------- J .L8050 TECLI:JSR L8057 :\ Display Z80 warning message ^HJMP L825A :\ Find another language to enter h r!\ --------------------------- |!\ Display Z80 warning message !\ ---------------------------  .L8057  JSR L823A 7EQUS "Requires Z80 second processor":EQUB 13:EQUB 0 RTS  ,\ -------------------------------------- ,\ Entry point if entered as Z80 language ,\ --------------------------------------  .L807A -EQUB &21:EQUB &00:EQUB &D0 :\ LD HL,&D000 -EQUB &11:EQUB &00:EQUB &F5 :\ LD DE,&F500 -EQUB &01:EQUB &01:EQUB &1D :\ LD BC,&1D01 FEQUB &ED:EQUB &B8 :\ LDDR ; Copy code up to &D800 @EQUB &C3:EQUB &00:EQUB &F2 :\ JP &F200 ; Enter Cold Boot \ &6\ ROM &8300-&A000 copied to Z80 memory &D800-&F500 0=\ 8300-8AFF - &800 bytes - CCP -> copied to &D800-&DFFF :=\ 8B00-9CFF - &1200 bytes - BDOS -> copied to &E000-&F1FF D=\ 9D00-9FFF - &300 bytes - BIOS -> copied to &F200-&F4FF N\ X\ ----------------------- b\ Print long help message l\ ----------------------- v .L8088 EJSR L823A :\ Print start of help message 4EQUS " FREEWARE message":EQUB 13:EQUB 13 4EQUS "SJ Research ZNOS allows Acorn Z80":EQUB 13 DEQUS "2nd Processors to be used with the Econet":EQUB 13:EQUB 13 4EQUS "You may make any number of copies":EQUB 13 7EQUS "and distribute them freely, provided":EQUB 13  EQUB 0   .L8137 BLDA #L9B80 255:STA &A8 :\ Point to rest of help text LDA #L9B80 256:STA &A9  LDY #&00  .L8141 KLDA (&A8),Y:BEQ ServClaim :\ Zero byte, exit with call claimed  9JSR OSASCI :\ Print character INC &A8:BNE L8141  NINC &A9:BNE L8141 :\ Increment address, loop to next char * 4.ServClaim >CPLA:TAY:PLA:LDA #&00:LDX &F4 :\ Restore stacked registers H@RTS :\ Exit with A=0 to claim R \\ ---------------- f\ Display ROM help p\ ---------------- z .ServHelp NLDA (&F2),Y:CMP #&0D:BEQ L8166 :\ If no parameters, display short help FJSR L81B7:BNE ServExit :\ If not 'ZNOS', exit silently KJMP L8088 :\ Jump to display long help message   .L8166 DJSR L823A :\ Display short help message  EQUB 13 L.L816A :\ Also used as 'ZNOS' command string +EQUS "ZNOS ROM ver 1.01":EQUB 13:EQUB 0 JMP ServExit  \ --------------------- \ OSBYTE 63 - Fetch CCP \ --------------------- .ServOsbyte JLDA &EF:CMP #&3F:BNE ServExit :\ If not OSBYTE 63, exit unclaimed $RLDA #&08:JSR L81D8 :\ Copy 8 pages of code to second processor .6LDA #&83:JSR &0406 :\ Release Tube 8CJMP ServClaim :\ Exit with service claimed B L\ -------------------- V\ Service call handler `\ -------------------- j .Service t8TAX:PHA:TYA:PHA:TXA :\ Save registers ~2CMP #&04:BEQ ServCommand :\ *command -CMP #&09:BEQ ServHelp :\ *Ǔ 0CMP #&07:BEQ ServOsbyte :\ OSBYTE  .ServExit ;PLA:TAY:PLA:LDX &F4 :\ Restore resisters RTS  \ --------- \ *commands \ --------- .ServCommand GJSR L81B7:BNE ServExit :\ If not 'ZNOS', exit unclaimed PLDA #&1D:JSR L81D8 :\ Copy CCP+BDOS+BIOS to second processor IJMP L822D :\ Enter Z80 at &F200 to cold boot   \ ----------------------- \ Check for 'ZNOS' string (\ ----------------------- 2 .L81B7 CMP #&0E:BEQ L81CE :\ If '.', exit matched  .L81D5 8LDA #&01:RTS :\ Exit unmatched  5\ ----------------------------------------------- -\ Copy ZNOS code over to second processor 5\ On entry, A=number of pages to copy, &08 or &1D \ CCP is &D800+&800 "\ CCP+BDOS+BIOS is &D800+&1D00 5\ -----------------------------------------------  .L81D8 >PHA:LDA #&EA :\ Save entry parameter :LDX #&00:LDY #&FF:JSR OSBYTE :\ Is Tube present? IINX:BEQ L81EE :\ Tube present, jump to copy code "=JSR L8057 :\ Display Z80 warning ,HPLA:PLA:PLA:JMP ServClaim :\ Clear stack and return claimed 6 @ .L81EE J@LDA #&C3:JSR &0406:BCC L81EE :\ Claim Tube with ID &03 T?LDA #&00:STA &AA:STA &AC:STA &AD :\ Set up copy addresses ^RLDA #&D8:STA &AB :\ &A8/9 =&8300 - source address in 6502 hVLDA #&00:STA &A8 :\ &AA/B/C/D=&D800 - destination address in Z80 rLDA #&83:STA &A9 |=PLA:TAX :\ Get number of pages  .L820B DTXA:PHA :\ Save number of pages to go  LDA #&07 LDY #&00:BEQ L8247 :\ Jump into print loop  .L8244 9JSR OSASCI :\ Print character  .L8247 ;INC &A8:BNE L824D:INC &A9 :\ Increment address  .L824D JLDA (&A8),Y:BNE L8244 :\ Get character, print if not zero BINC &A8:BNE L8257:INC &A9 :\ Increment before exiting  .L8257 CJMP (&00A8) :\ Jump to code after string   \ ------------------------ \ Find a language to enter  \ ------------------------ * .L825A 4 LDA #&AA >GLDX #&00:LDY #&FF:JSR OSBYTE :\ Get address of ROM type table HSTX &A8:STY &A9 R=LDY &F4 :\ Get this ROM number \ .L8269 f?DEY:BPL L826E :\ Not <0, jump to check pHLDY #&0F :\ ROM<0, check from 15 downwards z .L826E STYA:CMP &F4:BEQ L82A7 :\ Looped to this ROM, no more left to check OLDA (&A8),Y: #&40:BEQ L8269 :\ Not a language ROM, check next one down 9TYA:PHA :\ Save ROM number 8JSR L823A :\ Print message: 9EQUS "Alternative language selected:":EQUB 13:EQUB 13  EQUB 0 =PLA:TAX:LDA #&8E:JSR OSBYTE :\ Enter this language   .L82A7 8JSR L823A :\ Print message: .EQUS "No other language ROM found.":EQUB 0  .L82C7 =JMP L82C7 :\ Enter infinite loop   .L82CA \ left over data $SBC (&CD),Y . DEC &EF 8CMP (&30),Y B SBC &18 LLDA &D921,Y VSBC (&97),Y ` ASL &08 j .L82D9 t EQUB &77 ~ EQUB &23 BPL L82D9 CMP #&21 SBC (&F1,X) ROL &FF,X EQUB &23 ROL &06,X EQUB &EB CMP &E3CD (&E3,X) SBC (&C5),Y SBC &06 EQUB &3 .L82F1 ROR &03CD,X BBS 6,&77,&831A  BPL L82F1 (SBC (&C1,X) 2 CMP #&C5 < SBC &06 F EQUB &3 P .L8300 Z0\ &8300-&8AFF - CCP - copied to &D800-&DFFF d0\ &8B00-&xxFF - BDOS - copied to &E000-&F1FF n0\ &8x00-&9FFF - BIOS - copied to &F200-&F4FF x]: <" *SAVE ZNOS6502 ";~mcode%;" ";~O%;" FFFF0000 FFFBBC00"