Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DEFINE ProgramSize, 512
  2. DEFINE ProgramPage, 512
  3.  
  4. DEFINE  DefaultConsoleScreenAddress, 100000
  5. DEFINE  DefaultKeyBoardAddress, (65536+200000)-512
  6. DEFINE  ROMAddress, 65536
  7.  
  8.     MOV ESI, loading //outputs loading
  9.     CALL writemsg //calls write message
  10.    
  11. //begin load    
  12.     OUT 1, ROMAddress
  13.     MOV EAX, ROMAddress
  14.     MOV EBX, ProgramPage
  15.     //SRL 1, 1
  16. startload:
  17.     MOV #EBX, #EAX //swap byte
  18.     INC EAX //next byte
  19.     INC EBX //next byte
  20.     INC ECX //byte counter
  21.     OUT 0, ECX //debug
  22.     OUT 1, #EAX //debug
  23.     CMP ECX, ProgramSize //if count is lower than program size
  24.     JL startload //do it again
  25.     //CMP #EAX, 0 //TEST. Remove if not working!
  26.     //JNE startload
  27. //end load
  28.     MOV ESI, loaddone //outputs load is finished
  29.     CLI
  30.     CALL writemsg //calls write message
  31.     //CPUSET 46, 10000
  32.     MOV DS, ProgramPage
  33.     MOV SS, (ProgramPage+128)
  34.    
  35. //checkanykey:
  36.     //CMP #DefaultKeyBoardAddress, 0
  37.     //JE checkanykey
  38.     CALLF 0, ProgramPage //goto boot program when key is pressed
  39.    
  40.  
  41. //write message function
  42. writemsg:
  43.     MOV EAX, 65536
  44.     ADD EAX, DefaultConsoleScreenAddress
  45.     MOV [EAX+2041], 1//Clear
  46.     MOV [EAX+2042], 000
  47.     //MOV ESI, message
  48. nextchar:
  49.     MOV #EAX, #ESI
  50.     INC EAX
  51.     MOV #EAX, 000999
  52.     INC EAX
  53.     INC ESI
  54.     CMP #ESI, 0
  55.     JNE nextchar
  56. RET  
  57.  
  58. //presets
  59. loading: db 'Loading program... \n', 0; //21  
  60. loaddone: db 'loading finished. Running program...', 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement