Nettet25. jul. 2024 · 解:data segment buffer db 100() data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax mov cx,100 mov si,offset buffer … Nettetmov ah,3dh int 21h ;call the interupt jc terminate ;if error occurs, terminate program mov bx,ax ;put handler to file in bx mov cx,1 ;read one character at a time print: mov ah,3fh ;read from the opened file (its handler in bx) int 21h jc terminate ;end program if end of file is reached mov ax,dx ;char is in dl, send to ax for printing (char is in
INT 21H 指令说明及使用方法 - 暧鹅 - 博客园
Nettetmov AH,3Dh ; Функция открытия файла. mov AL,2 mov DX,offset fname ; Адрес имени файла. int 21h. mov handle,ax ; Получили дескриптор ; Изменим дату и время … Nettet11. mar. 2013 · To open a file you need to MOV 0x3d (open file) to the ah register, MOV the (pointer to the) filename to the DX register, and MOV the access mode bitmask ( 0x00 == read-only) to the al register, then call INT errupt 0x21. Sorry, I haven't used MASM, but I'm guessing that STR1 is not a valid pointer. Posted 11-Mar-13 12:07pm Yvan Rodrigues german lane fishery euxton
opening and reading a character from a file with emu8086
Nettet2. jun. 2011 · mov ax, @Data mov ds, ax In tiny model, you use the same segment for the data and the code. To make sure it's referring to the correct segment, you want to get … Nettet11. nov. 2015 · Move pointer to last char to it sub cx, dx ;Subtract the offset of text (in DX) from CX ;To get the actual number of chars in the buffer mov bx, 1 int 21h end_it: mov … Nettet23. mai 2024 · ·int 21h(P 指令执行)(1)01h:键盘输入并回显mov ah,01h;输入字符ASCII存到AL中int 21h(2)02h:屏幕显示输出mov dl,al;入口参数送AL中mov ah,02hint 21h(3)09h:屏幕输出字符串mov dx,data;字符串首地址送dxmov ah,09hint 21h(4)10(0Ah):屏幕输入字符串mov dx,he;字符串存放地址附加段... german lady racing driver