Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Gina Mistura
  2. ; CIS 333
  3. ; Program 4
  4.  
  5.  
  6. ;-------------------------------------
  7. ;- Finally, the last Assembly program
  8. ;-------------------------------------
  9.  
  10.         .MODEL small
  11.         .STACK 100h
  12.         .DATA
  13.        
  14. name_msg    db  'Employee Name: $'
  15. phone_msg   db  'Employee Phone Muber: $'
  16. socsec_msg  db  'Employee Social Security Number: '
  17. birth_msg   db  'Employee Date of Birth: '
  18. success     db  'The structure was successfully written to file C:\asm\test.txt$'
  19.  
  20. file_buf    db  4*10 DUP    (?) ;buffer zone
  21. file_name   db  'C:\asm\test.txt',00h   ;ASCIIZ string
  22. dir_name    db  'C:\asm',00h
  23.  
  24. INPUTSTRUCT LABEL   BYTE
  25. MaxLen      db      30
  26. ActLen      db      0
  27. InputBuf    db      30 DUP (?)
  28. CLRFBuf     db      0Dh,0Ah,'$'            
  29.  
  30. handle1     dw      0
  31.  
  32. ;------------------------------
  33. ;-  Data for error checking
  34. ;------------------------------
  35.  
  36. cr      EQU 0Dh ;carriage return
  37. lf      EQU 0Ah ;line feed  
  38. errtbl  dw  0,err1,err2,err3,err4,err5,err6
  39.         dw  5 DUP (?)
  40.         dw  err12
  41. err1    db  'Invalid function number',lf,cr,'$'
  42. err2    db  'File not found',lf,cr,'$'
  43. err3    db  'Path not found',lf,cr,'$'
  44. err4    db  'Too many open files',lf,cr,'$'
  45. err5    db  'Access denied',lf,cr,'$'
  46. err6    db  'Invalid handle',lf,cr,'$'
  47. err12   db  'Invalid access code',lf,cr,'$'
  48.  
  49.         .CODE
  50.        
  51. homework5:
  52.     mov ax,@DATA
  53.     mov ds,ax
  54.    
  55.     mov ah,9
  56.     lea dx,name_msg
  57.     int 21h
  58.    
  59.     lea dx,INPUTSTRUCT
  60.     mov ah,0ah
  61.     int 21h
  62.    
  63.     mov bh,00h
  64.     mov bl,ActLen
  65.     mov InputBuf[bx],00h
  66.    
  67.     mov ax,4C00h
  68.     int 21h
  69.    
  70.     END homework5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement