# File boot_loader.asm 0000 ;Minimal boot loader for system with ROM v. 6 and lower. 0000 ;Enter bytes on input port switches using Program_loader. 0000 ;Includes port initialization commands. 0000 ;When runs, will load 256 bytes from serial port into memory at 0900h and jump there. 0000 org 0800h ;org not necessary, all jumps relative 0800 3e 4e ld a,04eh ;1 stop bit, no parity, 8-bit char, 16x baud 0802 d3 03 out (3),a ;write to control port 0804 3e 37 ld a,037h ;enable receive and transmit 0806 d3 03 out (3),a ;write to control port 0808 21 00 09 ld hl,0900h ;where to put received code 080b 06 ff ld b,0ffh ;number of bytes to receive 080d db 03 boot_receive_loop: in a,(3) ;get status 080f e6 02 and 002h ;check Rx ready bit 0811 28 fa jr z,boot_receive_loop ;not ready, loop 0813 db 02 in a,(2) ;ready, get byte 0815 77 ld (hl),a ;store in memory 0816 23 inc hl ;point to next location 0817 10 f4 djnz boot_receive_loop ;keep going 0819 c3 00 09 jp 0900h ;done, jump to received code block 081c # End of file boot_loader.asm 081c