Guest User

Untitled

a guest
Mar 5th, 2022
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [org 0x7c00]
  2. xor ax, ax
  3. mov es, ax
  4. mov ds, ax
  5.  
  6. mov dl, [bootDiskNum]
  7. mov ah, 2
  8. mov al, 7
  9. mov ch, 0
  10. mov cl, 2
  11. mov dh, 0
  12. mov bx, 0x7e00
  13.  
  14. int 0x13
  15.  
  16. mainLoop:
  17. mov bx, intro
  18. call printString
  19. call newLine
  20.  
  21. mov bx, cmdBuffer
  22. xor cx, cx
  23. waitForKey:
  24.     mov ah, 0
  25.     int 0x16
  26.    
  27.     push bx
  28.     push cx
  29.     mov bx, badChar
  30.     mov cl, 0x00
  31.     cmpLoop:
  32.         inc bx
  33.         cmp ah, [bx]
  34.         je popBack
  35.         cmp [bx], cx
  36.         jne cmpLoop
  37.     pop cx
  38.     pop bx
  39.     jmp continue
  40.     popBack:
  41.         pop cx
  42.         pop bx
  43.         jmp waitForKey
  44.    
  45.     continue:
  46.     mov ah, 0x0e
  47.     cmp al, 0x0d
  48.     je enterKey
  49.     cmp al, 0x08
  50.     je backspaceKey
  51.    
  52.     cmp cx, 63
  53.     je waitForKey
  54.    
  55.     int 0x10
  56.     mov [bx], al
  57.     inc bx
  58.     inc cx
  59.  
  60.     jmp waitForKey
Advertisement
Add Comment
Please, Sign In to add comment