Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEFINE ProgramSize, 512
- DEFINE ProgramPage, 512
- DEFINE DefaultConsoleScreenAddress, 100000
- DEFINE DefaultKeyBoardAddress, (65536+200000)-512
- DEFINE ROMAddress, 65536
- MOV ESI, loading //outputs loading
- CALL writemsg //calls write message
- //begin load
- OUT 1, ROMAddress
- MOV EAX, ROMAddress
- MOV EBX, ProgramPage
- //SRL 1, 1
- startload:
- MOV #EBX, #EAX //swap byte
- INC EAX //next byte
- INC EBX //next byte
- INC ECX //byte counter
- OUT 0, ECX //debug
- OUT 1, #EAX //debug
- CMP ECX, ProgramSize //if count is lower than program size
- JL startload //do it again
- //CMP #EAX, 0 //TEST. Remove if not working!
- //JNE startload
- //end load
- MOV ESI, loaddone //outputs load is finished
- CLI
- CALL writemsg //calls write message
- //CPUSET 46, 10000
- MOV DS, ProgramPage
- MOV SS, (ProgramPage+128)
- //checkanykey:
- //CMP #DefaultKeyBoardAddress, 0
- //JE checkanykey
- CALLF 0, ProgramPage //goto boot program when key is pressed
- //write message function
- writemsg:
- MOV EAX, 65536
- ADD EAX, DefaultConsoleScreenAddress
- MOV [EAX+2041], 1//Clear
- MOV [EAX+2042], 000
- //MOV ESI, message
- nextchar:
- MOV #EAX, #ESI
- INC EAX
- MOV #EAX, 000999
- INC EAX
- INC ESI
- CMP #ESI, 0
- JNE nextchar
- RET
- //presets
- loading: db 'Loading program... \n', 0; //21
- loaddone: db 'loading finished. Running program...', 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement