tunozemichanの日記 / tunozemichan's diary

SORD社のコンピューターM68やM68MXの解析についての備忘録です。This blog is a memorandum about the analysis of SORD's computers M68 and M68MX.

Porting CP/M-80 to SORD M68 (Part 3 : concluding part)

The final step is to write the disk write routine.

In the CP/M-80 with blocking/deblocking code, the disk write routine is a "writehst" routine.

Basically, the same code as the disk read routine can be used. The only difference is the command number.

The biggest problem is how to write commands to the DMA? Without the documentation ("X1 on the exam"), it would have been impossible to implement on our own. Below is the DMA command chain used for the SORD M68 disk write routine.

 

DMA_WRITE_COMMANDS:
    DB 16H
    DB 0C3H,0C3H,0C3H,0C3H,0C3H,0C3H
    DB 83H
    DB 79H
    DB 022H,0F6H ; host buffer address
    DB 00H,0FFH ; byte number of transfer
    DB 14H,28H,8DH
    DB 0CBH,00H ; FDC data register
    DB 9AH
    DB 0CFH,05H
    DB 0CFH,87H
 

 

It will not work correctly without the two commands (0CFH,05H) on the second line from the bottom. This section is firmly in the "X1 on the exam". Also, I found "Z80DMA Command Code Generator Z80DMA Command Generator 2019.6.19" very useful on the net. The trick to using this service is to "click the buttons that are marked by default properly". In my case, otherwise I did not get 0CFH,05H. This is a point to get stuck on.

Translated with www.DeepL.com/Translator (free version)

 

In addition, the DMA command chain for reading floppy disks is noted.

DMA_COMMANDS:
    DB 15H
    DB 0C3H,0C3H,0C3H,0C3H,0C3H,0C3H
    DB 0BBH,01H,0BFH
    DB 6DH
    DB 0CBH,0FFH,00H,02CH,010H,08DH
    DB 022H,0F6H ; host buffer address
    DB 9AH
    DB 0CFH,87H
 

 

This completes the porting of the CP/M-80 to the SORD M68. Thank you for reading.