Difference between revisions of "Graduate Software"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
(Notes)
(Notes)
Line 67: Line 67:
 
  ;; HL = address of directory entry
 
  ;; HL = address of directory entry
 
  ;; A = rom number
 
  ;; A = rom number
  0070 32be3f    ld      (3fbeh),a ;; ROM number store to RAM
+
  3f70 32be3f    ld      (3fbeh),a ;; ROM number store to RAM
  0073 e5        push    hl
+
  3f73 e5        push    hl
  0074 dde1      pop    ix
+
  3f74 dde1      pop    ix
  0076 2afefb    ld      hl,(0fbfeh)  
+
  3f76 2afefb    ld      hl,(0fbfeh)  
  0079 113400    ld      de,0034h
+
  3f79 113400    ld      de,0034h
  007c 19        add    hl,de
+
  3f7c 19        add    hl,de
  007d 118c3f    ld      de,3f8ch ;; address to call to load file from ROM
+
  3f7d 118c3f    ld      de,3f8ch ;; address to call to load file from ROM
  0080 73        ld      (hl),e
+
  3f80 73        ld      (hl),e
  0081 23        inc    hl
+
  3f81 23        inc    hl
  0082 72        ld      (hl),d
+
  3f82 72        ld      (hl),d
  0083 2afefb    ld      hl,(0fbfeh)  
+
  3f83 2afefb    ld      hl,(0fbfeh)  
  0086 111000    ld      de,0010h
+
  3f86 111000    ld      de,0010h
  0089 0e3b      ld      c,3bh
+
  3f89 0e3b      ld      c,3bh
  008b e9        jp      (hl)
+
  3f8b e9        jp      (hl)
  
  008c dd6e00    ld      l,(ix+00h) ;; load address
+
  ;; load file from ROM into RAM
  008f dd6601    ld      h,(ix+01h)
+
3f8c dd6e00    ld      l,(ix+00h) ;; load address
  0092 dd4e02    ld      c,(ix+02h) ;; length
+
  3f8f dd6601    ld      h,(ix+01h)
  0095 dd4603    ld      b,(ix+03h)
+
  3f92 dd4e02    ld      c,(ix+02h) ;; length
  0098 110001    ld      de,0100h  ;; load address for .COM file
+
  3f95 dd4603    ld      b,(ix+03h)
  009b cdbf3f    call    3fbfh      ;; read byte from rom
+
  3f98 110001    ld      de,0100h  ;; load address for .COM file
  009e 12        ld      (de),a    ;; write to memory
+
  3f9b cdbf3f    call    3fbfh      ;; read byte from rom
  009f 13        inc    de
+
  3f9e 12        ld      (de),a    ;; write to memory
  00a0 23        inc    hl
+
  3f9f 13        inc    de
  00a1 0b        dec    bc
+
  3fa0 23        inc    hl
  00a2 79        ld      a,c
+
  3fa1 0b        dec    bc
  00a3 b0        or      b
+
  3fa2 79        ld      a,c
  00a4 20f5      jr      nz,009bh
+
  3fa3 b0        or      b
 +
  3fa4 20f5      jr      nz,009bh
  
  00a6 1eff      ld      e,0ffh ;; error code in H
+
  3fa6 1eff      ld      e,0ffh ;; error code in H
  00a8 0e2d      ld      c,2dh  ;; F_ERRMODE - set action on hardware error
+
  3fa8 0e2d      ld      c,2dh  ;; F_ERRMODE - set action on hardware error
  00aa cd0500    call    0005h
+
  3faa cd0500    call    0005h ;; call BDOS
  00ad 3aaffb    ld      a,(0fbafh)
+
  3fad 3aaffb    ld      a,(0fbafh)
  00b0 5f        ld      e,a
+
  3fb0 5f        ld      e,a
  00b1 0e0e      ld      c,0eh ;; select disc
+
  3fb1 0e0e      ld      c,0eh ;; select disc
  00b3 cd0500    call    0005h
+
  3fb3 cd0500    call    0005h ;; call BDOS
  00b6 1e00      ld      e,00h
+
  3fb6 1e00      ld      e,00h
  00b8 0e2d      ld      c,2dh ;; F_ERRMODE - set action on hardware error
+
  3fb8 0e2d      ld      c,2dh ;; F_ERRMODE - set action on hardware error
  00ba cd0500    call    0005h
+
  3fba cd0500    call    0005h ;; call BDOS
  00bd c9        ret     
+
  3fbd c9        ret     
 
   
 
   
  00be 00        nop    ;; storage for ROM number
+
  3fbe 00        nop    ;; storage for ROM number
  
 
  ;; read byte from ROM
 
  ;; read byte from ROM
  00bf c5        push    bc
+
  3fbf c5        push    bc
  00c0 3abe3f    ld      a,(3fbeh)
+
  3fc0 3abe3f    ld      a,(3fbeh)
  00c3 4f        ld      c,a
+
  3fc3 4f        ld      c,a
  00c4 cdc93f    call    3fc9h
+
  3fc4 cdc93f    call    3fc9h
  00c7 c1        pop    bc
+
  3fc7 c1        pop    bc
  00c8 c9        ret       
+
  3fc8 c9        ret       
  
 
  ;; HL = address to read from ROM
 
  ;; HL = address to read from ROM
 
  ;; C = rom number
 
  ;; C = rom number
 
  ;; BC' = 7F80 port number
 
  ;; BC' = 7F80 port number
  00c9 f3        di       
+
  3fc9 f3        di       
  00ca c5        push    bc
+
  3fca c5        push    bc
  00cb d9        exx     
+
  3fcb d9        exx     
  00cc cb99      res    3,c  ;; enable upper rom
+
  3fcc cb99      res    3,c  ;; enable upper rom
  00ce ed49      out    (c),c
+
  3fce ed49      out    (c),c
  00d0 d9        exx     
+
  3fd0 d9        exx     
  00d1 06df      ld      b,0dfh ;; select ROM
+
  3fd1 06df      ld      b,0dfh ;; select ROM
  00d3 ed49      out    (c),c
+
  3fd3 ed49      out    (c),c
  00d5 7e        ld      a,(hl) ;; read byte from ROM
+
  3fd5 7e        ld      a,(hl) ;; read byte from ROM
  00d6 d9        exx     
+
  3fd6 d9        exx     
  00d7 cbd9      set    3,c    ;; disable upper rom
+
  3fd7 cbd9      set    3,c    ;; disable upper rom
  00d9 ed49      out    (c),c
+
  3fd9 ed49      out    (c),c
  00db d9        exx     
+
  3fdb d9        exx     
  00dc fb        ei       
+
  3fdc fb        ei       
  00dd c1        pop    bc
+
  3fdd c1        pop    bc
  00de c9        ret     
+
  3fde c9        ret     
  
 
;; used?
 
;; used?
 
;; BC = 7F8x with bit 3 clear. bits 1,0 are mode.
 
;; BC = 7F8x with bit 3 clear. bits 1,0 are mode.
 
;; HL = address to read from ROM
 
;; HL = address to read from ROM
  00df ed49      out    (c),c ;; must enable ROM
+
  3fdf ed49      out    (c),c ;; must enable ROM
  00e1 d9        exx     
+
  3fe1 d9        exx     
  00e2 06df      ld      b,0dfh ;; select ROM
+
  3fe2 06df      ld      b,0dfh ;; select ROM
  00e4 ed49      out    (c),c
+
  3fe4 ed49      out    (c),c
  00e6 7e        ld      a,(hl) ;; read from rom
+
  3fe6 7e        ld      a,(hl) ;; read from rom
  00e7 d9        exx     
+
  3fe7 d9        exx     
  00e8 cbd9      set    3,c  ;; disable ROM again
+
  3fe8 cbd9      set    3,c  ;; disable ROM again
  00ea ed49      out    (c),c
+
  3fea ed49      out    (c),c
  00ec d9        exx     
+
  3fec d9        exx     
  00ed fb        ei       
+
  3fed fb        ei       
  00ee c1        pop    bc
+
  3fee c1        pop    bc
  00ef c9        ret   
+
  3fef c9        ret   
  
 
3. Up to 16 files can be defined. Each file takes 1 entry. Unused entries are filled with &FF.
 
3. Up to 16 files can be defined. Each file takes 1 entry. Unused entries are filled with &FF.

Revision as of 11:03, 28 April 2018

Graduate software provided a version of CP/M+ on ROM.

Additional 'utility' roms contained CP/M programs installed on a ROM.

Structure of a utility ROM

Each ROM is 16KB and has the following structure:

Offset (Hex) Count Description
0 48 Description of ROM (note 1)
&30 208 Loading code (note 2)
&100 256 Directory (note 3)
&200 &3e00 Data area for files.

Each directory entry has the following structure:

Offset (Hex) Count Description
0 8 Filename (note 4)
8 1  ? (unknown &20)
9 2 address in ROM for start of data for file (note 3)
11 2 length in bytes of file
14 2 (unknown) &feff

Notes

1. Utility ROM 1 has this description: "Graduate (C)1988 CP/M Accessory Rom 1\r\n$VER 2.30 "

2. Code is copied from &c000-&c100 to &3f00-&4000 in RAM.

;; HL = address of directory entry
;; A = rom number
3f70 32be3f    ld      (3fbeh),a ;; ROM number store to RAM
3f73 e5        push    hl
3f74 dde1      pop     ix
3f76 2afefb    ld      hl,(0fbfeh) 
3f79 113400    ld      de,0034h
3f7c 19        add     hl,de
3f7d 118c3f    ld      de,3f8ch ;; address to call to load file from ROM
3f80 73        ld      (hl),e
3f81 23        inc     hl
3f82 72        ld      (hl),d
3f83 2afefb    ld      hl,(0fbfeh) 
3f86 111000    ld      de,0010h
3f89 0e3b      ld      c,3bh
3f8b e9        jp      (hl)
;; load file from ROM into RAM
3f8c dd6e00    ld      l,(ix+00h) ;; load address
3f8f dd6601    ld      h,(ix+01h)
3f92 dd4e02    ld      c,(ix+02h) ;; length
3f95 dd4603    ld      b,(ix+03h)
3f98 110001    ld      de,0100h   ;; load address for .COM file
3f9b cdbf3f    call    3fbfh      ;; read byte from rom
3f9e 12        ld      (de),a     ;; write to memory
3f9f 13        inc     de
3fa0 23        inc     hl
3fa1 0b        dec     bc
3fa2 79        ld      a,c
3fa3 b0        or      b
3fa4 20f5      jr      nz,009bh
3fa6 1eff      ld      e,0ffh ;; error code in H
3fa8 0e2d      ld      c,2dh  ;; F_ERRMODE - set action on hardware error
3faa cd0500    call    0005h  ;; call BDOS
3fad 3aaffb    ld      a,(0fbafh)
3fb0 5f        ld      e,a
3fb1 0e0e      ld      c,0eh ;; select disc
3fb3 cd0500    call    0005h  ;; call BDOS
3fb6 1e00      ld      e,00h
3fb8 0e2d      ld      c,2dh ;; F_ERRMODE - set action on hardware error
3fba cd0500    call    0005h ;; call BDOS
3fbd c9        ret     

3fbe 00        nop     ;; storage for ROM number
;; read byte from ROM
3fbf c5        push    bc
3fc0 3abe3f    ld      a,(3fbeh)
3fc3 4f        ld      c,a
3fc4 cdc93f    call    3fc9h
3fc7 c1        pop     bc
3fc8 c9        ret       
;; HL = address to read from ROM
;; C = rom number
;; BC' = 7F80 port number
3fc9 f3        di      
3fca c5        push    bc
3fcb d9        exx     
3fcc cb99      res     3,c   ;; enable upper rom
3fce ed49      out     (c),c
3fd0 d9        exx     
3fd1 06df      ld      b,0dfh ;; select ROM
3fd3 ed49      out     (c),c
3fd5 7e        ld      a,(hl) ;; read byte from ROM
3fd6 d9        exx     
3fd7 cbd9      set     3,c    ;; disable upper rom
3fd9 ed49      out     (c),c
3fdb d9        exx     
3fdc fb        ei      
3fdd c1        pop     bc
3fde c9        ret     
used?
BC = 7F8x with bit 3 clear. bits 1,0 are mode.
HL = address to read from ROM
3fdf ed49      out     (c),c ;; must enable ROM
3fe1 d9        exx     
3fe2 06df      ld      b,0dfh ;; select ROM
3fe4 ed49      out     (c),c
3fe6 7e        ld      a,(hl) ;; read from rom
3fe7 d9        exx     
3fe8 cbd9      set     3,c  ;; disable ROM again
3fea ed49      out     (c),c
3fec d9        exx     
3fed fb        ei      
3fee c1        pop     bc
3fef c9        ret   

3. Up to 16 files can be defined. Each file takes 1 entry. Unused entries are filled with &FF.

4. Filename is in upper case, 8 characters long, padded with spaces. '.COM' extension is assumed when accessed.

5. ROM starts at &c000. Therefore &c200 is the start of the first file.