Skip to content

Commit

Permalink
Send *HELP to all the ROMs
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanizag committed Aug 23, 2021
1 parent 8246dc7 commit 928dee0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Running BBC Basic:
$ ./bbz
bbz - Acorn MOS for 6502 adaptation layer, https://github.com/ivanizag/bbz
BASIC - (C)1982 Acorn
BASIC
>PRINT "HELLO"
HELLO
Expand All @@ -124,11 +124,11 @@ Log of the MOS calls (excluding the most verbose output API calls):
$ ./bbz -m ROMs/Forth_103.rom
bbz - Acorn MOS for 6502 adaptation layer, https://github.com/ivanizag/bbz
FORTH - (C) Acornsoft Ltd. 1983
FORTH
COLD or WARM start (C/W)? C
[[[OSRDCH()=0x43]]]
[[[OSARGS('Get filing system',A=00,Y=00)= 4]]]
[[[OSARGS('Get filing system',A=00,Y=00) => 105]]]
[[[OSBYTE82('Read machine high order address',X=0x58,Y=0x00) => (X=0xff,Y=0xff)]]]
[[[OSBYTE84('Read top of user mem',X=0x58,Y=0x00) => (X=0x00,Y=0x80)]]]
[[[OSBYTE83('Read bottom of user mem',X=0x58,Y=0x00) => (X=0x00,Y=0x0e)]]]
Expand All @@ -148,29 +148,42 @@ Using mode 7 colors:

Using several ROMs at once:
```
$ go run *.go -rom0 BASIC.ROM -rom1 ROMs/Forth_103.rom -rom2 ROMs/LISP-200.rom -rom3 ROMs/COMAL.rom
$ ./bbz -rom0 BASIC.ROM -rom1 ROMs/Forth_103.rom -rom2 ROMs/LISP501.ROM -rom3 ROMs/COMAL.rom -rom4 ROMs/MPROLOG310.rom
bbz - Acorn MOS for 6502 adaptation layer, https://github.com/ivanizag/bbz
(tip: uppercase is usually needed)
BASIC - (C)1982 Acorn
BASIC
>*HELP
bbz - Acorn MOS for 6502 adaptation layer, https://github.com/ivanizag/bbz
FORTH 1.03
LISP 5.01
COMAL
micro PROLOG 3.1
>*LISP
LISP - (C)1982 Acornsoft/1979 Owl Computers
LISP
Evaluate : (* '*FORTH)
FORTH - (C) Acornsoft Ltd. 1983
FORTH
COLD or WARM start (C/W)? C
FORTH
OK
OS' *COMAL'
COMAL - (C)Acorn
COMAL
→*BASIC
BASIC - (C)1982 Acorn
BASIC
>*PROLOGUE
micro PROLOG
29184 bytes free
&.
>
```
1 change: 0 additions & 1 deletion asm/firmware.s
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ CLITOROMS: tax ; Service call number
.asciiz "Bad command"
CTR_CLAIMED: rts


;*************************************************************************
;*
;* OSBYTE 143: Pass service commands to sideways ROMs
Expand Down
3 changes: 2 additions & 1 deletion constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ const (

// Support code on the firmware. Check firmware.lst when changing firmware.s
procServiceRoms uint16 = 0xf000
procOSBYTE_143 uint16 = 0xf015

// See http://beebwiki.mdfs.net/Service_calls
//serviceNoOperation uint8 = 0
serviceOSCLI uint8 = 4
serviceOSBYTE uint8 = 7
//serviceOSWORD uint8 = 8
//serviceHELP uint8 = 9
serviceHELP uint8 = 9

// Scratch area for errors in page 0xfa
errorArea uint16 = 0xfa00
Expand Down
2 changes: 1 addition & 1 deletion osByte.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func execOSBYTE(env *environment) {
env.mem.Poke(zpA, a)
env.mem.Poke(zpX, x)
env.mem.Poke(zpY, y)
newA = uint8(serviceOSBYTE)
newA = serviceOSBYTE
env.cpu.SetPC(procServiceRoms)
env.log(fmt.Sprintf("OSBYTE%02x_to_roms(X=0x%02x,Y=0x%02x)", a, x, y))
// procServiceRoms issues a 254-Bad command if the command is not handled by any ROM
Expand Down
8 changes: 6 additions & 2 deletions osCLI.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var cliCommands = []string{
}

func execOSCLI(env *environment) {
_, x, y, p := env.cpu.GetAXYP()
a, x, y, p := env.cpu.GetAXYP()

/*
This routine passes a line of text to the command line
Expand Down Expand Up @@ -128,7 +128,11 @@ func execOSCLI(env *environment) {
//case "EXEC":
case "HELP":
fmt.Println("\nbbz - Acorn MOS for 6502 adaptation layer, https://github.com/ivanizag/bbz")
// TODO: multiple ROMS: service call 9 after the MOS message

// Send to the other ROMS if available.
env.mem.pokeWord(zpStr, xy)
env.cpu.SetAXYP(a, serviceHELP, 1, p)
env.cpu.SetPC(procOSBYTE_143)

case "HOST":
if len(args) == 0 {
Expand Down

0 comments on commit 928dee0

Please sign in to comment.