rehsd

Untitled

Oct 18th, 2022
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. ; *physical memory map*
  2. ;-----------------------
  3. ;- ROM -
  4. ;- 0.5 MB -
  5. ;- 0x80000-0xFFFFF -
  6. ;-----------------------
  7. ;- RAM -
  8. ;- 0.5 MB -
  9. ;- 0x00000-0x7FFFF -
  10. ;-----------------------
  11.  
  12. CPU 286
  13. BITS 16
  14.  
  15. TIMES 0x80000-($-$$) DB 0 ;Fill bottom half of ROM with zeros.
  16. ;Bottom half of address space used by RAM.
  17. ;Controlled with A19 decode.
  18.  
  19. ORG 0x8000 ;Usable ROM starts at physical address 0x80000
  20.  
  21. TOP: ;physically at 0x80000 in ROM
  22. CLI ;disable interrupts
  23. ;MOV AX, code
  24. ;MOV DS, AX
  25.  
  26. ;*** SETUP REGISTERS **********************************
  27. MOV AX, 0X0
  28. ; ;code segment
  29. MOV DS, AX ;data segment
  30. MOV ES, AX ;extra segment
  31. MOV SS, AX ;stack segment
  32. MOV SP, AX ;Start at 0, will wrap around to FFFE
  33. ;*** /SETUP REGISTERS *********************************
  34.  
  35.  
  36.  
  37. LOOP:
  38. CALL ONE
  39. CALL TWO
  40. CALL THREE
  41. CALL FOUR
  42. JMP LOOP
  43.  
  44. ONE:
  45. MOV AL, 0x33 ;00110011
  46. OUT 0x02, AL
  47. RET
  48.  
  49. TWO:
  50. MOV AL, 0xCC ;11001100
  51. OUT 0x04, AL
  52. RET
  53.  
  54. THREE:
  55. MOV AL, 0xAA ;10101010
  56. OUT 0x02, AL
  57. RET
  58.  
  59. FOUR:
  60. MOV AL, 0x55 ;01010101
  61. OUT 0x04, AL
  62. RET
  63.  
  64.  
  65. TIMES 0xFFFF0-($-$$) NOP ;Fill ROM with NOPs up to startup address
  66. ;(upper portion of 1 MB addr space)
  67. ;This will get to 0xFFFF0
  68.  
  69. RESET: ;at 0xFFFF0 Processor starts reading here
  70. JMP 0x8000:0x0 ;EA 00 00 00 80 Jump to TOP: label
  71.  
  72.  
  73. TIMES 0x100000-($-$$) DB 1 ;Fill the rest of ROM with bytes of 0x01
  74.  
  75.  
  76.  
Advertisement
Add Comment
Please, Sign In to add comment