Advertisement
GitHubUser

Assembler 1-0

Jan 22nd, 2022
1,487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; It's 8086 asm.
  2.  
  3. ; multi-segment executable file template.
  4.  
  5. data segment
  6.    ; add your data here!
  7.     pkey db "press any key...$"
  8. ends
  9.  
  10. stack segment
  11.     dw   128  dup(0)
  12. ends
  13.  
  14. code segment
  15. start:
  16. ; set segment registers:
  17.     mov ax, data
  18.     mov ds, ax
  19.     mov es, ax
  20.      
  21.        
  22.    ; Preinit
  23.    
  24.    core
  25.  
  26.  
  27. print macro x, y, attrib, sdat
  28. LOCAL   s_dcl, skip_dcl, s_dcl_end
  29.     pusha
  30.     mov dx, cs
  31.     mov es, dx
  32.     mov ah, 13h
  33.     mov al, 1
  34.     mov bh, 0
  35.     mov bl, attrib
  36.     mov cx, offset s_dcl_end - offset s_dcl
  37.     mov dl, x
  38.     mov dh, y
  39.     mov bp, offset s_dcl
  40.     int 10h
  41.     popa
  42.     jmp skip_dcl
  43.     s_dcl DB sdat
  44.     s_dcl_end DB 0
  45.     skip_dcl:    
  46. endm
  47. pause macro
  48.     mov ah, 0
  49.     int 16h
  50.     endm
  51. cls macro
  52.     pusha
  53.     mov ax, 0600h
  54.     mov bh, 0000_1111b
  55.     mov cx, 0
  56.     mov dh, 24
  57.     mov dl, 79
  58.     int 10h
  59.     popa
  60. endm
  61.  
  62. mouse macro
  63. mov ax, 1  
  64. int 33h
  65. print 1,60,1111_0000b, "Mouse initialized..."
  66. endm  
  67.  
  68. halt macro
  69.     cls
  70.       ret
  71.     endm
  72. noblink macro
  73. mov ax, 1003h ; disable blinking.  
  74. mov bx, 0  
  75. mov cx, 9    
  76. int 10h      
  77. endm
  78.  
  79. r400io macro
  80.     jmp r400iA
  81.     endm
  82.  
  83. setgraph macro
  84.    
  85. mov ah, 0   ; set display mode function.
  86. mov al, 13h ; mode 13h = 320x200 pixels, 256 colors.
  87. int 10h     ; set it
  88.  
  89. endm
  90. core macro
  91.                                                                    
  92.                             ; txt: .word 8
  93.         print 1,4,1111_0000b, "Processor : R400I (Intel Remoate 4000)"  
  94.         print 1,5,1111_0000b, "Arch 8x."
  95.       ; print 35,2,1001_1110b, "[ R400I GUI ]                             "
  96.         print
  97.         print 5, 20,0000_0000b, " "
  98.         print 6, 20,0001_0000b, " "
  99.         print 7, 20,0010_0000b, " "
  100.         print 8, 20,0100_0000b, " "
  101.         print 9, 20,0101_0000b, " "
  102.         print 10, 20,0110_0000b, " "
  103.         print 11, 20,0111_0000b, " "
  104.         print 12, 20,1000_0000b, " "
  105.        
  106.         print 13, 20,1111_0000b, " "
  107.        ;print 5, 19,0000_0000b, " "
  108.       ;; print 6, 22,0001_0000b, " "
  109.       ; print 7, 23,0010_0000b, " "
  110.       ; ;print 8, 24,0100_0000b, " "
  111.       ;
  112.    ; print 11, 27,0111_0000b, " "
  113.     ;   print 12, 28,1000_0000b, " "
  114.      ;     print 13, 29,1111_0000b, " "
  115.        
  116.        
  117.     endm
  118.  
  119.  
  120.  
  121.  
  122.  
  123. ; ALL INSTRUCTIONS :
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. noblink ; For DOS compatiblity.
  131.  r400icode:
  132.  
  133.  
  134.    mouse
  135.  
  136.  
  137.  r400i:
  138.  ; Instruction for disabling RET.
  139.    r400io
  140.  jmp r400i
  141.  
  142.  r400iA:
  143.    
  144.  jmp r400i
  145.  
  146. ret
  147.  
  148.  
  149.  
  150.  
  151.  
  152.            
  153.     lea dx, pkey
  154.     mov ah, 9
  155.     int 21h        ; output string at ds:dx
  156.    
  157.     ; wait for any key....    
  158.     mov ah, 1
  159.     int 21h
  160.    
  161.     mov ax, 4c00h ; exit to operating system.
  162.     int 21h    
  163. ends
  164.  
  165. end start ; set entry point and stop the assembler.
  166.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement