!cpu 65el02
!al ;16-bit accumulator- need this to work with the MMU.
*=0x0500 ;set offset to 0x500
LDA #$0300 ;Redbus slave EMMW is allocated last 255 bytes of the RCU's internal memory
MMU #$03 ;Set slave window space to value in accumulator
LDA #$FF00 ;REDBUS master window is allocated the memory at the end of the address space- note that the window location doesn't have to be backed by any actual memory.
MMU #$01 ;Set master window
MMU #$03 ;Enable master window
MMU #$04 ;Enable EMMW
LDA .bootindicator ;Load the address of the bootindicator instructions into the accumulator.
MMU #$06 ;Instruct the computer to run the bootindicator instructions when the computer recieves a power-on reset (when the START button on the block is pressed while the computer is running)
.bootindicator ;This code indicates that the RCU is running properly by sending signals to the Rx circuitry (which merely flashes the Rx indicators)
LDA #$84 ;Load accumulator with address of Rx IO Expander
MMU #$00 ;Set active redbus device to address in the accumulator
LDA #$01 ;Start off by loading the accumulator with 1.
-WAI ;Pause execution for exactly one Minecraft tick (otherwise the bootindicator loop would finish too fast for the player to see it)
STA $FF02 ;Store the accumulator in the output buffer of the Rx IO Expander
ASL ;Bit-shift the accumulator leftwards by one, moving the true bit left, making it equal to the number that sets the next wire (multiplying it by 2)
CMP #$8000 ;See if the accumulator is 32768 yet.
BNE - ;Repeat if it isn't.
The above code... doesn't work. As in, it does nothing. I assembled it successfully, stuck it in the disk image, switched on the computer, and nothing happened. Putting other boot disks in the computer's drive lets it boot off them normally, so the problem has to be in the code. Sorry I can't provide more details, but the thing literally just sits there and does absolutely nothing. I've checked the ribbon cable connections and the address of the IO expander.
This is the second time I've ever worked with ASM, and the first time on this scale, so I've probably done something really stupid. Please forgive me if this is the case.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
The above code... doesn't work. As in, it does nothing. I assembled it successfully, stuck it in the disk image, switched on the computer, and nothing happened. Putting other boot disks in the computer's drive lets it boot off them normally, so the problem has to be in the code. Sorry I can't provide more details, but the thing literally just sits there and does absolutely nothing. I've checked the ribbon cable connections and the address of the IO expander.
This is the second time I've ever worked with ASM, and the first time on this scale, so I've probably done something really stupid. Please forgive me if this is the case.