Z80 Macro Assembler ZMA v1.0.15
=====================================================
Programmed by t.hara

<< code >>
[	ORG DRAM_CODE_ADDRESS]
	code address: 0x000000

[BEGIN_OF_CODE :]
	label address: 0x000000

[	DI] Z80:5cyc, R800:2cyc
000000: f3

[INIT_SWITCH_IO ::]
	global label address: 0x000001

[	LD A , EXP_IO_1CHIPMSX_ID] Z80:8cyc, R800:2cyc
000001: 3e d4

[	OUT [ EXP_IO_VENDOR_ID_PORT ] , A] Z80:12cyc, R800:10 or 9cyc
000003: d3 40

[	INCLUDE ".//../subroutine/ocm_iplrom_preloader.asm"] begin
[	SCOPE INIT_PRELOADER]
	Scope path: INIT_PRELOADER:

[INIT_PRELOADER ::]
	global label address: 0x000005

[	LD A , 0X60] Z80:8cyc, R800:2cyc
000005: 3e 60

[	LD [ ESERAM8K_BANK0 ] , A] Z80:14cyc, R800:6cyc
000007: 32 00 60

[	INC A] Z80:5cyc, R800:1cyc
00000a: 3c

[	LD [ MEGASD_MODE_REGISTER ] , A] Z80:14cyc, R800:6cyc
00000b: 32 00 58

[	LD B , 160] Z80:8cyc, R800:2cyc
00000e: 06 a0

[DUMMY_READ0 :]
	label address: 0x000010

[	LD A , [ MEGASD_SD_REGISTER | ( 1 << 12 ) ]] Z80:14cyc, R800:6cyc
000010: 3a 00 50

[	NOP] Z80:5cyc, R800:1cyc
000013: 00

[	DJNZ DUMMY_READ0] Z80:14cyc(cond=true), 9cyc(cond=false), R800:3cyc(cond=true), 2cyc(cond=false)
000014: 10 fa

[	LD A , [ MEGASD_SD_REGISTER | ( 0 << 12 ) ]] Z80:14cyc, R800:6cyc
000016: 3a 00 40

[	XOR A , A] Z80:5cyc, R800:1cyc
000019: af

[	LD [ MEGASD_MODE_REGISTER ] , A] Z80:14cyc, R800:6cyc
00001a: 32 00 58

[	LD A , IPLROM_BANK] Z80:8cyc, R800:2cyc
00001d: 3e ff

[	LD [ ESERAM8K_BANK3 ] , A] Z80:14cyc, R800:6cyc
00001f: 32 00 78

[	LD B , LOADING_ATTEMPTS] Z80:8cyc, R800:2cyc
000022: 06 10

[NEW_ATTEMPT :]
	label address: 0x000024

[	PUSH BC] Z80:12cyc, R800:6cyc
000024: c5

[	LD DE , TARGET_SECTOR_NUMBER] Z80:11cyc, R800:3cyc
000025: 11 fa 07

[	LD HL , DESTINATION_ADDRESS] Z80:11cyc, R800:3cyc
000028: 21 00 b4

[	LD B , NUMBER_OF_SECTORS] Z80:8cyc, R800:2cyc
00002b: 06 03

[	CALL READ_SECTOR_FROM_EPCS] Z80:18cyc, R800:5cyc
00002d: cd 83 00

[	POP BC] Z80:11cyc, R800:5cyc
000030: c1

[	JR C , LOADING_ERROR] Z80:13cyc(cond=true), 8cyc(cond=false), R800:3cyc(cond=true), 2cyc(cond=false)
000031: 38 0a

[	LD A , [ DESTINATION_ADDRESS ]] Z80:14cyc, R800:6cyc
000033: 3a 00 b4

[	CP A , 0XF3] Z80:8cyc, R800:2cyc
000036: fe f3

[	JR NZ , LOADING_ERROR] Z80:13cyc(cond=true), 8cyc(cond=false), R800:3cyc(cond=true), 2cyc(cond=false)
000038: 20 03

[	JP DESTINATION_ADDRESS] Z80:11cyc, R800:5cyc
00003a: c3 00 b4

[LOADING_ERROR :]
	label address: 0x00003d

[	DJNZ NEW_ATTEMPT] Z80:14cyc(cond=true), 9cyc(cond=false), R800:3cyc(cond=true), 2cyc(cond=false)
00003d: 10 e5

[	ENDSCOPE]
	Scope path: 

[	INCLUDE ".//../subroutine/ocm_iplrom_preloader.asm"] end

[	INCLUDE ".//../subroutine/ocm_iplrom_vdp.asm"] begin
[	SCOPE INIT_VDP]
	Scope path: INIT_VDP:

[INIT_VDP ::]
	global label address: 0x00003f

[	LD HL , VDP_CONTROL_REGS] Z80:11cyc, R800:3cyc
00003f: 21 a9 00

[	LD BC , ( ( VDP_CONTROL_REGS_END - VDP_CONTROL_REGS ) << 8 ) | VDP_PORT1] Z80:11cyc, R800:3cyc
000042: 01 99 10

[	OTIR] Z80:23 or 18cyc, R800:? or 12 or 11cyc
000045: ed b3

[	LD BC , ( ( VDP_MSX1_PALETTE_REGS_END - VDP_MSX1_PALETTE_REGS ) << 8 ) | VDP_PORT2] Z80:11cyc, R800:3cyc
000047: 01 9a 20

[	OTIR] Z80:23 or 18cyc, R800:? or 12 or 11cyc
00004a: ed b3

[	DEC C] Z80:5cyc, R800:1cyc
00004c: 0d

[	XOR A , A] Z80:5cyc, R800:1cyc
00004d: af

[	LD D , 0X20] Z80:8cyc, R800:2cyc
00004e: 16 20

[LOOP1 :]
	label address: 0x000050

[	OUT [ VDP_PORT0 ] , A] Z80:12cyc, R800:10 or 9cyc
000050: d3 98

[	DJNZ LOOP1] Z80:14cyc(cond=true), 9cyc(cond=false), R800:3cyc(cond=true), 2cyc(cond=false)
000052: 10 fc

[	DEC D] Z80:5cyc, R800:1cyc
000054: 15

[	JR NZ , LOOP1] Z80:13cyc(cond=true), 8cyc(cond=false), R800:3cyc(cond=true), 2cyc(cond=false)
000055: 20 f9

[	LD DE , 0X8140] Z80:11cyc, R800:3cyc
000057: 11 40 81

[	OUT [ C ] , E] Z80:14cyc, R800:10 or 9cyc
00005a: ed 59

[	OUT [ C ] , D] Z80:14cyc, R800:10 or 9cyc
00005c: ed 51

[	LD B , 32] Z80:8cyc, R800:2cyc
00005e: 06 20

[	LD A , 0XF0] Z80:8cyc, R800:2cyc
000060: 3e f0

[LOOP2 :]
	label address: 0x000062

[	OUT [ VDP_PORT0 ] , A] Z80:12cyc, R800:10 or 9cyc
000062: d3 98

[	DJNZ LOOP2] Z80:14cyc(cond=true), 9cyc(cond=false), R800:3cyc(cond=true), 2cyc(cond=false)
000064: 10 fc

[	LD D , 1 * 8] Z80:8cyc, R800:2cyc
000066: 16 08

[	OUT [ C ] , D] Z80:14cyc, R800:10 or 9cyc
000068: ed 51

[	OUT [ C ] , E] Z80:14cyc, R800:10 or 9cyc
00006a: ed 59

[	DEC C] Z80:5cyc, R800:1cyc
00006c: 0d

[	LD B , ICON_PATTERN_END - ICON_PATTERN] Z80:8cyc, R800:2cyc
00006d: 06 20

[	OTIR] Z80:23 or 18cyc, R800:? or 12 or 11cyc
00006f: ed b3

[	ENDSCOPE]
	Scope path: 

[	INCLUDE ".//../subroutine/ocm_iplrom_vdp.asm"] end

[	LD A , ICON_ERROR] Z80:8cyc, R800:2cyc
000071: 3e 01

[STOP_WITH_ERROR ::]
	global label address: 0x000073

[	CALL VDP_PUT_ICON] Z80:18cyc, R800:5cyc
000073: cd f9 00

[	LD A , 0X35] Z80:8cyc, R800:2cyc
000076: 3e 35

[	OUT [ 0X41 ] , A] Z80:12cyc, R800:10 or 9cyc
000078: d3 41

[	LD A , 0X1F] Z80:8cyc, R800:2cyc
00007a: 3e 1f

[	OUT [ 0X41 ] , A] Z80:12cyc, R800:10 or 9cyc
00007c: d3 41

[	LD A , 0X23] Z80:8cyc, R800:2cyc
00007e: 3e 23

[	OUT [ 0X41 ] , A] Z80:12cyc, R800:10 or 9cyc
000080: d3 41

[	HALT] Z80:5cyc, R800:2cyc and wait interrupt
000082: 76

[	INCLUDE ".//../subroutine/ocm_iplrom_serial_rom.asm"] begin
[	SCOPE READ_SECTOR_FROM_EPCS]
	Scope path: READ_SECTOR_FROM_EPCS:

[READ_SECTOR_FROM_EPCS ::]
	global label address: 0x000083

[	PUSH DE] Z80:12cyc, R800:6cyc
000083: d5

[	EX DE , HL] Z80:5cyc, R800:1cyc
000084: eb

[	ADD HL , HL] Z80:12cyc, R800:1cyc
000085: 29

[	EX DE , HL] Z80:5cyc, R800:1cyc
000086: eb

[	XOR A , A] Z80:5cyc, R800:1cyc
000087: af

[	LD C , B] Z80:5cyc, R800:2cyc
000088: 48

[	LD B , A] Z80:5cyc, R800:2cyc
000089: 47

[	PUSH BC] Z80:12cyc, R800:6cyc
00008a: c5

[	PUSH HL] Z80:12cyc, R800:6cyc
00008b: e5

[	LD HL , MEGASD_SD_REGISTER | ( 0 << 12 )] Z80:11cyc, R800:3cyc
00008c: 21 00 40

[	LD [ HL ] , EPCS_READ_BYTES] Z80:11cyc, R800:5cyc
00008f: 36 03

[	LD [ HL ] , D] Z80:8cyc, R800:4cyc
000091: 72

[	LD [ HL ] , E] Z80:8cyc, R800:4cyc
000092: 73

[	LD [ HL ] , A] Z80:8cyc, R800:4cyc
000093: 77

[	CP A , [ HL ]] Z80:8cyc, R800:4cyc
000094: be

[	POP DE] Z80:11cyc, R800:5cyc
000095: d1

[	LD A , C] Z80:5cyc, R800:2cyc
000096: 79

[	LD C , B] Z80:5cyc, R800:2cyc
000097: 48

[READ_ALL :]
	label address: 0x000098

[	PUSH HL] Z80:12cyc, R800:6cyc
000098: e5

[	LD B , 2] Z80:8cyc, R800:2cyc
000099: 06 02

[	LDIR] Z80:23cyc(BC!=0), 18cyc(BC=0), R800:?cyc(BC!=0), 7cyc(BC=0)
00009b: ed b0

[	POP HL] Z80:11cyc, R800:5cyc
00009d: e1

[	DEC A] Z80:5cyc, R800:1cyc
00009e: 3d

[	JR NZ , READ_ALL] Z80:13cyc(cond=true), 8cyc(cond=false), R800:3cyc(cond=true), 2cyc(cond=false)
00009f: 20 f7

[	LD A , [ MEGASD_SD_REGISTER | ( 1 << 12 ) ]] Z80:14cyc, R800:6cyc
0000a1: 3a 00 50

[	POP HL] Z80:11cyc, R800:5cyc
0000a4: e1

[	POP DE] Z80:11cyc, R800:5cyc
0000a5: d1

[	ADD HL , DE] Z80:12cyc, R800:1cyc
0000a6: 19

[	EX DE , HL] Z80:5cyc, R800:1cyc
0000a7: eb

[	RET] Z80:11cyc, R800:5cyc
0000a8: c9

[	ENDSCOPE]
	Scope path: 

[	INCLUDE ".//../subroutine/ocm_iplrom_serial_rom.asm"] end

[	INCLUDE ".//../subroutine/ocm_iplrom_vdp_preloader_icon.asm"] begin
[VDP_CONTROL_REGS ::]
	global label address: 0x0000a9

[	DB 0X1800 >> 10 , 0X82]
0000a9: 06 82

[	DB 0X2000 >> 6 , 0X83]
0000ab: 80 83

[	DB 0X0000 >> 11 , 0X84]
0000ad: 00 84

[	DB 0X1B00 >> 7 , 0X85]
0000af: 36 85

[	DB 0X00 , 0X86]
0000b1: 00 86

[	DB 0XF1 , 0X87]
0000b3: f1 87

[	DB 0X00 , 0X8B]
0000b5: 00 8b

[	DB 0X00 , 0X40]
0000b7: 00 40

[VDP_CONTROL_REGS_END ::]
	global label address: 0x0000b9

[VDP_MSX1_PALETTE_REGS ::]
	global label address: 0x0000b9

[	DB 0X00 , 0X00]
0000b9: 00 00

[	DB 0X00 , 0X00]
0000bb: 00 00

[	DB 0X22 , 0X06]
0000bd: 22 06

[	DB 0X34 , 0X07]
0000bf: 34 07

[	DB 0X37 , 0X03]
0000c1: 37 03

[	DB 0X47 , 0X04]
0000c3: 47 04

[	DB 0X53 , 0X03]
0000c5: 53 03

[	DB 0X47 , 0X06]
0000c7: 47 06

[	DB 0X63 , 0X03]
0000c9: 63 03

[	DB 0X64 , 0X04]
0000cb: 64 04

[	DB 0X63 , 0X06]
0000cd: 63 06

[	DB 0X65 , 0X06]
0000cf: 65 06

[	DB 0X11 , 0X05]
0000d1: 11 05

[	DB 0X56 , 0X03]
0000d3: 56 03

[	DB 0X66 , 0X06]
0000d5: 66 06

[	DB 0X77 , 0X07]
0000d7: 77 07

[VDP_MSX1_PALETTE_REGS_END ::]
	global label address: 0x0000d9

[ICON_PATTERN ::]
	global label address: 0x0000d9

[	DB 0X49 , 0X49 , 0XFF , 0XFF , 0XFF , 0XFF , 0XFF , 0XBF]
0000d9: 49 49 ff ff ff ff ff bf

[	DB 0X20 , 0X20 , 0XF0 , 0XF0 , 0XF0 , 0XF0 , 0XF0 , 0XF0]
0000e1: 20 20 f0 f0 f0 f0 f0 f0

[	DB 0XFF , 0X49 , 0X49 , 0X00 , 0X02 , 0X07 , 0X0F , 0X1F]
0000e9: ff 49 49 00 02 07 0f 1f

[	DB 0XF0 , 0X20 , 0X20 , 0X00 , 0X00 , 0X00 , 0X80 , 0XC0]
0000f1: f0 20 20 00 00 00 80 c0

[ICON_PATTERN_END ::]
	global label address: 0x0000f9

[	SCOPE VDP_PUT_ICON]
	Scope path: VDP_PUT_ICON:

[VDP_PUT_ICON ::]
	global label address: 0x0000f9

[	LD HL , 0X1801 | 0X4000] Z80:11cyc, R800:3cyc
0000f9: 21 01 58

[	CALL SUB_CODE] Z80:18cyc, R800:5cyc
0000fc: cd 01 01

[	LD L , 33] Z80:8cyc, R800:2cyc
0000ff: 2e 21

[SUB_CODE :]
	label address: 0x000101

[	LD C , VDP_PORT1] Z80:8cyc, R800:2cyc
000101: 0e 99

[	OUT [ C ] , L] Z80:14cyc, R800:10 or 9cyc
000103: ed 69

[	OUT [ C ] , H] Z80:14cyc, R800:10 or 9cyc
000105: ed 61

[	OUT [ VDP_PORT0 ] , A] Z80:12cyc, R800:10 or 9cyc
000107: d3 98

[	INC A] Z80:5cyc, R800:1cyc
000109: 3c

[	OUT [ VDP_PORT0 ] , A] Z80:12cyc, R800:10 or 9cyc
00010a: d3 98

[	INC A] Z80:5cyc, R800:1cyc
00010c: 3c

[	RET] Z80:11cyc, R800:5cyc
00010d: c9

[	ENDSCOPE]
	Scope path: 

[	INCLUDE ".//../subroutine/ocm_iplrom_vdp_preloader_icon.asm"] end

[END_OF_CODE :]
	label address: 0x00010e

[IF ( END_OF_CODE - BEGIN_OF_CODE ) > 512]

[ELSE]

MESSAGE: Size is not a problem. (270byte): ../hex_iplrom_512k_rev300_preloader.asm(109)
[ENDIF]
	Selected {ELSE} block.


<< label >>
BEGIN_OF_CODE 0 ( 0x0 )
DESTINATION_ADDRESS 46080 ( 0xb400 )
DRAM_CODE_ADDRESS 0 ( 0x0 )
END_OF_CODE 270 ( 0x10e )
EPCS_ERASE_BULK 199 ( 0xc7 )
EPCS_ERASE_SECTOR 216 ( 0xd8 )
EPCS_FAST_READ 11 ( 0xb )
EPCS_READ_BYTES 3 ( 0x3 )
EPCS_READ_DEVICE_ID 159 ( 0x9f )
EPCS_READ_SILICON_ID 171 ( 0xab )
EPCS_READ_STATUS 5 ( 0x5 )
EPCS_WRITE_BYTES 2 ( 0x2 )
EPCS_WRITE_DISABLE 4 ( 0x4 )
EPCS_WRITE_ENABLE 6 ( 0x6 )
EPCS_WRITE_STATUS 1 ( 0x1 )
ESERAM8K_BANK0 24576 ( 0x6000 )
ESERAM8K_BANK3 30720 ( 0x7800 )
EXP_IO_1CHIPMSX_ID 212 ( 0xd4 )
EXP_IO_VENDOR_ID_PORT 64 ( 0x40 )
ICON_ERROR 1 ( 0x1 )
ICON_PATTERN 217 ( 0xd9 )
ICON_PATTERN_END 249 ( 0xf9 )
INIT_PRELOADER 5 ( 0x5 )
INIT_PRELOADER:DUMMY_READ0 16 ( 0x10 )
INIT_PRELOADER:LOADING_ERROR 61 ( 0x3d )
INIT_PRELOADER:NEW_ATTEMPT 36 ( 0x24 )
INIT_SWITCH_IO 1 ( 0x1 )
INIT_VDP 63 ( 0x3f )
INIT_VDP:LOOP1 80 ( 0x50 )
INIT_VDP:LOOP2 98 ( 0x62 )
IPLROM_BANK 255 ( 0xff )
LOADING_ATTEMPTS 16 ( 0x10 )
MEGASD_MODE_REGISTER 22528 ( 0x5800 )
MEGASD_SD_REGISTER 16384 ( 0x4000 )
NUMBER_OF_SECTORS 3 ( 0x3 )
READ_SECTOR_FROM_EPCS 131 ( 0x83 )
READ_SECTOR_FROM_EPCS:READ_ALL 152 ( 0x98 )
STOP_WITH_ERROR 115 ( 0x73 )
TARGET_SECTOR_NUMBER 2042 ( 0x7fa )
VDP_CONTROL_REGS 169 ( 0xa9 )
VDP_CONTROL_REGS_END 185 ( 0xb9 )
VDP_MSX1_PALETTE_REGS 185 ( 0xb9 )
VDP_MSX1_PALETTE_REGS_END 217 ( 0xd9 )
VDP_PORT0 152 ( 0x98 )
VDP_PORT1 153 ( 0x99 )
VDP_PORT2 154 ( 0x9a )
VDP_PORT3 155 ( 0x9b )
VDP_PUT_ICON 249 ( 0xf9 )
VDP_PUT_ICON:SUB_CODE 257 ( 0x101 )
