Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Gina Mistura
- ; CIS 333
- ; Program 4
- ;-------------------------------------
- ;- Finally, the last Assembly program
- ;-------------------------------------
- .MODEL small
- .STACK 100h
- .DATA
- name_msg db 'Employee Name: $'
- phone_msg db 'Employee Phone Muber: $'
- socsec_msg db 'Employee Social Security Number: '
- birth_msg db 'Employee Date of Birth: '
- success db 'The structure was successfully written to file C:\asm\test.txt$'
- file_buf db 4*10 DUP (?) ;buffer zone
- file_name db 'C:\asm\test.txt',00h ;ASCIIZ string
- dir_name db 'C:\asm',00h
- INPUTSTRUCT LABEL BYTE
- MaxLen db 30
- ActLen db 0
- InputBuf db 30 DUP (?)
- CLRFBuf db 0Dh,0Ah,'$'
- handle1 dw 0
- ;------------------------------
- ;- Data for error checking
- ;------------------------------
- cr EQU 0Dh ;carriage return
- lf EQU 0Ah ;line feed
- errtbl dw 0,err1,err2,err3,err4,err5,err6
- dw 5 DUP (?)
- dw err12
- err1 db 'Invalid function number',lf,cr,'$'
- err2 db 'File not found',lf,cr,'$'
- err3 db 'Path not found',lf,cr,'$'
- err4 db 'Too many open files',lf,cr,'$'
- err5 db 'Access denied',lf,cr,'$'
- err6 db 'Invalid handle',lf,cr,'$'
- err12 db 'Invalid access code',lf,cr,'$'
- .CODE
- homework5:
- mov ax,@DATA
- mov ds,ax
- mov ah,9
- lea dx,name_msg
- int 21h
- lea dx,INPUTSTRUCT
- mov ah,0ah
- int 21h
- mov bh,00h
- mov bl,ActLen
- mov InputBuf[bx],00h
- mov ax,4C00h
- int 21h
- END homework5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement