Да уж. Задымился, пока разбирался, что уже и забыл всю ситуацию описать. Есть код. Компилирую его ТАСМом получаю на выходе ехе, который не может нормально мне вывести английские буквы. Уверен я в том, что это не у меня руки кривые потому что с помощью эмулятора emu8086 получаю рабочий COM файл, который спокойно по ЭТОМУ ЖЕ коду выводит те самые буквы. Вот код.
codesg segment para 'code'
assume es:codesg, ss:codesg, ds:codesg, cs:codesg
org 100h
prog:
mov ax,0003
int 10h
jmp main
; data section
imr db ?
buffer db 10 dup (?)
endl db 0Dh, 0Ah, '$'
blockmsg db 'IRQ1 is blocked now.$'
endmsg db 'Esc was pressed. Closing Program. Bye bye.$'
main:
call ClearScreen
call ReadImr
mov al,imr
call ByteToHex
lea dx,buffer
call PrintStr_bios
call BlockKeyboard
lea dx,blockmsg
call PrintStr_bios
lea dx,endl
call PrintStr_bios
waiting:
mov al,0Ah ; irr read command
out 20h,al
in al,20h ; read irr
and al,00000010b ; analizing irr. zero if there isn't any active
jz waiting
in al,60h ; get byte-code of pushing key
cmp al,01h ; esc was pushed
je progover
shl al,1 ; get rid of first byte of push/pop key
shr al,1
call ByteToHex
lea dx,buffer
call PrintStr_bios
call UnblockKeybooard
jmp main
progover:
lea dx,endmsg
call PrintStr
call UnblockKeybooard
; pause
mov dx, offset buffer;
mov ah, 0Ah
int 21h
; ====================
; work with imr for irq1, and unblock keyboard
; ======================
UnblockKeybooard proc near
push ax
in al,21h
and al,11111101b ; enable irq1
out 21h,al
pop ax
ret
UnblockKeybooard endp
; ======================
; print binary val of al
; al - hex int
; ======================
PrintBinaryString proc near
push ax
push bx
push cx
mov bl,al
mov cl,7
loop2:
mov al,bl
shr al,cl
add al,30h
call PrintSymbol
loop loop2
lea dx,endl
call PrintStr
pop cx
pop bx
pop ax
ret
PrintBinaryString endp
; ====================
; print symbol
; al - ascii of symbol
; ====================
PrintSymbol proc near
push ax
mov dl,al
mov ah,02h
int 21h
pop ax
ret
PrintSymbol endp
; ======================
; Blocking in imr for keyboard
; ======================
BlockKeyboard proc near
push ax
in al,21h
or al,00000010b ; irq1 disable
out 21h,al
pop ax
ret
BlockKeyboard endp
; =======================
; print str with '$'-end in buffer onto the screen
; ds:[dx] - offset of printing string
; =======================
PrintStr proc near
push ax
mov ah,09h
int 21h
pop ax
ret
PrintStr endp
; =======================
; intput - in ds:[dx] offset of string
; =======================
PrintStr_bios proc near
push di
push ax
push bx
push cx
push dx
; find out count of symbols
mov di,dx
mov al,'$'
mov cx,100h
mov bx,100h
repne scasb
inc cx
sub cx,bx
neg cx ; count
push cx
; cursor position to dx
mov ah, 03h
xor bh,bh ; page
int 10h
pop cx
; attributes for output
mov bl, 00000111b
; offset string
pop dx
mov bp,dx
mov ah,13h
xor al,al
int 10h ; print str
pop cx
pop bx
pop ax
pop di
ret
PrintStr_bios endp
; =====================
; read imr to imr var
; out - number to imr var
; ====================
ReadImr proc near
push ax
in al,21h
mov imr,al
pop ax
ret
ReadImr endp
; ===========================
; func convert content of imr to string with hex-numbers
; input - number in al
; output - str in buffer var with '$'-end
; ===========================
ByteToHex proc near
push cx
push di
push bx
mov bl,al
lea di, buffer
mov cl,8
loop1:
sub cl,4
mov al,bl
shr al,cl
and al,00001111b
cmp al,9
ja letter
add al,30h
jmp retry
letter:
add al,31h
retry:
mov [di],al
inc di
cmp cl,0
je done
jmp loop1
done:
mov byte ptr [di],'$'
pop bx
pop di
pop cx
ret
ByteToHex endp
; ===================
; clearing screen
; ===================
ClearScreen proc near
push ax
mov ah, 0 ; video mode
mov al, 2 ; number 2, first bit is 0 then - clear screen
int 10h
pop ax
ret
ClearScreen endp
codesg ends
end prog
Добавлено через 2 часа, 21 минуту и 17 секунд:Просмотрел память, там одни нули. Почему-то тасм не заполняет память.